svx/source/unodraw/unomod.cxx |    8 ++++++++
 xmloff/source/text/txtimp.cxx |    8 ++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit bebf8ccfba37f77d6a43c7874249b31736467b17
Author: Jan Holesovsky <[email protected]>
Date:   Fri Apr 12 13:06:52 2013 +0200

    i#98430: Import at least the shape.
    
    The image that is inside is dropped though, we do not have support for that 
in
    editeng.
    
    Change-Id: I16dc1656e6f71fd80136bc39233decef4e1d4069

diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index f8af587..3ae9b26 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -49,6 +49,7 @@
 #include <svx/svdobj.hxx>
 #include <svx/svdpage.hxx>
 #include <svx/unoshape.hxx>
+#include <svx/xmlgrhlp.hxx>
 
 #include <com/sun/star/text/textfield/Type.hpp>
 
@@ -183,6 +184,13 @@ uno::Reference< uno::XInterface > SAL_CALL 
SvxUnoDrawMSFactory::createInstance(
             return uno::Reference< uno::XInterface >( (drawing::XShape*) 
SvxDrawPage::CreateShapeByTypeAndInventor( nT, nI ) );
         }
     }
+    else if ( rServiceSpecifier == 
"com.sun.star.document.ImportGraphicObjectResolver" )
+    {
+        SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create( 
GRAPHICHELPER_MODE_READ );
+        uno::Reference< uno::XInterface> xRet( static_cast< 
::cppu::OWeakObject* >( pGraphicHelper ) );
+        pGraphicHelper->release();
+        return xRet;
+    }
 
     uno::Reference< uno::XInterface > xRet( createTextField( rServiceSpecifier 
) );
     if( !xRet.is() )
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index fb457b6..1a4bb7a 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -1167,8 +1167,12 @@ void XMLTextImportHelper::InsertTextContent(
     DBG_ASSERT(m_pImpl->m_xCursorAsRange.is(), "no range");
     if (m_pImpl->m_xText.is())
     {
-        m_pImpl->m_xText->insertTextContent(
-            m_pImpl->m_xCursorAsRange, xContent, sal_False);
+        try {
+            m_pImpl->m_xText->insertTextContent( m_pImpl->m_xCursorAsRange, 
xContent, sal_False);
+        } catch ( const lang::IllegalArgumentException & )
+        {
+            SAL_WARN( "xmloff", "Cannot import part of the text - probably an 
image in the text frame?" );
+        }
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to