diff options
author | Andras Timar <atimar@suse.com> | 2013-04-11 03:38:38 -0700 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-04-11 03:40:21 -0700 |
commit | c9d5cfa194e9e27e144e801ab179a708d77663b9 (patch) | |
tree | 0a82659f0539b0b67efc40f283be3e5597f1b39a /xmlhelp | |
parent | 0a29c5bedda700a86b46e3c3cd9c9e1ce1d4f278 (diff) |
detect and apply Windows' high contrast theme to local help
Change-Id: Ibd45773179be334991d0d493324cadaad772ea33
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 2428c66741d3..447d1e0f8615 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -66,6 +66,10 @@ #include "databases.hxx" #include "urlparameter.hxx" +#ifdef WNT +#include <windows.h> +#endif + using namespace chelp; using namespace com::sun::star; using namespace com::sun::star::uno; @@ -1146,7 +1150,30 @@ void Databases::cascadingStylesheet( const OUString& Language, { uno::Any aHCMode = xVclWindowPeer->getProperty( OUString( "HighContrastMode" ) ); if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode ) + { aCSS = OUString( "highcontrastblack" ); + #ifdef WNT + HKEY hKey = NULL; + LONG lResult = RegOpenKeyExA( HKEY_CURRENT_USER, "Control Panel\\Accessibility\\HighContrast", 0, KEY_QUERY_VALUE, &hKey ); + if ( ERROR_SUCCESS == lResult ) + { + CHAR szBuffer[1024]; + DWORD nSize = sizeof( szBuffer ); + lResult = RegQueryValueExA( hKey, "High Contrast Scheme", NULL, NULL, (LPBYTE)szBuffer, &nSize ); + if ( ERROR_SUCCESS == lResult && nSize > 0 ) + { + szBuffer[nSize] = '\0'; + if ( strncmp( szBuffer, "High Contrast #1", strlen("High Contrast #1") ) == 0 ) + aCSS = OUString( "highcontrast1" ); + if ( strncmp( szBuffer, "High Contrast #2", strlen("High Contrast #2") ) == 0 ) + aCSS = OUString( "highcontrast2" ); + if ( strncmp( szBuffer, "High Contrast White", strlen("High Contrast White") ) == 0 ) + aCSS = OUString( "highcontrastwhite" ); + } + RegCloseKey( hKey ); + } + #endif + } } } } |