diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-01-20 13:28:02 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-01-20 20:31:00 +0100 |
commit | 4398cc83945de8165e3713fdfa76499c2b3a55fa (patch) | |
tree | e5d65f226bf81ffb5e6423928ef321c0bb7878c5 /vcl/win | |
parent | 8825e95a44395b5c4675f077e99fe4d9fb47c62f (diff) |
vcl: remove dependency of SalShlData on GetVersionEx()
4500afcc1be7774b3c35ab69a20e36165ca5445a was incomplete in that the
result of GetVersionEx() is actually stored and other functions do
manual checks on it.
Change-Id: I1f66a13e98e6bfc40bc35fa5382c2f6257f905d6
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/source/app/salinst.cxx | 24 | ||||
-rw-r--r-- | vcl/win/source/gdi/salnativewidgets-luna.cxx | 2 | ||||
-rw-r--r-- | vcl/win/source/window/salframe.cxx | 2 |
3 files changed, 17 insertions, 11 deletions
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx index 396b2544588c..fe24ffaa325a 100644 --- a/vcl/win/source/app/salinst.cxx +++ b/vcl/win/source/app/salinst.cxx @@ -448,24 +448,30 @@ SalInstance* CreateSalInstance() // determine the windows version aSalShlData.mbWXP = 0; + aSalShlData.mbWVista = 0; aSalShlData.mbW7 = 0; - memset( &aSalShlData.maVersionInfo, 0, sizeof(aSalShlData.maVersionInfo) ); - aSalShlData.maVersionInfo.dwOSVersionInfoSize = sizeof( aSalShlData.maVersionInfo ); // the Win32 SDK 8.1 deprecates GetVersionEx() #ifdef _WIN32_WINNT_WINBLUE aSalShlData.mbWXP = IsWindowsXPOrGreater() ? 1 : 0; + aSalShlData.mbWVista = IsWindowsVistaOrGreater() ? 1 : 0; aSalShlData.mbW7 = IsWindows7OrGreater() ? 1 : 0; #else - if ( GetVersionEx( &aSalShlData.maVersionInfo ) ) + OSVERSIONINFO aVersionInfo; + memset( &aVersionInfo, 0, sizeof(aVersionInfo) ); + aVersionInfo.dwOSVersionInfoSize = sizeof( aVersionInfo ); + if (GetVersionEx( &aVersionInfo )) { // Windows XP ? - if ( aSalShlData.maVersionInfo.dwMajorVersion > 5 || - ( aSalShlData.maVersionInfo.dwMajorVersion == 5 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) ) + if (aVersionInfo.dwMajorVersion > 5 || + (aVersionInfo.dwMajorVersion == 5 && aVersionInfo.dwMinorVersion >= 1)) aSalShlData.mbWXP = 1; - // Windows 7 ? - if ( aSalShlData.maVersionInfo.dwMajorVersion > 6 || - ( aSalShlData.maVersionInfo.dwMajorVersion == 6 && aSalShlData.maVersionInfo.dwMinorVersion >= 1 ) ) - aSalShlData.mbW7 = 1; + // Windows Vista ? + if (aVersionInfo.dwMajorVersion >= 6) + aSalShlData.mbWVista = 1; + // Windows 7 ? + if (aVersionInfo.dwMajorVersion > 6 || + (aVersionInfo.dwMajorVersion == 6 && aVersionInfo.dwMinorVersion >= 1)) + aSalShlData.mbW7 = 1; } #endif diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index a8d21ff6f1fb..179bc4e7b4c2 100644 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -1538,7 +1538,7 @@ void WinSalGraphics::updateSettingsNative( AllSettings& rSettings ) // in Aero theme (and similar ?) the menu text color does not change // for selected items; also on WinXP and earlier menus are not themed // FIXME get the color directly from the theme, not from the settings - if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 ) + if (aSalShlData.mbWVista) { Color aMenuBarTextColor = aStyleSettings.GetPersonaMenuBarTextColor().get_value_or( aStyleSettings.GetMenuTextColor() ); // in aero menuitem highlight text is drawn in the same color as normal diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index eb8f548f97ac..13c273a4af47 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -699,7 +699,7 @@ static UINT ImplSalGetWheelScrollChars() { // Depending on Windows version, use proper default or 1 (when // driver emulates hscroll) - if( aSalShlData.maVersionInfo.dwMajorVersion < 6 ) + if (!aSalShlData.mbWVista) { // Windows 2000 & WinXP : emulating driver, use step size // of 1 |