[Libreoffice-commits] core.git: vcl/osx vcl/source

Stephan Bergmann sbergman at redhat.com
Fri Jun 30 06:53:29 UTC 2017


 vcl/osx/salinst.cxx          |    5 ++---
 vcl/osx/salnativewidgets.cxx |    4 +---
 vcl/osx/salnstimer.mm        |    2 +-
 vcl/osx/saltimer.cxx         |    2 +-
 vcl/source/window/window.cxx |    3 ++-
 5 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit c6636c588be1f68f1ec0acc9001a1057f8e1885c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jun 30 08:53:03 2017 +0200

    loplugin:oncevar
    
    Change-Id: I740ccb3335d602d309422ba26913c4503c6345f0

diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 5234325d7edc..0a1dd479af0d 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -662,7 +662,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
                 // [AquaSalTimer::pRunningTimer fire];
                 if (ImplGetSVData()->mpSalTimer != nullptr)
                 {
-                    bool idle = true; // TODO
+                    bool const idle = true; // TODO
                     ImplGetSVData()->mpSalTimer->CallCallback( idle );
                 }
             }
@@ -1002,8 +1002,7 @@ SalSession* AquaSalInstance::CreateSalSession()
 OUString AquaSalInstance::getOSVersion()
 {
     NSString * versionString = nullptr;
-    NSString * sysVersionDictionaryPath = @"/System/Library/CoreServices/SystemVersion.plist";
-    NSDictionary * sysVersionDict = [ NSDictionary dictionaryWithContentsOfFile: sysVersionDictionaryPath ];
+    NSDictionary * sysVersionDict = [ NSDictionary dictionaryWithContentsOfFile: @"/System/Library/CoreServices/SystemVersion.plist" ];
     if ( sysVersionDict )
         versionString = [ sysVersionDict valueForKey: @"ProductVersion" ];
 
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 7c91d058c292..b88aadb444e7 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -159,8 +159,6 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */  ControlPart nPart,
 
 bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nPart )
 {
-    bool bOk = false;
-
     // Native controls are now defaults
     // If you want to disable experimental native controls code,
     // just set the environment variable SAL_NO_NWF to something
@@ -282,7 +280,7 @@ bool AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n
         default: break;
     }
 
-    return bOk;
+    return false;
 }
 
 bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion,
diff --git a/vcl/osx/salnstimer.mm b/vcl/osx/salnstimer.mm
index 307f1944079b..88e660211401 100644
--- a/vcl/osx/salnstimer.mm
+++ b/vcl/osx/salnstimer.mm
@@ -35,7 +35,7 @@
         ImplSVData* pSVData = ImplGetSVData();
         if( pSVData->mpSalTimer )
         {
-            bool idle = true; // TODO
+            bool const idle = true; // TODO
             pSVData->mpSalTimer->CallCallback( idle );
 
             // NSTimer does not end nextEventMatchingMask of NSApplication
diff --git a/vcl/osx/saltimer.cxx b/vcl/osx/saltimer.cxx
index 2a3158102517..b28a6598cec6 100644
--- a/vcl/osx/saltimer.cxx
+++ b/vcl/osx/saltimer.cxx
@@ -103,7 +103,7 @@ void AquaSalTimer::handleStartTimerEvent( NSEvent* pEvent )
             if( pSVData->mpSalTimer )
             {
                 // timer already elapsed since event posted
-                bool idle = true; // TODO
+                bool const idle = true; // TODO
                 pSVData->mpSalTimer->CallCallback( idle );
             }
         }
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 12bd3c0a03aa..a300b012b587 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -926,7 +926,7 @@ void Window::ReleaseGraphics( bool bRelease )
 
 static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
 {
-    sal_Int32 nResult = 100;
+    sal_Int32 nResult;
 
 #ifndef MACOSX
     // Setting of HiDPI is unfortunately all only a heuristic; and to add
@@ -942,6 +942,7 @@ static sal_Int32 CountDPIScaleFactor(sal_Int32 nDPI)
         nResult = 150;
 #else
     (void)nDPI;
+    nResult = 100;
 #endif
 
     return nResult;


More information about the Libreoffice-commits mailing list