summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Schäfer <ssa@openoffice.org>2002-12-04 16:34:39 +0000
committerStephan Schäfer <ssa@openoffice.org>2002-12-04 16:34:39 +0000
commitc6d4d10cd9acf159d2713d58df5eb83271a6198f (patch)
treefa4a945965a16eb5908bfee0b270b3526680175a /vcl
parent86ef28137a9ebbdf9c18c359c9fe0bf366e6dd91 (diff)
#104427# auto detect hc mode
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/window.cxx29
1 files changed, 27 insertions, 2 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 9ec26e2d63b1..7d6272678a6a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: window.cxx,v $
*
- * $Revision: 1.158 $
+ * $Revision: 1.159 $
*
- * last change: $Author: oj $ $Date: 2002-12-02 08:53:25 $
+ * last change: $Author: ssa $ $Date: 2002-12-04 17:34:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -209,6 +209,9 @@
#include <dndlcon.hxx>
#include <dndevdis.hxx>
+#ifndef _UNOTOOLS_CONFIGNODE_HXX_
+#include <unotools/confignode.hxx>
+#endif
#pragma hdrstop
@@ -440,6 +443,28 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl )
}
+ // #104427# auto detect HC mode ?
+ if( !rSettings.GetStyleSettings().GetHighContrastMode() )
+ {
+ sal_Bool bTmp, bAutoHCMode = sal_True;
+ utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::createWithServiceFactory(
+ vcl::unohelper::GetMultiServiceFactory(),
+ OUString::createFromAscii( "org.openoffice.Office.Common/Accessibility" ) ); // note: case sensisitive !
+ ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString::createFromAscii( "AutoDetectSystemHC" ) );
+ if( aValue >>= bTmp )
+ bAutoHCMode = bTmp;
+ if( bAutoHCMode )
+ {
+ if( rSettings.GetStyleSettings().GetFaceColor().GetLuminance() < 8 )
+ {
+ StyleSettings aStyleSettings = rSettings.GetStyleSettings();
+ aStyleSettings.SetHighContrastMode( TRUE );
+ rSettings.SetStyleSettings( aStyleSettings );
+ }
+ }
+ }
+
+
#ifdef DBG_UTIL
// Evt. AppFont auf Fett schalten, damit man feststellen kann,