Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3624

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/24/3624/1

fdo#58949 EmbeddedObjectContainer: guard against embed::WrongStateException

The problem was that in case an exception was thrown, it was only caught
outside the loop, so in case any error occurred, we didn't even try to
export the remaining objects. At least in case of
embed::WrongStateException, this is safe to do.

(cherry picked from commit 6238cfe27f0a202f3fbf482cde2b0a3189adc86f)

Change-Id: I71a7abc45a89bebc667664bc001245bb886a8d83
---
M comphelper/source/container/embeddedobjectcontainer.cxx
1 file changed, 10 insertions(+), 5 deletions(-)



diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx 
b/comphelper/source/container/embeddedobjectcontainer.cxx
index ca0e4f1..935bf33 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -1415,10 +1415,14 @@
                         aArgs[2].Value <<= xStream;
                     }
 
-                    xPersist->storeAsEntry( _xStorage,
-                                            xPersist->getEntryName(),
-                                            uno::Sequence< beans::PropertyValue >(),
-                                            aArgs );
+                    try
+                    {
+                        xPersist->storeAsEntry( _xStorage, xPersist->getEntryName(), 
uno::Sequence< beans::PropertyValue >(), aArgs );
+                    }
+                    catch (const embed::WrongStateException& e)
+                    {
+                        SAL_WARN("comphelper", "failed to store '" << *pIter << "'");
+                    }
                 }
 
                 if ( bSwitchBackToLoaded )
@@ -1430,10 +1434,11 @@
         bResult = aCnt.CommitImageSubStorage();
 
     }
-    catch (const uno::Exception&)
+    catch (const uno::Exception& e)
     {
         // TODO/LATER: error handling
         bResult = sal_False;
+        SAL_WARN("comphelper", "failed. Message: " << e.Message);
     }
 
     // the old SO6 format does not store graphical replacements

-- 
To view, visit https://gerrit.libreoffice.org/3624
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71a7abc45a89bebc667664bc001245bb886a8d83
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Miklos Vajna <vmiklos@suse.cz>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.