Kaydet (Commit) f10c365f authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#1187663 Dereference after null check

Change-Id: Icd652f0d1e24a22bb4cc42f6ea6b9409f6807a1a
üst 3c095024
...@@ -379,32 +379,31 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic, ...@@ -379,32 +379,31 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
MakeDrawLayer(); MakeDrawLayer();
ScDrawView* pScDrawView = GetScDrawView(); ScDrawView* pScDrawView = GetScDrawView();
if (!pScDrawView)
return false;
// #i123922# check if the drop was over an existing object; if yes, evtl. replace // #i123922# check if the drop was over an existing object; if yes, evtl. replace
// the graphic for a SdrGraphObj (including link state updates) or adapt the fill // the graphic for a SdrGraphObj (including link state updates) or adapt the fill
// style for other objects // style for other objects
if(pScDrawView) SdrPageView* pPageView = pScDrawView->GetSdrPageView();
if (pPageView)
{ {
SdrPageView* pPageView = pScDrawView->GetSdrPageView(); SdrObject* pPickObj = 0;
if (pScDrawView->PickObj(rPos, pScDrawView->getHitTolLog(), pPickObj, pPageView))
if(pPageView)
{ {
SdrObject* pPickObj = 0; const OUString aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP));
if (pScDrawView->PickObj(rPos, pScDrawView->getHitTolLog(), pPickObj, pPageView)) SdrObject* pResult = pScDrawView->ApplyGraphicToObject(
*pPickObj,
rGraphic,
aBeginUndo,
rFile,
rFilter);
if (pResult)
{ {
const OUString aBeginUndo(ScGlobal::GetRscString(STR_UNDO_DRAGDROP)); // we are done; mark the modified/new object
SdrObject* pResult = pScDrawView->ApplyGraphicToObject( pScDrawView->MarkObj(pResult, pScDrawView->GetSdrPageView());
*pPickObj, return true;
rGraphic,
aBeginUndo,
rFile,
rFilter);
if (pResult)
{
// we are done; mark the modified/new object
pScDrawView->MarkObj(pResult, pScDrawView->GetSdrPageView());
return true;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment