summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-09 09:49:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-09 13:40:44 +0100
commitf23388c4356c1c488f8445e97ba8d567d5bae8f1 (patch)
treee7285223cf4bb6dc26582e709ae19e0fa353a525 /sd
parenta0f5e32443296e7404b7646f3fc7a79ab1328399 (diff)
passed_freed_arg: InsertObjectAtView returns false if pObj was deleted
Change-Id: Ife8049e0426659f9b83504f1aced52b62159554b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107476 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/sdview3.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index e05e370d3321..d5c2f494c3e6 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -994,12 +994,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
nOptions |= SdrInsertFlags::DONTMARK;
}
- InsertObjectAtView( pObj, *pPV, nOptions );
+ // bInserted of false means that pObj has been deleted
+ bool bInserted = InsertObjectAtView( pObj, *pPV, nOptions );
- if( pImageMap )
+ if (bInserted && pImageMap)
pObj->AppendUserData( std::unique_ptr<SdrObjUserData>(new SvxIMapInfo( *pImageMap )) );
- if (pObj->IsChart())
+ if (bInserted && pObj->IsChart())
{
bool bDisableDataTableDialog = false;
svt::EmbeddedObjectRef::TryRunningState( xObj );