[Libreoffice-commits] .: 4 commits - basic/source sfx2/source xmlhelp/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Oct 22 13:04:37 PDT 2010


 basic/source/classes/sb.cxx                   |   11 ++--------
 sfx2/source/appl/imagemgr.cxx                 |   27 ++++++--------------------
 sfx2/source/dialog/dockwin.cxx                |   10 +++++----
 xmlhelp/source/cxxhelp/provider/databases.cxx |    2 -
 4 files changed, 17 insertions(+), 33 deletions(-)

New commits:
commit 91e635b2f8a56c6debc51eab00ded7ca91d4014b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 20:56:51 2010 +0100

    micro opt, move global

diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index a7461ce..fac8b15 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -82,7 +82,6 @@ using namespace com::sun::star::beans;
 
 static rtl::OUString aSlash( rtl::OUString::createFromAscii( "/" ) );
 static rtl::OUString aHelpFilesBaseName( rtl::OUString::createFromAscii( "help" ) );
-static rtl::OUString aHelpMediaType( rtl::OUString::createFromAscii( "application/vnd.sun.star.help" ) );
 
 rtl::OUString Databases::expandURL( const rtl::OUString& aURL )
 {
@@ -1545,6 +1544,7 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetHelpPackageFromP
     }
     if( bRegistered )
     {
+        rtl::OUString aHelpMediaType( RTL_CONSTASCII_USTRINGPARAM( "application/vnd.sun.star.help" ) );
         if( xPackage->isBundle() )
         {
             Sequence< Reference< deployment::XPackage > > aPkgSeq = xPackage->getBundle
commit c916ac645285d58c96bb6374fcb73bb2ea00e34c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 20:44:02 2010 +0100

    startup optimization, move static objects to first use point

diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx
index f414175..2e364cb 100644
--- a/sfx2/source/appl/imagemgr.cxx
+++ b/sfx2/source/appl/imagemgr.cxx
@@ -67,10 +67,6 @@ typedef std::hash_map< ::rtl::OUString,
                        ::rtl::OUStringHash,
                        ::std::equal_to< ::rtl::OUString > > ModuleIdToImagegMgr;
 
-static WeakReference< XModuleManager >                        m_xModuleManager;
-static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSupplier;
-static WeakReference< XURLTransformer >                       m_xURLTransformer;
-static ModuleIdToImagegMgr                                    m_aModuleIdToImageMgrMap;
 
 Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& aURL, BOOL bBig, BOOL bHiContrast )
 {
@@ -91,22 +87,6 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
     rtl::OUString aCommandURL( aURL );
     if ( nProtocol == INET_PROT_SLOT )
     {
-        /*
-        // Support old way to retrieve image via slot URL
-        Reference< XURLTransformer > xURLTransformer = m_xURLTransformer;
-        if ( !xURLTransformer.is() )
-        {
-            xURLTransformer = Reference< XURLTransformer >(
-                                ::comphelper::getProcessServiceFactory()->createInstance(
-                                    rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )),
-                                UNO_QUERY );
-            m_xURLTransformer = xURLTransformer;
-        }
-
-        URL aTargetURL;
-        aTargetURL.Complete = aURL;
-        xURLTransformer->parseStrict( aTargetURL );
-        USHORT nId = ( USHORT ) aTargetURL.Path.toInt32();*/
         USHORT nId = ( USHORT ) String(aURL).Copy(5).ToInt32();
         const SfxSlot* pSlot = 0;
         if ( xModel.is() )
@@ -171,6 +151,8 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
         }
     }
 
+    static WeakReference< XModuleManager > m_xModuleManager;
+
     Reference< XModuleManager > xModuleManager = m_xModuleManager;
 
     if ( !xModuleManager.is() )
@@ -189,11 +171,16 @@ Image SAL_CALL GetImage( const ::com::sun::star::uno::Reference< ::com::sun::sta
         {
             Reference< XImageManager > xModuleImageManager;
             rtl::OUString aModuleId = xModuleManager->identify( rFrame );
+
+            static ModuleIdToImagegMgr m_aModuleIdToImageMgrMap;
+
             ModuleIdToImagegMgr::iterator pIter = m_aModuleIdToImageMgrMap.find( aModuleId );
             if ( pIter != m_aModuleIdToImageMgrMap.end() )
                 xModuleImageManager = pIter->second;
             else
             {
+                static WeakReference< XModuleUIConfigurationManagerSupplier > m_xModuleCfgMgrSupplier;
+
                 Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier = m_xModuleCfgMgrSupplier;
 
                 if ( !xModuleCfgMgrSupplier.is() )
commit a452a4e6a743e069b44839177e7840681c80d555
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 20:41:43 2010 +0100

    startup optimization, move static objects to first use point

diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index b9a5eb5..fc2d45a 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -104,9 +104,6 @@ namespace
     };
 }
 
-static uno::WeakReference< container::XNameAccess > m_xWindowStateConfiguration;
-static uno::WeakReference< frame::XModuleManager >  m_xModuleManager;
-
 static bool lcl_getWindowState( const uno::Reference< container::XNameAccess >& xWindowStateMgr, const ::rtl::OUString& rResourceURL, WindowState& rWindowState )
 {
     bool bResult = false;
@@ -191,6 +188,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
                           uno::UNO_QUERY );
             }
             
+            static uno::WeakReference< frame::XModuleManager >  m_xModuleManager;
+
             uno::Reference< frame::XModuleManager > xModuleManager( m_xModuleManager );
             if ( !xModuleManager.is() )
             {
@@ -201,6 +200,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
                 m_xModuleManager = xModuleManager;
             }
             
+            static uno::WeakReference< container::XNameAccess > m_xWindowStateConfiguration;
+
             uno::Reference< container::XNameAccess > xWindowStateConfiguration( m_xWindowStateConfiguration );
             if ( !xWindowStateConfiguration.is() )
             {
@@ -248,7 +249,8 @@ SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd ,
 SfxChildWindow*  SfxDockingWrapper::CreateImpl( 
 Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo )
 { 
-    SfxChildWindow *pWin = new SfxDockingWrapper(pParent, nId, pBindings, pInfo); return pWin; 
+    SfxChildWindow *pWin = new SfxDockingWrapper(pParent, nId, pBindings, pInfo);
+    return pWin;
 } 
 
 sal_uInt16 SfxDockingWrapper::GetChildWindowId () 
commit 3b768960acebca4a47c9d53b40b0a12fa9a8ed83
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 22 20:37:35 2010 +0100

    startup optimization, move static strings to first use point

diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index ffef8da..1fb7db5 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -35,9 +35,7 @@
 #include <tools/rcid.h>
 #include <tools/config.hxx>
 #include <tools/stream.hxx>
-#ifndef __RSC //autogen
 #include <tools/errinf.hxx>
-#endif
 #include <basic/sbx.hxx>
 #include <tools/list.hxx>
 #include <tools/shl.hxx>
@@ -64,8 +62,6 @@
 #include <com/sun/star/script/ModuleInfo.hpp>
 using namespace ::com::sun::star::script;
 
-// #pragma SW_SEGMENT_CLASS( SBASIC, SBASIC_CODE )
-
 SV_IMPL_VARARR(SbTextPortions,SbTextPortion)
 
 TYPEINIT1(StarBASIC,SbxObject)
@@ -77,9 +73,6 @@ using com::sun::star::uno::Any;
 using com::sun::star::uno::UNO_QUERY;
 using com::sun::star::lang::XMultiServiceFactory;
 
-const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
-const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
-
 SbxObject* StarBASIC::getVBAGlobals( )
 {
     if ( !pVBAGlobals )
@@ -88,7 +81,7 @@ SbxObject* StarBASIC::getVBAGlobals( )
         if ( GetUNOConstant("ThisComponent", aThisDoc) )
         {
             Reference< XMultiServiceFactory > xDocFac( aThisDoc, UNO_QUERY );
-                        if ( xDocFac.is() )
+            if ( xDocFac.is() )
             {
                 try
                 {
@@ -100,6 +93,7 @@ SbxObject* StarBASIC::getVBAGlobals( )
                 }
             }
         }
+        const String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) );
         pVBAGlobals = (SbUnoObject*)Find( aVBAHook , SbxCLASS_DONTCARE );
     }
     return pVBAGlobals;
@@ -108,6 +102,7 @@ SbxObject* StarBASIC::getVBAGlobals( )
 //  i#i68894#
 SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t )
 {
+    const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") );
     if( rName == aThisComponent )
         return NULL;
     // rename to init globals


More information about the Libreoffice-commits mailing list