package/source/xstor/xstorage.cxx               |    6 +++++-
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx |   13 +++++++++++--
 2 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 5cc5a03d799434b51f67256a46d52b823870be94
Author: Michael Stahl <mst...@redhat.com>
Date:   Fri Aug 16 12:35:26 2013 +0200

    fdo#68084: OOXML import: handle exceptions if stream is missing
    
    The bugdoc does not have a styles.xml but a stylesWithEffects.xml,
    whatever that may mean.  (the app.xml contains "Microsoft Macintosh Word")
    
    Change-Id: If3d11c5d166dcaf3d94129339559787c20e6db46
    (cherry picked from commit 6e3ac01f850228afb5c6cb1a33b101693aea8712)
    Reviewed-on: https://gerrit.libreoffice.org/5450
    Reviewed-by: Petr Mladek <pmla...@suse.cz>
    Tested-by: Petr Mladek <pmla...@suse.cz>

diff --git a/package/source/xstor/xstorage.cxx 
b/package/source/xstor/xstorage.cxx
index bfd2302..a2e0350 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -2194,7 +2194,11 @@ SotElement_Impl* OStorage::OpenStreamElement_Impl( const 
::rtl::OUString& aStrea
         if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE )
           || (( nOpenMode & embed::ElementModes::WRITE ) != 
embed::ElementModes::WRITE )
           || ( nOpenMode & embed::ElementModes::NOCREATE ) == 
embed::ElementModes::NOCREATE )
-            throw io::IOException( OSL_LOG_PREFIX, uno::Reference< 
uno::XInterface >() ); // TODO: access_denied
+        {
+            throw io::IOException("Element does not exist and cannot be "
+                    "created: \"" + aStreamName + "\"",
+                    uno::Reference< uno::XInterface >()); // TODO: 
access_denied
+        }
 
         // create a new StreamElement and insert it into the list
         pElement = m_pImpl->InsertStream( aStreamName, bEncr );
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx 
b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 29c64ad..58a1006 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -54,8 +54,17 @@ OOXMLDocumentImpl::~OOXMLDocumentImpl()
 void OOXMLDocumentImpl::resolveFastSubStream(Stream & rStreamHandler,
                                              OOXMLStream::StreamType_t nType)
 {
-    OOXMLStream::Pointer_t pStream
-        (OOXMLDocumentFactory::createStream(mpStream, nType));
+    OOXMLStream::Pointer_t pStream;
+    try
+    {
+        pStream = OOXMLDocumentFactory::createStream(mpStream, nType);
+    }
+    catch (uno::Exception const& e)
+    {
+        SAL_INFO("writerfilter", "resolveFastSubStream: exception while "
+                "resolving stream " << (unsigned)nType << " : " << e.Message);
+        return;
+    }
     OOXMLStream::Pointer_t savedStream = mpStream;
     mpStream = pStream;
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to