summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/outliner/outliner.cxx3
-rw-r--r--sd/source/ui/view/outlnvsh.cxx5
2 files changed, 3 insertions, 5 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 4d7214b5b62e..aaa843da69c0 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<sal_uLong>(nStartPara) + nCount >
static_cast<sal_uLong>(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 03e899d280e1..e3b4aa7a7522 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()) )