[Libreoffice-commits] core.git: desktop/inc desktop/source include/vcl svtools/source vcl/source

Chris Sherlock chris.sherlock79 at gmail.com
Mon Jan 20 07:28:19 PST 2014


 desktop/inc/app.hxx                |    2 +-
 desktop/source/app/app.cxx         |    2 +-
 include/vcl/svapp.hxx              |    3 +--
 svtools/source/config/apearcfg.cxx |    2 +-
 vcl/source/app/svapp.cxx           |    3 +--
 vcl/source/window/window.cxx       |    2 +-
 vcl/source/window/winproc.cxx      |   11 +++--------
 7 files changed, 9 insertions(+), 16 deletions(-)

New commits:
commit b799cb7528552b0538f3ee1f5afc935c406f5637
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Tue Jan 21 01:26:32 2014 +1100

    Remove unused Window parameter from SystemSettingsChanging
    
    This took a bit of code archaelogy for me to track down. It turns out that
    as part of an effort to optimize startup, the line of code in this function
    was commented out, presumably to be rewritten later. This happened in
    commit ee3351d78c in July 2001 (!).
    
    About three years later, in February 2004, the function was rewritten in
    commit 189c2388d80. As it turns out, the only two functions that used
    the Window parameter were vcl/source/window/window.cxx (which passed
    itself in, but of course this did nothing) and
    vcl/source/window/winproc.cxx. Furthermore, winproc only ever passed in
    the first frame, so it didn't really do anything either.
    
    Consequently, the function as it stands *now* only notifies the
    application that system settings have been changed. It doesn't care
    which window it tells.
    
    Therefore, I have excised this parameter from the function. I don't
    think it made sense when it was implemented anyway, so there is no net
    loss.
    
    After removing the unneeded parameter, I was also able to remove the
    Window parameter from winproc.cxx's ImplHandleSalSettings function as
    it was only ever used to set the top level window, which is now
    irrelevant.
    
    Change-Id: I84f2c5c5ff8969387da3af81e4a9c7f9ac6237e1
    Reviewed-on: https://gerrit.libreoffice.org/7541
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx
index 31d0dae..009bd75 100644
--- a/desktop/inc/app.hxx
+++ b/desktop/inc/app.hxx
@@ -78,7 +78,7 @@ class Desktop : public Application
         virtual void            DeInit();
         virtual sal_Bool            QueryExit();
         virtual sal_uInt16          Exception(sal_uInt16 nError);
-        virtual void            SystemSettingsChanging( AllSettings& rSettings, Window* pFrame );
+        virtual void            SystemSettingsChanging( AllSettings& rSettings );
         virtual void            AppEvent( const ApplicationEvent& rAppEvent );
 
         DECL_LINK(          OpenClients_Impl, void* );
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 691dc6c..962e2b4 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1933,7 +1933,7 @@ sal_Bool Desktop::InitializeQuickstartMode( const Reference< XComponentContext >
     }
 }
 
-void Desktop::SystemSettingsChanging( AllSettings& rSettings, Window* )
+void Desktop::SystemSettingsChanging( AllSettings& rSettings )
 {
     if ( !SvtTabAppearanceCfg::IsInitialized () )
         return;
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index a3333ee..0432a17 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -563,8 +563,7 @@ public:
      */
     static sal_Bool             IsUICaptured();
 
-    virtual void                SystemSettingsChanging( AllSettings& rSettings,
-                                                        Window* pFrame );
+    virtual void                SystemSettingsChanging( AllSettings& rSettings );
     static void                 MergeSystemSettings( AllSettings& rSettings );
 
     static void                 SetSettings( const AllSettings& rSettings );
diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx
index b24c200..81948c6 100644
--- a/svtools/source/config/apearcfg.cxx
+++ b/svtools/source/config/apearcfg.cxx
@@ -219,7 +219,7 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
 
     hAppSettings.SetStyleSettings( hAppStyle );
     pApp->MergeSystemSettings    ( hAppSettings );      // Allow system-settings to apply
-    pApp->SystemSettingsChanging ( hAppSettings, NULL );// Allow overruling of system-settings
+    pApp->SystemSettingsChanging ( hAppSettings );      // Allow overruling of system-settings
                                                         //is concerned with window drag
 
     pApp->SetSettings ( hAppSettings );
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 5e573d0..6d345f3 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -476,8 +476,7 @@ sal_Bool Application::IsUICaptured()
         return sal_False;
 }
 
-void Application::SystemSettingsChanging( AllSettings& /*rSettings*/,
-                                          Window* /*pFrame*/ )
+void Application::SystemSettingsChanging( AllSettings& /*rSettings*/ )
 {
 }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 3c9b9de..a24819c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -689,7 +689,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
 #endif
 
     if ( bCallHdl )
-        GetpApp()->SystemSettingsChanging( rSettings, this );
+        GetpApp()->SystemSettingsChanging( rSettings );
 }
 
 // -----------------------------------------------------------------------
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index ad61e89..fecf3bc 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -2124,13 +2124,8 @@ static void ImplHandleInputLanguageChange( Window* pWindow )
 
 // -----------------------------------------------------------------------
 
-static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent )
+static void ImplHandleSalSettings( sal_uInt16 nEvent )
 {
-    // Application Notification werden nur fuer das erste Window ausgeloest
-    ImplSVData* pSVData = ImplGetSVData();
-    if ( pWindow != pSVData->maWinData.mpFirstFrame )
-        return;
-
     Application* pApp = GetpApp();
     if ( !pApp )
         return;
@@ -2139,7 +2134,7 @@ static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent )
     {
         AllSettings aSettings = pApp->GetSettings();
         pApp->MergeSystemSettings( aSettings );
-        pApp->SystemSettingsChanging( aSettings, pWindow );
+        pApp->SystemSettingsChanging( aSettings );
         pApp->SetSettings( aSettings );
     }
     else
@@ -2539,7 +2534,7 @@ bool ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/,
         case SALEVENT_FONTCHANGED:
         case SALEVENT_DATETIMECHANGED:
         case SALEVENT_KEYBOARDCHANGED:
-            ImplHandleSalSettings( pWindow, nEvent );
+            ImplHandleSalSettings( nEvent );
             break;
 
         case SALEVENT_USEREVENT:


More information about the Libreoffice-commits mailing list