diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-09 16:29:18 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-09 17:59:12 +0100 |
commit | 9a4f558d00448110abed4f705989b0112a309fd8 (patch) | |
tree | df605af200246907a0c6b99f9e0a67fc66eb1382 /framework/source/services | |
parent | coverity#705627: fix memory leak (diff) | |
download | core-9a4f558d00448110abed4f705989b0112a309fd8.tar.gz core-9a4f558d00448110abed4f705989b0112a309fd8.zip |
simplify code a bit
Change-Id: Id965dd79ab8401a2ba7eb8266bba642f80cbe0d3
Diffstat (limited to 'framework/source/services')
-rw-r--r-- | framework/source/services/license.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
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 <tools/datetime.hxx> #include <osl/time.h> +#include <boost/scoped_ptr.hpp> + 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<LicenseDialog> pDialog(new LicenseDialog(aLicensePath, pResMgr)); sal_Bool bAgreed = (pDialog->Execute() == 1); - delete pDialog; if (bAgreed) { |