summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-20 16:17:07 +0000
committerAndras Timar <andras.timar@collabora.com>2015-01-24 16:54:43 +0100
commit76fc45742c31263c71b94584bf539df5f9b36e32 (patch)
treebd9b45b6714464395dfb8375e571e800c23bccfd /sw
parent2d9cc97eca4915cd51821cb7b319a637d17a9791 (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) (cherry picked from commit 4345a3de0e5a600685fef5dc9fa422fe6849a0a3) Conflicts: sw/source/filter/xml/xmltexti.cxx Change-Id: I915cc1f7c065ea83377e895a932636c82698cf1f Reviewed-on: https://gerrit.libreoffice.org/14058 Tested-by: Michael Stahl <mstahl@redhat.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/xml/xmltexti.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index 8f91b79639e0..fae4cd6de3b9 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -230,7 +230,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,
@@ -284,12 +284,16 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject(
lcl_setObjectVisualArea( xObj, nAspect, aTwipSize, MAP_TWIP );
}
- pFrmFmt = pDoc->Insert( *pTxtCrsr->GetPaM(),
- ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ),
- &aItemSet,
- NULL,
- NULL );
- pOLENd = lcl_GetOLENode( pFrmFmt );
+ if( pTxtCrsr )
+ {
+ pFrmFmt = pDoc->Insert( *pTxtCrsr->GetPaM(),
+ ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ),
+ &aItemSet,
+ NULL,
+ NULL );
+ pOLENd = lcl_GetOLENode( pFrmFmt );
+ }
+
if( pOLENd )
aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
}