[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - extensions/source

Michael Meeks michael at kemper.freedesktop.org
Mon Feb 20 08:54:57 PST 2012


 extensions/source/plugin/base/xplugin.cxx |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 5ccce56c5bd5e220c0fa81ba387eefa3ed8de0a4
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sun Feb 12 21:54:41 2012 +0100

    extensions: plugin: assertion from OUString::copy
    
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index f0fa33b..0bdc167 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -917,9 +917,9 @@ PluginDescription XPlugin_Impl::fitDescription( const OUString& rURL )
     }
 
     int nPos = rURL.lastIndexOf( (sal_Unicode)'.' );
-    OUString aExt = rURL.copy( nPos ).toAsciiLowerCase();
     if( nPos != -1 )
     {
+        OUString const aExt = rURL.copy( nPos ).toAsciiLowerCase();
         for( int i = 0; i < aDescrs.getLength(); i++ )
         {
             OUString aThisExt = pDescrs[ i ].Extension.toAsciiLowerCase();
commit 187af294547bc611c2454eaaec945324ed897f5a
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sun Feb 12 21:54:42 2012 +0100

    extensions: plugin: UNX: don't crash headless
    
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index d8acf40..f0fa33b 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -523,7 +523,10 @@ void XPlugin_Impl::loadPlugin()
     }
     const SystemEnvData* pEnvData = getSysChildSysData();
 #if defined( UNX ) && !(defined(QUARTZ))
-    XSync( (Display*)pEnvData->pDisplay, False );
+    if (pEnvData->pDisplay) // headless?
+    {
+        XSync( (Display*)pEnvData->pDisplay, False );
+    }
 #endif
     if( ! getPluginComm() )
     {
@@ -568,8 +571,15 @@ void XPlugin_Impl::loadPlugin()
     // m_aNPWindow is set up in the MacPluginComm from the view
     m_aSysPlugData.m_pParentView = pEnvData->pView;
 #elif defined( UNX )
-    XSync( (Display*)pEnvData->pDisplay, False );
-    m_aNPWindow.window      = (void*)pEnvData->aWindow;
+    if (pEnvData->pDisplay) // headless?
+    {
+        XSync( (Display*)pEnvData->pDisplay, False );
+        m_aNPWindow.window  = (void*)pEnvData->aWindow;
+    }
+    else
+    {
+        m_aNPWindow.window  = NULL;
+    }
     m_aNPWindow.ws_info     = NULL;
 #else
     m_aNPWindow.window = (void*)pEnvData->hWnd;


More information about the Libreoffice-commits mailing list