summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/xml')
-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 fb968ac74155..8ae40ffb696f 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -235,7 +235,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,
@@ -289,12 +289,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();
}