summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/inc/drawview.hxx2
-rw-r--r--sc/source/ui/view/drawview.cxx4
-rw-r--r--sc/source/ui/view/viewfun7.cxx6
3 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index 5a79b95cc60a..46f5598705f2 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -117,7 +117,7 @@ public:
bool HasMarkedControl() const;
bool HasMarkedInternal() const;
- void InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV);
+ bool InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV);
/** Returns the selected object, if it is the caption object of a cell note.
@param ppCaptData (out-param) If not null, returns the pointer to the caption object data. */
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 273431ef0bf5..c2a4dfe58144 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -804,7 +804,7 @@ bool ScDrawView::GetObjectIsMarked( const SdrObject* pObject )
return bisMarked;
}
-void ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV)
+bool ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV)
{
SdrInsertFlags nOptions=SdrInsertFlags::NONE;
// Do not change marks when the ole object is active
@@ -817,7 +817,7 @@ void ScDrawView::InsertObjectSafe(SdrObject* pObj, SdrPageView& rPV)
nOptions |= SdrInsertFlags::DONTMARK;
}
- InsertObjectAtView( pObj, rPV, nOptions );
+ return InsertObjectAtView(pObj, rPV, nOptions);
}
SdrObject* ScDrawView::GetMarkedNoteCaption( ScDrawObjData** ppCaptData )
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index b128516379ff..21ccfc3848a9 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -447,15 +447,15 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
pGrafObj->SetName(aName);
// don't mark if OLE
- pScDrawView->InsertObjectSafe(pGrafObj, *pScDrawView->GetSdrPageView());
+ bool bSuccess = pScDrawView->InsertObjectSafe(pGrafObj, *pScDrawView->GetSdrPageView());
// SetGraphicLink has to be used after inserting the object,
// otherwise an empty graphic is swapped in and the contact stuff crashes.
// See #i37444#.
- if (!rFile.isEmpty())
+ if (bSuccess && !rFile.isEmpty())
pGrafObj->SetGraphicLink( rFile, ""/*TODO?*/, rFilter );
- return true;
+ return bSuccess;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */