summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorVladimir Glazunov <vg@openoffice.org>2010-03-24 14:12:03 +0100
committerVladimir Glazunov <vg@openoffice.org>2010-03-24 14:12:03 +0100
commita5218b51c7c28a50a27f061c90259c794327a2d3 (patch)
treee5ea3930ed7050e184e9347543708101a5cfbdf5 /xmlhelp
parented9194cab7479142815f6428300520eab320c22d (diff)
parentde804c3eaeb7930c787e2604909ae81ba8190cd9 (diff)
CWS-TOOLING: integrate CWS mtaccfixes
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx45
1 files changed, 43 insertions, 2 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 6ce5ef8fdb..6693d69d5d 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -57,6 +57,12 @@
#include <com/sun/star/script/XInvocation.hpp>
#include <comphelper/locale.hxx>
+#include <com/sun/star/awt/XToolkit.hpp>
+#include <com/sun/star/awt/XExtendedToolkit.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/XTopWindow.hpp>
+
#include <l10ntools/compilehelp.hxx>
#include <comphelper/storagehelper.hxx>
@@ -1270,20 +1276,48 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language,
int retry = 2;
bool error = true;
rtl::OUString fileURL;
+
+ sal_Bool bHighContrastMode = sal_False;
+ rtl::OUString aCSS( m_aCSS );
+ if ( aCSS.compareToAscii( "default" ) == 0 )
+ {
+ // #i50760: "default" needs to adapt HC mode
+ uno::Reference< awt::XToolkit > xToolkit = uno::Reference< awt::XToolkit >(
+ ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ), uno::UNO_QUERY );
+ if ( xToolkit.is() )
+ {
+ uno::Reference< awt::XExtendedToolkit > xExtToolkit( xToolkit, uno::UNO_QUERY );
+ if ( xExtToolkit.is() )
+ {
+ uno::Reference< awt::XTopWindow > xTopWindow = xExtToolkit->getActiveTopWindow();
+ if ( xTopWindow.is() )
+ {
+ uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY );
+ if ( xVclWindowPeer.is() )
+ {
+ uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString::createFromAscii( "HighContrastMode" ) );
+ if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode )
+ aCSS = rtl::OUString::createFromAscii( "highcontrastblack" );
+ }
+ }
+ }
+ }
+ }
while( error && retry )
{
+
if( retry == 2 )
fileURL =
getInstallPathAsURL() +
processLang( Language ) +
rtl::OUString::createFromAscii( "/" ) +
- m_aCSS +
+ aCSS +
rtl::OUString::createFromAscii( ".css" );
else if( retry == 1 )
fileURL =
getInstallPathAsURL() +
- m_aCSS +
+ aCSS +
rtl::OUString::createFromAscii( ".css" );
osl::DirectoryItem aDirItem;
@@ -1304,6 +1338,13 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language,
}
--retry;
+ if ( !retry && error && bHighContrastMode )
+ {
+ // fall back to default css
+ aCSS = rtl::OUString::createFromAscii( "default" );
+ retry = 2;
+ bHighContrastMode = sal_False;
+ }
}
if( error )