diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-20 16:17:07 +0000 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-01-21 12:34:46 +0000 |
commit | 3cd11e5c96e1266f2f94ba572454b8c2b7a4d670 (patch) | |
tree | be5ece5263b7929dacf40be152f2ffc4e37c1c2a | |
parent | dad7161cc30b335a108c7850f453877a161969ae (diff) |
Resolves: fdo#84943 make fodt non crashy like odt for formulas inside shapes
where odt checks for a null pTxtCrsr and skips the object and fodt
just ploughed ahead. i.e. make fodt equally useless as odt (fdo#84942)
Change-Id: I915cc1f7c065ea83377e895a932636c82698cf1f
(cherry picked from commit 4345a3de0e5a600685fef5dc9fa422fe6849a0a3)
Reviewed-on: https://gerrit.libreoffice.org/14049
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/source/filter/xml/xmltexti.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 63d8927c494e..fd45c4267a29 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -232,7 +232,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( OSL_ENSURE( xCrsrTunnel.is(), "missing XUnoTunnel for Cursor" ); OTextCursorHelper *pTxtCrsr = reinterpret_cast< OTextCursorHelper * >( sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); - OSL_ENSURE( pTxtCrsr, "SwXTextCursor missing" ); + SAL_WARN_IF(!pTxtCrsr, "sw.uno", "SwXTextCursor missing"); SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport ); SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, @@ -286,12 +286,16 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( lcl_setObjectVisualArea( xObj, nAspect, aTwipSize, MAP_TWIP ); } - pFrmFmt = pDoc->getIDocumentContentOperations().Insert( *pTxtCrsr->GetPaM(), - ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), - &aItemSet, - NULL, - NULL ); - pOLENd = lcl_GetOLENode( pFrmFmt ); + if( pTxtCrsr ) + { + pFrmFmt = pDoc->getIDocumentContentOperations().Insert( *pTxtCrsr->GetPaM(), + ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), + &aItemSet, + NULL, + NULL ); + pOLENd = lcl_GetOLENode( pFrmFmt ); + } + if( pOLENd ) aObjName = pOLENd->GetOLEObj().GetCurrentPersistName(); } |