[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - desktop/Library_sofficeapp.mk desktop/source

Michael Meeks michael.meeks at suse.com
Mon May 13 01:36:25 PDT 2013


 desktop/Library_sofficeapp.mk  |    2 -
 desktop/source/app/appinit.cxx |   42 +++++++++++++++++++++++------------------
 2 files changed, 25 insertions(+), 19 deletions(-)

New commits:
commit 0179aca82573724072b19fc1e8e669f133105dd4
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Sat May 11 17:52:26 2013 +0100

    fdo#64311 - fix pre-processor conditionals & don't bail-out without gnome-vfs.
    
    (cherry picked from commit fbc486a449808d1d9261f67ffaa4f0213e80787e)
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
    
    Conflicts:
    	desktop/Library_sofficeapp.mk
    	desktop/source/app/appinit.cxx
    
    fdo#64311 - fix namespace issue / compile failure.
    
    (cherry picked from commit 8627bf17d565e085bb204b91dfe596c4a0430d1d)
    
    Change-Id: Ia7a805c95625b52fc99face000587692de21461e
    7ce3837a1a451560f5867786bb20d8280e7bef23
    Reviewed-on: https://gerrit.libreoffice.org/3882
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 4a6fccf..8aa9d54 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -38,7 +38,7 @@ $(eval $(call gb_Library_use_sdk_api,sofficeapp))
 
 $(eval $(call gb_Library_add_defs,sofficeapp,\
     -DDESKTOP_DLLIMPLEMENTATION \
-    $(if $(filter TRUE,$(ENABLE_GNOMEVFS)),-DGNOME_VFS_ENABLED) \
+    $(if $(filter TRUE,$(ENABLE_GNOMEVFS)),-DENABLE_GNOME_VFS) \
     $(if $(filter WNT,$(GUI)),-DENABLE_QUICKSTART_APPLET) \
     $(if $(filter aqua,$(GUIBASE)),-DENABLE_QUICKSTART_APPLET) \
     $(if $(filter TRUE,$(ENABLE_SYSTRAY_GTK)),-DENABLE_QUICKSTART_APPLET) \
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index 7012243..92ab2bc 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -80,26 +80,32 @@ static void configureUcb()
     // createInstance w/o args directly to obtain an instance:
     UniversalContentBroker::create(comphelper::getProcessComponentContext());
 
-#ifdef GNOME_VFS_ENABLED
-    // Instantiate GNOME-VFS UCP in the thread that initialized GNOME in order
-    // to avoid a deadlock that may occure in case the UCP gets initialized from
-    // a different thread (which may happen when calling remotely via UNO); this
-    // is not a fix, just a workaround:
-    Reference< XCurrentContext > xCurrentContext(getCurrentContext());
-    Any aValue(xCurrentContext->getValueByName("system.desktop-environment"));
-    OUString aDesktopEnvironment;
-    if ((aValue >>= aDesktopEnvironment) && aDesktopEnvironment == "GNOME")
+#ifdef ENABLE_GNOME_VFS
+    try {
+        // Instantiate GNOME-VFS UCP in the thread that initialized GNOME in order
+        // to avoid a deadlock that may occure in case the UCP gets initialized from
+        // a different thread (which may happen when calling remotely via UNO); this
+        // is not a fix, just a workaround:
+        Reference< XCurrentContext > xCurrentContext(getCurrentContext());
+        Any aValue(xCurrentContext->getValueByName("system.desktop-environment"));
+        OUString aDesktopEnvironment;
+        if ((aValue >>= aDesktopEnvironment) && aDesktopEnvironment == "GNOME")
+        {
+            Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+            UniversalContentBroker::create(xContext)
+                ->registerContentProvider(
+                        Reference<XContentProvider>(
+                        xContext->getServiceManager()->createInstanceWithContext(
+                                "com.sun.star.ucb.GnomeVFSContentProvider", xContext),
+                        UNO_QUERY_THROW),
+                        ".*", false);
+        }
+    }
+    catch ( const Exception & )
     {
-        UniversalContentBroker::create(
-            comphelper::getProcessComponentContext())->
-            registerContentProvider(
-                Reference<XContentProvider>(
-                    comphelper::getProcessServiceFactory()->createInstance(
-                        "com.sun.star.ucb.GnomeVFSContentProvider"),
-                    UNO_QUERY_THROW),
-                ".*", false);
+        OSL_FAIL( "missing gnome-vfs component to initialize thread workaround" );
     }
-#endif // GNOME_VFS_ENABLED
+#endif // ENABLE_GNOME_VFS
 }
 
 void Desktop::InitApplicationServiceManager()


More information about the Libreoffice-commits mailing list