summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-15 12:48:47 +0100
committerAndras Timar <andras.timar@collabora.com>2015-04-16 12:58:22 +0200
commit1ddfd1df97607a2fa1281cb51c42044dc668761f (patch)
tree6c2d292b6bed34c1468342ccf80f0cbb95d450dd
parentce58792b4fa57eb280040eaca80560d1471aefa2 (diff)
fix crash on re-export of fdo50057-2.odt to odtcp-4.3-6
(cherry picked from commit 66c9aec156d974b939b680dccbb27e18fb153a23) Conflicts: sfx2/source/appl/fileobj.hxx Change-Id: Ice7a754dd4f42b5cf62ae2038b63d893b8a92fd8 Reviewed-on: https://gerrit.libreoffice.org/15326 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sfx2/source/appl/fileobj.cxx20
-rw-r--r--sfx2/source/appl/fileobj.hxx2
2 files changed, 15 insertions, 7 deletions
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index e123285cbd03..7ae5b6e4cd58 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -47,7 +47,9 @@
#define FILETYPE_OBJECT 3
SvFileObject::SvFileObject()
- : pOldParent(NULL)
+ : nPostUserEventId(0)
+ , pDelMed(NULL)
+ , pOldParent(NULL)
, nType(FILETYPE_TEXT)
, bLoadAgain(true)
, bSynchron(false)
@@ -64,14 +66,16 @@ SvFileObject::SvFileObject()
SvFileObject::~SvFileObject()
{
- if ( xMed.Is() )
+ if (xMed.Is())
{
xMed->SetDoneLink( Link() );
xMed.Clear();
}
+ if (nPostUserEventId)
+ Application::RemoveUserEvent(nPostUserEventId);
+ delete pDelMed;
}
-
bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
const OUString & rMimeType,
bool bGetSynchron )
@@ -482,10 +486,10 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG )
if( pThis->xMed.Is() )
{
pThis->xMed->SetDoneLink( Link() );
-
- Application::PostUserEvent(
+ pThis->pDelMed = new SfxMediumRef(pThis->xMed);
+ pThis->nPostUserEventId = Application::PostUserEvent(
STATIC_LINK( pThis, SvFileObject, DelMedium_Impl ),
- new SfxMediumRef( pThis->xMed ));
+ pThis->pDelMed);
pThis->xMed.Clear();
}
}
@@ -495,7 +499,9 @@ IMPL_STATIC_LINK( SvFileObject, LoadGrfReady_Impl, void*, EMPTYARG )
IMPL_STATIC_LINK( SvFileObject, DelMedium_Impl, SfxMediumRef*, pDelMed )
{
- (void)pThis;
+ pThis->nPostUserEventId = 0;
+ assert(pThis->pDelMed == pDelMed);
+ pThis->pDelMed = NULL;
delete pDelMed;
return 0;
}
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index d43e1ebe52e3..5e602b724aeb 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -33,6 +33,8 @@ class SvFileObject : public sfx2::SvLinkSource
OUString sReferer;
Link aEndEditLink;
SfxMediumRef xMed;
+ ImplSVEvent* nPostUserEventId;
+ SfxMediumRef* pDelMed;
Window* pOldParent;
sal_uInt8 nType;