summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-09-02 06:19:05 +0200
committerAndras Timar <andras.timar@collabora.com>2017-09-08 11:38:33 +0200
commit149cdbca68e00b6ce807ba1719d5ce6a5dc35803 (patch)
treea6c3dad6a31b0ed05466ab1167469654fa87cf94
parent7b5d0439b7cb7255167e5bf572a4a72868db5d82 (diff)
tdf#109261: Crash when adding a video to a slide with zero undo steps
When undo is disabled (no undo steps), ReplaceObjectAtView() method frees pPickObj, so we need to save it's reused data first. Reviewed-on: https://gerrit.libreoffice.org/41822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 27068e6cc39aed8ebfa5fdd7a67acb89f5adcb89) Change-Id: Icbc800d4d33cf229006aecde7d62aa2a7ea35879 Reviewed-on: https://gerrit.libreoffice.org/41861 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 3ce90f78ed77c76ec6e0af3731f2fb37628ef89c)
-rw-r--r--sd/source/ui/view/sdview4.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 96a2ffc5363c..63f8260e4aac 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -341,8 +341,12 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM
else if( pPV )
{
Rectangle aRect( rPos, rSize );
+ SdrObjUserCall* pUserCall = nullptr;
if( pPickObj )
+ {
aRect = pPickObj->GetLogicRect();
+ pUserCall = pPickObj->GetUserCall(); // ReplaceObjectAtView can free pPickObj
+ }
pNewMediaObj = new SdrMediaObj( aRect );
@@ -371,9 +375,9 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM
if( pPickObj )
{
- pNewMediaObj->AdjustToMaxRect( pPickObj->GetLogicRect() );
+ pNewMediaObj->AdjustToMaxRect( aRect );
if( bIsPres )
- pNewMediaObj->SetUserCall(pPickObj->GetUserCall());
+ pNewMediaObj->SetUserCall( pUserCall );
}
}