[Libreoffice-commits] core.git: dbaccess/source

Miklos Vajna vmiklos at collabora.co.uk
Fri May 8 10:16:49 PDT 2015


 dbaccess/source/core/dataaccess/ModelImpl.cxx |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

New commits:
commit 66f866d2f5f65a677f3721b7d6c482bf724c97a7
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri May 8 18:57:46 2015 +0200

    dbaccess: avoid exceptions during loading embedded data sources
    
    Situation before/after the patch is the same, just silence lots of
    harmless warnings for now.
    
    Change-Id: I00428bdfd939d8cdd3bfd447339e0417e70f4689

diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 936ba5c..4788df6 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -824,21 +824,27 @@ Reference< XStorage > ODatabaseModelImpl::getOrCreateRootStorage()
             aStorageCreationArgs[1] <<= ElementModes::READWRITE;
 
             Reference< XStorage > xDocumentStorage;
-            try
-            {
-                xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), UNO_QUERY_THROW );
-            }
-            catch( const Exception& )
+            OUString sURL;
+            aSource >>= sURL;
+            // Don't try to load a meta-URL as-is.
+            if (!sURL.startsWithIgnoreAsciiCase("vnd.sun.star.pkg:"))
             {
-                m_bDocumentReadOnly = true;
-                aStorageCreationArgs[1] <<= ElementModes::READ;
                 try
                 {
                     xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), UNO_QUERY_THROW );
                 }
                 catch( const Exception& )
                 {
-                    DBG_UNHANDLED_EXCEPTION();
+                    m_bDocumentReadOnly = true;
+                    aStorageCreationArgs[1] <<= ElementModes::READ;
+                    try
+                    {
+                        xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), UNO_QUERY_THROW );
+                    }
+                    catch( const Exception& )
+                    {
+                        DBG_UNHANDLED_EXCEPTION();
+                    }
                 }
             }
 


More information about the Libreoffice-commits mailing list