summaryrefslogtreecommitdiff
path: root/sd/source/ui/func
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-28 10:30:30 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-28 13:14:00 +0000
commitf7d3344fdf45f90839711b250b15960f118ab6e3 (patch)
tree982f84c19bad8dd6649f2e985221013c0ef044c1 /sd/source/ui/func
parent10787356d93c0a913f4f6cd65920c57b3ec3e701 (diff)
coverity#736147 Dereference null return value
Change-Id: Ibcf624be5787b0bf8fd7b0697a4dc9377a22d825
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r--sd/source/ui/func/fusumry.cxx59
1 files changed, 31 insertions, 28 deletions
diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx
index f1493534e360..f8ef7f027cfb 100644
--- a/sd/source/ui/func/fusumry.cxx
+++ b/sd/source/ui/func/fusumry.cxx
@@ -183,40 +183,43 @@ void FuSummaryPage::DoExecute( SfxRequest& )
}
}
- if (pSummaryPage)
- {
- SdrTextObj* pTextObj = (SdrTextObj*) pSummaryPage->GetPresObj(PRESOBJ_OUTLINE);
+ if (!pSummaryPage)
+ return;
- // remove hard break- and character attributes
- SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
- sal_Int32 nParaCount = pOutl->GetParagraphCount();
+ SdrTextObj* pTextObj = (SdrTextObj*) pSummaryPage->GetPresObj(PRESOBJ_OUTLINE);
- for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
- {
- pOutl->SetStyleSheet( nPara, pStyle );
- pOutl->QuickRemoveCharAttribs(nPara);
- pOutl->SetParaAttribs(nPara, aEmptyEEAttr);
- pOutl->SetDepth(pOutl->GetParagraph(nPara), 0);
- }
+ if (!pTextObj)
+ return;
+
+ // remove hard break- and character attributes
+ SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
+ sal_Int32 nParaCount = pOutl->GetParagraphCount();
+
+ for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
+ {
+ pOutl->SetStyleSheet( nPara, pStyle );
+ pOutl->QuickRemoveCharAttribs(nPara);
+ pOutl->SetParaAttribs(nPara, aEmptyEEAttr);
+ pOutl->SetDepth(pOutl->GetParagraph(nPara), 0);
+ }
- pTextObj->SetOutlinerParaObject( pOutl->CreateParaObject() );
- pTextObj->SetEmptyPresObj(false);
+ pTextObj->SetOutlinerParaObject( pOutl->CreateParaObject() );
+ pTextObj->SetEmptyPresObj(false);
- // remove hard attributes (Flag to sal_True)
- SfxItemSet aAttr(mpDoc->GetPool());
- aAttr.Put(XLineStyleItem(XLINE_NONE));
- aAttr.Put(XFillStyleItem(XFILL_NONE));
- pTextObj->SetMergedItemSet(aAttr);
+ // remove hard attributes (Flag to sal_True)
+ SfxItemSet aAttr(mpDoc->GetPool());
+ aAttr.Put(XLineStyleItem(XLINE_NONE));
+ aAttr.Put(XFillStyleItem(XFILL_NONE));
+ pTextObj->SetMergedItemSet(aAttr);
- if( bBegUndo )
- mpView->EndUndo();
- delete pOutl;
+ if( bBegUndo )
+ mpView->EndUndo();
+ delete pOutl;
- DrawViewShell* pDrawViewShell= dynamic_cast< DrawViewShell* >( mpViewShell );
- if(pDrawViewShell)
- {
- pDrawViewShell->SwitchPage( (pSummaryPage->GetPageNum() - 1) / 2);
- }
+ DrawViewShell* pDrawViewShell= dynamic_cast< DrawViewShell* >( mpViewShell );
+ if(pDrawViewShell)
+ {
+ pDrawViewShell->SwitchPage( (pSummaryPage->GetPageNum() - 1) / 2);
}
}