1 |
From fdb1d62a09f7320ee5c2828aa4ce84248a6e3e4e Mon Sep 17 00:00:00 2001 |
2 |
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> |
3 |
Date: Thu, 17 Jul 2014 13:48:30 +0100 |
4 |
Subject: [PATCH] Related: rhbz#1117853 nStartPara of EE_PARA_NOT_FOUND |
5 |
|
6 |
we know that nStartPara is EE_PARA_NOT_FOUND so rOutliner.GetAbsPos must have |
7 |
returned that, but we don't know the circumstances that lead to that yet. |
8 |
|
9 |
Change-Id: I53a488317d154b4a3c050248b8737da0a611ca43 |
10 |
--- |
11 |
editeng/source/outliner/outliner.cxx | 3 +-- |
12 |
sd/source/ui/view/outlnvsh.cxx | 5 ++--- |
13 |
2 files changed, 3 insertions(+), 5 deletions(-) |
14 |
|
15 |
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx |
16 |
index 4d7214b..aaa843d 100644 |
17 |
--- a/editeng/source/outliner/outliner.cxx |
18 |
+++ b/editeng/source/outliner/outliner.cxx |
19 |
@@ -384,7 +384,6 @@ sal_Int32 Outliner::GetBulletsNumberingStatus() const |
20 |
|
21 |
OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 nCount ) const |
22 |
{ |
23 |
- |
24 |
if ( static_cast<sal_uLong>(nStartPara) + nCount > |
25 |
static_cast<sal_uLong>(pParaList->GetParagraphCount()) ) |
26 |
nCount = pParaList->GetParagraphCount() - nStartPara; |
27 |
@@ -394,7 +393,7 @@ OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 |
28 |
if ( ( nStartPara + nCount ) > pEditEngine->GetParagraphCount() ) |
29 |
nCount = pEditEngine->GetParagraphCount() - nStartPara; |
30 |
|
31 |
- if( !nCount ) |
32 |
+ if (nCount <= 0) |
33 |
return NULL; |
34 |
|
35 |
EditTextObject* pText = pEditEngine->CreateTextObject( nStartPara, nCount ); |
36 |
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx |
37 |
index 03e899d..e3b4aa7 100644 |
38 |
--- a/sd/source/ui/view/outlnvsh.cxx |
39 |
+++ b/sd/source/ui/view/outlnvsh.cxx |
40 |
@@ -1658,7 +1658,6 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara ) |
41 |
|
42 |
::Outliner* pOutliner = pOlView->GetOutliner(); |
43 |
SdrTextObj* pTO = pOlView->GetTitleTextObject( pPage ); |
44 |
- OutlinerParaObject* pOPO = NULL; |
45 |
|
46 |
OUString aTest = pOutliner->GetText(pPara); |
47 |
bool bText = !aTest.isEmpty(); |
48 |
@@ -1675,9 +1674,9 @@ bool OutlineViewShell::UpdateTitleObject( SdPage* pPage, Paragraph* pPara ) |
49 |
} |
50 |
|
51 |
// if we have a title object and a text, set the text |
52 |
- if( pTO ) |
53 |
+ OutlinerParaObject* pOPO = pTO ? pOutliner->CreateParaObject(pOutliner->GetAbsPos(pPara), 1) : NULL; |
54 |
+ if (pOPO) |
55 |
{ |
56 |
- pOPO = pOutliner->CreateParaObject( pOutliner->GetAbsPos( pPara ), 1 ); |
57 |
pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT ); |
58 |
pOPO->SetVertical( pTO->IsVerticalWriting() ); |
59 |
if( pTO->GetOutlinerParaObject() && (pOPO->GetTextObject() == pTO->GetOutlinerParaObject()->GetTextObject()) ) |
60 |
-- |
61 |
1.9.3 |
62 |
|