diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-17 10:52:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-24 16:49:49 +0200 |
commit | 33a0f8ce656c8c5bb9c3c3deaa10c182e262b374 (patch) | |
tree | abd469ffb224c8d7b2de1cf76e3aada03e035fc1 /xmlhelp | |
parent | f252b332dd2652abb02851ba0c2521c045787801 (diff) |
fdo#46808, Adapt awt::Toolkit UNO service to new style
Create a merged XToolkit2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.
Also mark sub-interfaces as non-optional.
Change-Id: I278d0288e92be277033013302267cf93f7d70480
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 342923d341f9..1d3ca708d61d 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -33,6 +33,7 @@ #include <rtl/uri.hxx> #include <osl/file.hxx> #include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/awt/Toolkit.hpp> #include <rtl/ustrbuf.hxx> #include "inputstream.hxx" #include <algorithm> @@ -1208,24 +1209,17 @@ void Databases::cascadingStylesheet( const rtl::OUString& Language, 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( "com.sun.star.awt.Toolkit" ) ), uno::UNO_QUERY ); - if ( xToolkit.is() ) + uno::Reference< awt::XToolkit2 > xToolkit = + awt::Toolkit::create( ::comphelper::getProcessComponentContext() ); + uno::Reference< awt::XTopWindow > xTopWindow = xToolkit->getActiveTopWindow(); + if ( xTopWindow.is() ) { - uno::Reference< awt::XExtendedToolkit > xExtToolkit( xToolkit, uno::UNO_QUERY ); - if ( xExtToolkit.is() ) + uno::Reference< awt::XVclWindowPeer > xVclWindowPeer( xTopWindow, uno::UNO_QUERY ); + if ( xVclWindowPeer.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( "HighContrastMode" ) ); - if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode ) - aCSS = rtl::OUString( "highcontrastblack" ); - } - } + uno::Any aHCMode = xVclWindowPeer->getProperty( rtl::OUString( "HighContrastMode" ) ); + if ( ( aHCMode >>= bHighContrastMode ) && bHighContrastMode ) + aCSS = rtl::OUString( "highcontrastblack" ); } } } |