coverity#736147 Dereference null return value
Change-Id: Ibcf624be5787b0bf8fd7b0697a4dc9377a22d825
This commit is contained in:
@@ -183,40 +183,43 @@ void FuSummaryPage::DoExecute( SfxRequest& )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSummaryPage)
|
if (!pSummaryPage)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SdrTextObj* pTextObj = (SdrTextObj*) pSummaryPage->GetPresObj(PRESOBJ_OUTLINE);
|
||||||
|
|
||||||
|
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++)
|
||||||
{
|
{
|
||||||
SdrTextObj* pTextObj = (SdrTextObj*) pSummaryPage->GetPresObj(PRESOBJ_OUTLINE);
|
pOutl->SetStyleSheet( nPara, pStyle );
|
||||||
|
pOutl->QuickRemoveCharAttribs(nPara);
|
||||||
|
pOutl->SetParaAttribs(nPara, aEmptyEEAttr);
|
||||||
|
pOutl->SetDepth(pOutl->GetParagraph(nPara), 0);
|
||||||
|
}
|
||||||
|
|
||||||
// remove hard break- and character attributes
|
pTextObj->SetOutlinerParaObject( pOutl->CreateParaObject() );
|
||||||
SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
|
pTextObj->SetEmptyPresObj(false);
|
||||||
sal_Int32 nParaCount = pOutl->GetParagraphCount();
|
|
||||||
|
|
||||||
for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
|
// remove hard attributes (Flag to sal_True)
|
||||||
{
|
SfxItemSet aAttr(mpDoc->GetPool());
|
||||||
pOutl->SetStyleSheet( nPara, pStyle );
|
aAttr.Put(XLineStyleItem(XLINE_NONE));
|
||||||
pOutl->QuickRemoveCharAttribs(nPara);
|
aAttr.Put(XFillStyleItem(XFILL_NONE));
|
||||||
pOutl->SetParaAttribs(nPara, aEmptyEEAttr);
|
pTextObj->SetMergedItemSet(aAttr);
|
||||||
pOutl->SetDepth(pOutl->GetParagraph(nPara), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pTextObj->SetOutlinerParaObject( pOutl->CreateParaObject() );
|
if( bBegUndo )
|
||||||
pTextObj->SetEmptyPresObj(false);
|
mpView->EndUndo();
|
||||||
|
delete pOutl;
|
||||||
|
|
||||||
// remove hard attributes (Flag to sal_True)
|
DrawViewShell* pDrawViewShell= dynamic_cast< DrawViewShell* >( mpViewShell );
|
||||||
SfxItemSet aAttr(mpDoc->GetPool());
|
if(pDrawViewShell)
|
||||||
aAttr.Put(XLineStyleItem(XLINE_NONE));
|
{
|
||||||
aAttr.Put(XFillStyleItem(XFILL_NONE));
|
pDrawViewShell->SwitchPage( (pSummaryPage->GetPageNum() - 1) / 2);
|
||||||
pTextObj->SetMergedItemSet(aAttr);
|
|
||||||
|
|
||||||
if( bBegUndo )
|
|
||||||
mpView->EndUndo();
|
|
||||||
delete pOutl;
|
|
||||||
|
|
||||||
DrawViewShell* pDrawViewShell= dynamic_cast< DrawViewShell* >( mpViewShell );
|
|
||||||
if(pDrawViewShell)
|
|
||||||
{
|
|
||||||
pDrawViewShell->SwitchPage( (pSummaryPage->GetPageNum() - 1) / 2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user