Blame SOURCES/0001-Related-rhbz-1117853-nStartPara-of-EE_PARA_NOT_FOUND.patch

ebc4bd
From fdb1d62a09f7320ee5c2828aa4ce84248a6e3e4e Mon Sep 17 00:00:00 2001
ebc4bd
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
ebc4bd
Date: Thu, 17 Jul 2014 13:48:30 +0100
ebc4bd
Subject: [PATCH] Related: rhbz#1117853 nStartPara of EE_PARA_NOT_FOUND
ebc4bd
ebc4bd
we know that nStartPara is EE_PARA_NOT_FOUND so rOutliner.GetAbsPos must have
ebc4bd
returned that, but we don't know the circumstances that lead to that yet.
ebc4bd
ebc4bd
Change-Id: I53a488317d154b4a3c050248b8737da0a611ca43
ebc4bd
---
ebc4bd
 editeng/source/outliner/outliner.cxx | 3 +--
ebc4bd
 sd/source/ui/view/outlnvsh.cxx       | 5 ++---
ebc4bd
 2 files changed, 3 insertions(+), 5 deletions(-)
ebc4bd
ebc4bd
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
ebc4bd
index 4d7214b..aaa843d 100644
ebc4bd
--- a/editeng/source/outliner/outliner.cxx
ebc4bd
+++ b/editeng/source/outliner/outliner.cxx
ebc4bd
@@ -384,7 +384,6 @@ sal_Int32 Outliner::GetBulletsNumberingStatus() const
ebc4bd
 
ebc4bd
 OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 nCount ) const
ebc4bd
 {
ebc4bd
-
ebc4bd
     if ( static_cast<sal_uLong>(nStartPara) + nCount >
ebc4bd
             static_cast<sal_uLong>(pParaList->GetParagraphCount()) )
ebc4bd
         nCount = pParaList->GetParagraphCount() - nStartPara;
ebc4bd
@@ -394,7 +393,7 @@ OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32
ebc4bd
     if ( ( nStartPara + nCount ) > pEditEngine->GetParagraphCount() )
ebc4bd
         nCount = pEditEngine->GetParagraphCount() - nStartPara;
ebc4bd
 
ebc4bd
-    if( !nCount )
ebc4bd
+    if (nCount <= 0)
ebc4bd
         return NULL;
ebc4bd
 
ebc4bd
     EditTextObject* pText = pEditEngine->CreateTextObject( nStartPara, nCount );
ebc4bd
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
ebc4bd
index 03e899d..e3b4aa7 100644
ebc4bd
--- a/sd/source/ui/view/outlnvsh.cxx
ebc4bd
+++ b/sd/source/ui/view/outlnvsh.cxx
ebc4bd
@@ -1658,7 +1658,6 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
ebc4bd
 
ebc4bd
     ::Outliner*             pOutliner = pOlView->GetOutliner();
ebc4bd
     SdrTextObj*         pTO  = pOlView->GetTitleTextObject( pPage );
ebc4bd
-    OutlinerParaObject* pOPO = NULL;
ebc4bd
 
ebc4bd
     OUString aTest = pOutliner->GetText(pPara);
ebc4bd
     bool    bText = !aTest.isEmpty();
ebc4bd
@@ -1675,9 +1674,9 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara )
ebc4bd
         }
ebc4bd
 
ebc4bd
         // if we have a title object and a text, set the text
ebc4bd
-        if( pTO )
ebc4bd
+        OutlinerParaObject* pOPO = pTO ? pOutliner->CreateParaObject(pOutliner->GetAbsPos(pPara), 1) : NULL;
ebc4bd
+        if (pOPO)
ebc4bd
         {
ebc4bd
-            pOPO = pOutliner->CreateParaObject( pOutliner->GetAbsPos( pPara ), 1 );
ebc4bd
             pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT );
ebc4bd
             pOPO->SetVertical( pTO->IsVerticalWriting() );
ebc4bd
             if( pTO->GetOutlinerParaObject() && (pOPO->GetTextObject() == pTO->GetOutlinerParaObject()->GetTextObject()) )
ebc4bd
-- 
ebc4bd
1.9.3
ebc4bd