diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-02 06:19:05 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-09-02 07:18:10 +0200 |
commit | 27068e6cc39aed8ebfa5fdd7a67acb89f5adcb89 (patch) | |
tree | 645d2463d1aa2187a4cecbc0cb894dc390a8cc21 /sd/source | |
parent | 1e8a38488f553ec2449dbc316a7a1a1fe17f48c2 (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.
Change-Id: Icbc800d4d33cf229006aecde7d62aa2a7ea35879
Reviewed-on: https://gerrit.libreoffice.org/41822
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index f5fce44dd92c..2435a576972d 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -340,8 +340,12 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM else if( pPV ) { ::tools::Rectangle aRect( rPos, rSize ); + SdrObjUserCall* pUserCall = nullptr; if( pPickObj ) + { aRect = pPickObj->GetLogicRect(); + pUserCall = pPickObj->GetUserCall(); // ReplaceObjectAtView can free pPickObj + } pNewMediaObj = new SdrMediaObj( aRect ); @@ -370,9 +374,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 ); } } |