diff options
author | David Tardon <dtardon@redhat.com> | 2011-12-19 14:44:10 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-12-22 13:24:47 +0100 |
commit | b80d9acb3e0c3caf7d760b9ee3f5cfaf07bb32cd (patch) | |
tree | 481534da9555f1f6b7a60089c3ca9fda02ce9c5c | |
parent | ee1eb926550028da6e5e44089d4706798f94e0bb (diff) |
use officecfg/Office/Common.hxx directly
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 8 | ||||
-rw-r--r-- | vcl/generic/app/gensys.cxx | 63 | ||||
-rw-r--r-- | vcl/inc/generic/gensys.h | 1 | ||||
-rw-r--r-- | vcl/inc/vcl/print.hxx | 2 | ||||
-rw-r--r-- | vcl/prj/build.lst | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 67 | ||||
-rw-r--r-- | vcl/unx/generic/plugadapt/salplug.cxx | 5 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salprn-gtk.cxx | 6 |
8 files changed, 16 insertions, 138 deletions
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index 69e02c226581..0b659f8c33f8 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -29,6 +29,10 @@ #include <boost/bind.hpp> +#include "comphelper/processfactory.hxx" + +#include "officecfg/Office/Common.hxx" + #include "vcl/print.hxx" #include <sal/macros.h> @@ -321,7 +325,7 @@ sal_uLong AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup*, sal_uInt16 i case PRINTER_CAPABILITIES_SETPAPER: return 1; case PRINTER_CAPABILITIES_EXTERNALDIALOG: - return useSystemPrintDialog() ? 1 : 0; + return officecfg::Office::Common::Misc::UseSystemPrintDialog::get(comphelper::getProcessComponentContext()) ? 1 : 0; case PRINTER_CAPABILITIES_PDF: return 1; case PRINTER_CAPABILITIES_USEPULLMODEL: @@ -516,7 +520,7 @@ sal_Bool AquaSalInfoPrinter::StartJob( const rtl::OUString* i_pFileName, if( pPrintOperation ) { NSObject* pReleaseAfterUse = nil; - bool bShowPanel = (! i_rController.isDirectPrint() && useSystemPrintDialog() && i_rController.isShowDialogs() ); + bool bShowPanel = (! i_rController.isDirectPrint() && officecfg::Office::Common::Misc::UseSystemPrintDialog::get(comphelper::getProcessComponentContext()) && i_rController.isShowDialogs() ); [pPrintOperation setShowsPrintPanel: bShowPanel ? YES : NO ]; [pPrintOperation setShowsProgressPanel: bShowProgressPanel ? YES : NO]; diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx index f7d3f0a8b43a..ddde4a152fa6 100644 --- a/vcl/generic/app/gensys.cxx +++ b/vcl/generic/app/gensys.cxx @@ -181,67 +181,4 @@ rtl::OString SalGenericSystem::getFrameResName( SalExtStyle nStyle ) return aBuf.makeStringAndClear(); } -bool -SalGenericSystem::enableExperimentalFeatures() -{ - bool bEnable = true; - try - { - // get service provider - uno::Reference<lang::XMultiServiceFactory> const xSMgr(vcl::unohelper::GetMultiServiceFactory()); - // create configuration hierachical access name - if (xSMgr.is()) - { - try - { - uno::Reference<lang::XMultiServiceFactory> const xConfigProvider( - uno::Reference<lang::XMultiServiceFactory>( - xSMgr->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationProvider"))), - uno::UNO_QUERY)) - ; - if (xConfigProvider.is()) - { - uno::Sequence<uno::Any> aArgs(1); - beans::PropertyValue aVal; - aVal.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath")); - aVal.Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/Misc")); - aArgs.getArray()[0] <<= aVal; - uno::Reference<container::XNameAccess> const xConfigAccess( - uno::Reference<container::XNameAccess>( - xConfigProvider->createInstanceWithArguments( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")), - aArgs), - uno::UNO_QUERY)) - ; - if (xConfigAccess.is()) - { - try - { - sal_Bool bValue = sal_False; - uno::Any const aAny(xConfigAccess->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExperimentalMode")))); - if (aAny >>= bValue) - bEnable = bValue; - } - catch (container::NoSuchElementException const&) - { - } - catch (lang::WrappedTargetException const&) - { - } - } - } - } - catch (uno::Exception const&) - { - } - } - } - catch (lang::WrappedTargetException const&) - { - } - - return bEnable; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/generic/gensys.h b/vcl/inc/generic/gensys.h index fd21110a4f97..e485cc50f215 100644 --- a/vcl/inc/generic/gensys.h +++ b/vcl/inc/generic/gensys.h @@ -57,7 +57,6 @@ class VCL_DLLPUBLIC SalGenericSystem : public SalSystem static const char *getFrameResName(); static const char *getFrameClassName(); static rtl::OString getFrameResName( SalExtStyle nStyle ); - static bool enableExperimentalFeatures(); }; #endif // _SV_GENSYS_H diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx index edb47abf55d6..302670cce840 100644 --- a/vcl/inc/vcl/print.hxx +++ b/vcl/inc/vcl/print.hxx @@ -677,8 +677,6 @@ class VCL_DLLPUBLIC PrinterOptionsHelper ); }; -VCL_DLLPUBLIC bool useSystemPrintDialog(); - } diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index 8723f9a411e4..ec23ede3e4da 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo FREETYPE:freetype FONTCONFIG:fontconfig NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost officecfg DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo FREETYPE:freetype FONTCONFIG:fontconfig NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index cd1cb51c0229..d85321bea28b 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1916,71 +1916,4 @@ Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle, ); } -namespace vcl -{ - -bool useSystemPrintDialog() -{ - bool bNative = true; - try - { - // get service provider - uno::Reference< lang::XMultiServiceFactory > xSMgr( unohelper::GetMultiServiceFactory() ); - // create configuration hierachical access name - if( xSMgr.is() ) - { - try - { - uno::Reference< lang::XMultiServiceFactory > xConfigProvider( - uno::Reference< lang::XMultiServiceFactory >( - xSMgr->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationProvider" ))), - UNO_QUERY ) - ); - if( xConfigProvider.is() ) - { - uno::Sequence< uno::Any > aArgs(1); - beans::PropertyValue aVal; - aVal.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) ); - aVal.Value <<= rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.Common/Misc" ) ); - aArgs.getArray()[0] <<= aVal; - uno::Reference< container::XNameAccess > xConfigAccess( - uno::Reference< container::XNameAccess >( - xConfigProvider->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.configuration.ConfigurationAccess" )), - aArgs ), - UNO_QUERY ) - ); - if( xConfigAccess.is() ) - { - try - { - sal_Bool bValue = sal_False; - uno::Any aAny = xConfigAccess->getByName( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseSystemPrintDialog" ) ) ); - if( aAny >>= bValue ) - bNative = bValue; - } - catch( const container::NoSuchElementException& ) - { - } - catch( const lang::WrappedTargetException& ) - { - } - } - } - } - catch( const uno::Exception& ) - { - } - } - } - catch( const lang::WrappedTargetException& ) - { - } - - return bNative; -} - -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index 8b4488d4f10c..44499142fbe7 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -26,6 +26,9 @@ * ************************************************************************/ +#include "comphelper/processfactory.hxx" + +#include "officecfg/Office/Common.hxx" #include "osl/module.h" #include "osl/process.h" @@ -55,7 +58,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase ) #ifndef ANDROID // Disable gtk3 plugin load except in experimental mode for now. if( rModuleBase.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "gtk3" ) ) && - !SalGenericSystem::enableExperimentalFeatures() ) + !officecfg::Office::Common::Misc::ExperimentalMode::get( comphelper::getProcessComponentContext() ) ) return NULL; #endif OUStringBuffer aModName( 128 ); diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx index fb25aeca8e65..6f7df7b9cf56 100644 --- a/vcl/unx/gtk/gdi/salprn-gtk.cxx +++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx @@ -58,6 +58,8 @@ #include <com/sun/star/view/PrintableState.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> +#include <officecfg/Office/Common.hxx> + #include <rtl/oustringostreaminserter.hxx> #include <unotools/streamwrap.hxx> @@ -181,7 +183,9 @@ lcl_getGtkSalInstance() bool lcl_useSystemPrintDialog() { - return vcl::useSystemPrintDialog() && SalGenericSystem::enableExperimentalFeatures() + uno::Reference<uno::XComponentContext> const xCtxt(comphelper::getProcessComponentContext()); + return officecfg::Office::Common::Misc::UseSystemPrintDialog::get(xCtxt) + && officecfg::Office::Common::Misc::ExperimentalMode::get(xCtxt) && lcl_getGtkSalInstance().getPrintWrapper()->supportsPrinting(); } |