From 161c3f179f71eda2a32dabaf68ff6fb3ba487062 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 14 Feb 2012 14:19:07 +0100 Subject: Some more comphelper/configurationhelper clean up --- desktop/source/app/app.cxx | 43 +++++-------------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) (limited to 'desktop/source') diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index c6cb535f6707..a3dabd43fc60 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -68,10 +68,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -1117,47 +1117,14 @@ void Desktop::HandleBootstrapErrors( BootstrapError aBootstrapError ) void Desktop::retrieveCrashReporterState() { - static const ::rtl::OUString CFG_PACKAGE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery/")); - static const ::rtl::OUString CFG_PATH_CRASHREPORTER(RTL_CONSTASCII_USTRINGPARAM("CrashReporter")); - static const ::rtl::OUString CFG_ENTRY_ENABLED(RTL_CONSTASCII_USTRINGPARAM("Enabled")); - - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); - - sal_Bool bEnabled(sal_False); - if ( xSMGR.is() ) - { - css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey( - xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_CRASHREPORTER, - CFG_ENTRY_ENABLED, - ::comphelper::ConfigurationHelper::E_READONLY); - aVal >>= bEnabled; - } - _bCrashReporterEnabled = bEnabled; + _bCrashReporterEnabled + = officecfg::Office::Recovery::CrashReporter::Enabled::get(); } sal_Bool Desktop::isUIOnSessionShutdownAllowed() { - static const ::rtl::OUString CFG_PACKAGE_RECOVERY(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery/")); - static const ::rtl::OUString CFG_PATH_SESSION(RTL_CONSTASCII_USTRINGPARAM("SessionShutdown")); - static const ::rtl::OUString CFG_ENTRY_UIENABLED(RTL_CONSTASCII_USTRINGPARAM("DocumentStoreUIEnabled")); - - css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory(); - - sal_Bool bResult = sal_False; - if ( xSMGR.is() ) - { - css::uno::Any aVal = ::comphelper::ConfigurationHelper::readDirectKey( - xSMGR, - CFG_PACKAGE_RECOVERY, - CFG_PATH_SESSION, - CFG_ENTRY_UIENABLED, - ::comphelper::ConfigurationHelper::E_READONLY); - aVal >>= bResult; - } - - return bResult; + return officecfg::Office::Recovery::SessionShutdown::DocumentStoreUIEnabled + ::get(); } //----------------------------------------------- -- cgit