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