From 9a4f558d00448110abed4f705989b0112a309fd8 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Sat, 9 Mar 2013 16:29:18 +0100 Subject: simplify code a bit Change-Id: Id965dd79ab8401a2ba7eb8266bba642f80cbe0d3 --- framework/source/services/license.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'framework') diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx index 7ab35026445a..31057a98ef95 100644 --- a/framework/source/services/license.cxx +++ b/framework/source/services/license.cxx @@ -49,6 +49,8 @@ #include #include +#include + namespace framework{ using namespace utl; using namespace ::osl ; @@ -219,13 +221,10 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na return aRet; } // determine the filename of the license to show - ::rtl::OUString aLangString; - ::com::sun::star::lang::Locale aLocale; AllSettings aSettings(Application::GetSettings()); - aLocale = aSettings.GetUILanguageTag().getLocale(); - ResMgr* pResMgr = ResMgr::SearchCreateResMgr("fwe", aLocale); + ::com::sun::star::lang::Locale aLocale = aSettings.GetUILanguageTag().getLocale(); - aLangString = aLocale.Language; + OUString aLangString = aLocale.Language; if ( !aLocale.Country.isEmpty() ) { aLangString += ::rtl::OUString("-"); @@ -293,9 +292,9 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na } // prepare to show // display license dialog - LicenseDialog* pDialog = new LicenseDialog(aLicensePath, pResMgr); + ResMgr* pResMgr = ResMgr::SearchCreateResMgr("fwe", aLocale); + boost::scoped_ptr pDialog(new LicenseDialog(aLicensePath, pResMgr)); sal_Bool bAgreed = (pDialog->Execute() == 1); - delete pDialog; if (bAgreed) { -- cgit