From b1d829e52e826b6ea4ae884a64fdb68b66c74dd7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 31 Jul 2017 17:16:27 +0100 Subject: move resmgr to unotools and the vast majority of translations is to the ui language so default ctor with that arg and now drop OModuleResourceClient Change-Id: I3b85a560ffdfe5f019c2271ac56a5fe4a361522b --- accessibility/inc/pch/precompiled_acc.hxx | 2 +- accessibility/source/helper/accresmgr.cxx | 7 +- avmedia/source/framework/mediamisc.cxx | 7 +- avmedia/source/inc/mediamisc.hxx | 2 +- basctl/inc/pch/precompiled_basctl.hxx | 2 +- basctl/source/basicide/iderdll.cxx | 4 +- basic/source/runtime/basrdll.cxx | 4 +- basic/source/sbx/sbxscan.cxx | 4 +- chart2/inc/pch/precompiled_chartcontroller.hxx | 2 +- chart2/source/tools/ResId.cxx | 2 +- chart2/source/tools/ResourceManager.cxx | 6 +- .../clang/unusedenumconstants.writeonly.results | 8 -- connectivity/source/commontools/sqlerror.cxx | 6 +- connectivity/source/resource/sharedresources.cxx | 6 +- cppcanvas/inc/pch/precompiled_cppcanvas.hxx | 2 +- cui/inc/pch/precompiled_cui.hxx | 2 +- cui/source/factory/cuiresmgr.cxx | 16 +-- dbaccess/inc/pch/precompiled_dba.hxx | 2 +- dbaccess/inc/pch/precompiled_dbmm.hxx | 2 +- dbaccess/source/core/resource/core_resource.cxx | 6 +- desktop/inc/app.hxx | 2 +- desktop/inc/dp_shared.hxx | 6 +- desktop/inc/pch/precompiled_sofficeapp.hxx | 2 +- desktop/source/deployment/gui/dp_gui_dialog2.cxx | 2 +- desktop/source/deployment/misc/dp_resource.cxx | 2 +- desktop/source/lib/init.cxx | 2 +- desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 2 +- desktop/source/pkgchk/unopkg/unopkg_shared.h | 2 +- editeng/inc/pch/precompiled_editeng.hxx | 2 +- editeng/source/editeng/eerdll.cxx | 5 +- embeddedobj/source/general/docholder.cxx | 4 +- extensions/CppunitTest_extensions_test_update.mk | 2 +- extensions/Library_updatecheckui.mk | 1 + extensions/Library_updchk.mk | 2 +- extensions/source/abpilot/unodialogabp.hxx | 7 +- extensions/source/bibliography/bibmod.cxx | 4 +- extensions/source/dbpilots/unoautopilot.hxx | 1 - extensions/source/inc/componentmodule.cxx | 75 +--------- extensions/source/inc/componentmodule.hxx | 37 +---- extensions/source/propctrlr/modulepcr.cxx | 6 +- extensions/source/propctrlr/modulepcr.hxx | 6 +- extensions/source/scanner/sanedlg.cxx | 4 +- extensions/source/update/check/updatehdl.cxx | 4 +- extensions/source/update/ui/updatecheckui.cxx | 4 +- filter/source/graphicfilter/eps/eps.cxx | 4 +- filter/source/pdf/impdialog.cxx | 4 +- filter/source/pdf/pdfexport.cxx | 4 +- filter/source/t602/t602filter.cxx | 2 +- .../source/xsltdialog/xmlfiltersettingsdialog.cxx | 4 +- filter/source/xsltdialog/xmlfiltertabdialog.cxx | 2 +- forms/source/resource/frm_resource.cxx | 7 +- formula/source/core/api/FormulaCompiler.cxx | 2 +- formula/source/core/resource/core_resource.cxx | 6 +- formula/source/ui/inc/ModuleHelper.hxx | 2 +- formula/source/ui/resource/ModuleHelper.cxx | 2 +- fpicker/inc/fpsofficeResMgr.hxx | 4 +- fpicker/source/aqua/resourceprovider.mm | 2 +- fpicker/source/office/iodlgimp.cxx | 4 +- fpicker/source/win32/misc/resourceprovider.cxx | 2 +- framework/inc/pch/precompiled_fwe.hxx | 2 +- framework/inc/pch/precompiled_fwi.hxx | 2 +- framework/inc/pch/precompiled_fwk.hxx | 2 +- framework/inc/pch/precompiled_fwl.hxx | 2 +- framework/source/fwe/classes/fwkresid.cxx | 24 +--- framework/source/uiconfiguration/ImageList.cxx | 1 - include/tools/resmgr.hxx | 38 ----- include/unotools/componentresmodule.hxx | 57 -------- include/unotools/resmgr.hxx | 39 +++++ include/vcl/builder.hxx | 2 +- ios/CustomTarget_Lo_Xcconfig.mk | 2 +- reportdesign/inc/pch/precompiled_rpt.hxx | 2 +- reportdesign/inc/pch/precompiled_rptui.hxx | 2 +- .../source/core/resource/core_resource.cxx | 7 +- reportdesign/source/core/sdr/RptModel.cxx | 2 +- sc/inc/pch/precompiled_sc.hxx | 2 +- sc/source/core/data/funcdesc.cxx | 2 +- sc/source/ui/app/scdll.cxx | 2 +- sc/source/ui/app/scmod.cxx | 4 +- scaddins/Library_analysis.mk | 2 +- scaddins/Library_date.mk | 2 +- scaddins/Library_pricing.mk | 2 +- scaddins/source/analysis/analysis.cxx | 2 +- scaddins/source/datefunc/datefunc.cxx | 2 +- scaddins/source/pricing/pricing.cxx | 2 +- sccomp/Library_solver.mk | 3 +- sccomp/source/solver/SolverComponent.cxx | 4 +- sd/inc/pch/precompiled_sd.hxx | 2 +- sd/inc/pch/precompiled_sdui.hxx | 2 +- sd/source/filter/html/htmlex.cxx | 2 +- sd/source/ui/app/sdmod.cxx | 4 +- sfx2/inc/pch/precompiled_sfx.hxx | 2 +- sfx2/source/appl/appinit.cxx | 6 +- sfx2/source/bastyp/frmhtmlw.cxx | 2 +- sfx2/source/bastyp/sfxresid.cxx | 7 +- sfx2/source/dialog/styfitem.cxx | 2 +- slideshow/inc/pch/precompiled_slideshow.hxx | 2 +- starmath/source/smmod.cxx | 4 +- svl/source/misc/getstringresource.cxx | 7 +- svtools/inc/pch/precompiled_svt.hxx | 2 +- svtools/source/graphic/provider.cxx | 2 +- svtools/source/misc/ehdl.cxx | 8 +- svtools/source/misc/svtresid.cxx | 7 +- svx/inc/pch/precompiled_svx.hxx | 2 +- svx/inc/pch/precompiled_svxcore.hxx | 2 +- svx/source/dialog/dialmgr.cxx | 6 +- svx/source/form/datanavi.cxx | 4 +- svx/source/gallery2/galmisc.cxx | 2 +- svx/source/gallery2/galobj.cxx | 2 +- sw/inc/pch/precompiled_msword.hxx | 2 +- sw/inc/pch/precompiled_sw.hxx | 2 +- sw/inc/pch/precompiled_swui.hxx | 2 +- sw/inc/pch/precompiled_vbaswobj.hxx | 2 +- sw/source/uibase/app/swmodule.cxx | 4 +- test/source/bootstrapfixture.cxx | 2 +- test/source/setupvcl.cxx | 2 +- tools/Library_tl.mk | 2 - tools/source/rc/resmgr.cxx | 158 --------------------- unotools/Library_utl.mk | 7 +- unotools/source/i18n/resmgr.cxx | 158 +++++++++++++++++++++ unotools/source/misc/componentresmodule.cxx | 87 ------------ uui/source/alreadyopen.cxx | 2 +- uui/source/filechanged.cxx | 2 +- uui/source/iahndl-authentication.cxx | 8 +- uui/source/iahndl-errorhandler.cxx | 4 +- uui/source/iahndl-locking.cxx | 8 +- uui/source/iahndl-ssl.cxx | 6 +- uui/source/iahndl.cxx | 8 +- uui/source/lockcorrupt.cxx | 2 +- uui/source/lockfailed.cxx | 2 +- uui/source/masterpasscrtdlg.cxx | 2 +- uui/source/masterpassworddlg.cxx | 2 +- uui/source/nameclashdlg.cxx | 2 +- uui/source/openlocked.cxx | 2 +- uui/source/passworddlg.cxx | 2 +- uui/source/trylater.cxx | 2 +- vbahelper/inc/pch/precompiled_msforms.hxx | 2 +- vcl/source/app/svdata.cxx | 4 +- vcl/source/app/svmain.cxx | 2 +- vcl/source/bitmap/BitmapTools.cxx | 2 +- vcl/source/filter/graphicfilter.cxx | 2 +- vcl/source/gdi/bitmapex.cxx | 2 +- vcl/source/image/Image.cxx | 2 +- vcl/source/window/builder.cxx | 4 +- vcl/unx/gtk/fpicker/resourceprovider.cxx | 2 +- writerfilter/source/dmapper/GraphicHelpers.cxx | 2 +- writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 2 +- writerfilter/source/rtftok/rtftokenizer.cxx | 2 +- writerperfect/inc/WPFTResMgr.hxx | 2 +- writerperfect/source/common/WPFTResMgr.cxx | 5 +- xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx | 2 +- xmlsecurity/inc/resourcemanager.hxx | 2 +- xmlsecurity/source/dialogs/resourcemanager.cxx | 2 +- 152 files changed, 413 insertions(+), 729 deletions(-) delete mode 100644 include/tools/resmgr.hxx delete mode 100644 include/unotools/componentresmodule.hxx create mode 100644 include/unotools/resmgr.hxx delete mode 100644 tools/source/rc/resmgr.cxx create mode 100644 unotools/source/i18n/resmgr.cxx delete mode 100644 unotools/source/misc/componentresmodule.cxx diff --git a/accessibility/inc/pch/precompiled_acc.hxx b/accessibility/inc/pch/precompiled_acc.hxx index 7377c61a4f1b..fcc0c6297ac3 100644 --- a/accessibility/inc/pch/precompiled_acc.hxx +++ b/accessibility/inc/pch/precompiled_acc.hxx @@ -316,7 +316,6 @@ #include #include #include -#include #include #include #include @@ -331,6 +330,7 @@ #include #include #include +#include #include #include #include diff --git a/accessibility/source/helper/accresmgr.cxx b/accessibility/source/helper/accresmgr.cxx index a7d57156df95..7ffcafb3080f 100644 --- a/accessibility/source/helper/accresmgr.cxx +++ b/accessibility/source/helper/accresmgr.cxx @@ -18,10 +18,7 @@ */ #include - -#include -#include -#include +#include using namespace accessibility; @@ -39,7 +36,7 @@ void TkResMgr::ensureImplExists() if (m_pImpl) return; - m_pImpl = new std::locale(Translate::Create("acc", Application::GetSettings().GetUILanguageTag())); + m_pImpl = new std::locale(Translate::Create("acc")); if (m_pImpl) { diff --git a/avmedia/source/framework/mediamisc.cxx b/avmedia/source/framework/mediamisc.cxx index 50dd7687a0c0..a8d627266596 100644 --- a/avmedia/source/framework/mediamisc.cxx +++ b/avmedia/source/framework/mediamisc.cxx @@ -17,17 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include -#include -#include - +#include #include namespace avmedia { const std::locale& GetResLocale() { - static std::locale loc = Translate::Create("avmedia", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("avmedia"); return loc; } diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx index 0a75833d3f92..cdb640aa1575 100644 --- a/avmedia/source/inc/mediamisc.hxx +++ b/avmedia/source/inc/mediamisc.hxx @@ -21,7 +21,7 @@ #define INCLUDED_AVMEDIA_SOURCE_INC_MEDIAMISC_HXX #include -#include +#include #define AVMEDIA_MANAGER_SERVICE_PREFERRED "com.sun.star.comp.avmedia.Manager_VLC" #ifdef _WIN32 diff --git a/basctl/inc/pch/precompiled_basctl.hxx b/basctl/inc/pch/precompiled_basctl.hxx index 69b2ecdd34c3..bdaaa6058bc6 100644 --- a/basctl/inc/pch/precompiled_basctl.hxx +++ b/basctl/inc/pch/precompiled_basctl.hxx @@ -543,7 +543,6 @@ #include #include #include -#include #include #include #include @@ -565,6 +564,7 @@ #include #include #include +#include #include #include diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx index 7a2b80ae4c78..2435b9b31901 100644 --- a/basctl/source/basicide/iderdll.cxx +++ b/basctl/source/basicide/iderdll.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include @@ -118,7 +118,7 @@ Dll::Dll () : { SfxObjectFactory& rFactory = DocShell::Factory(); - std::locale loc = Translate::Create("basctl", Application::GetSettings().GetUILanguageTag()); + std::locale loc = Translate::Create("basctl"); auto pModule = o3tl::make_unique(loc, &rFactory); SfxModule* pMod = pModule.get(); diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx index e7f228060293..da830b4e9e6c 100644 --- a/basic/source/runtime/basrdll.cxx +++ b/basic/source/runtime/basrdll.cxx @@ -26,7 +26,7 @@ #include #include -#include +#include #include "strings.hrc" #include @@ -41,7 +41,7 @@ struct BasicDLL::Impl Impl() : bDebugMode(false) , bBreakEnabled(true) - , aBasResLocale(Translate::Create("sb", Application::GetSettings().GetUILanguageTag())) + , aBasResLocale(Translate::Create("sb")) , xSbxAppData(new SbxAppData) { } }; diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 8be89826439b..a2cb4f871621 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "sbxconv.hxx" @@ -585,7 +585,7 @@ namespace const std::locale& implGetResLocale() { - static std::locale loc(Translate::Create("sb", Application::GetSettings().GetUILanguageTag())); + static std::locale loc(Translate::Create("sb")); return loc; } diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index f85aafda5899..df610d888408 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -496,7 +496,6 @@ #include #include #include -#include #include #include #include @@ -520,6 +519,7 @@ #include #include #include +#include #include #include #include diff --git a/chart2/source/tools/ResId.cxx b/chart2/source/tools/ResId.cxx index 68ea0df902f7..2a82b11aa48e 100644 --- a/chart2/source/tools/ResId.cxx +++ b/chart2/source/tools/ResId.cxx @@ -19,7 +19,7 @@ #include "ResId.hxx" #include "ResourceManager.hxx" -#include +#include namespace chart { diff --git a/chart2/source/tools/ResourceManager.cxx b/chart2/source/tools/ResourceManager.cxx index 3cd51d70c7a7..8449c6c44988 100644 --- a/chart2/source/tools/ResourceManager.cxx +++ b/chart2/source/tools/ResourceManager.cxx @@ -18,16 +18,14 @@ */ #include "ResourceManager.hxx" -#include -#include -#include +#include namespace chart { const std::locale& ResourceManager::getResourceLocale() { - static std::locale loc = Translate::Create("chart", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("chart"); return loc; } diff --git a/compilerplugins/clang/unusedenumconstants.writeonly.results b/compilerplugins/clang/unusedenumconstants.writeonly.results index bee95c83b768..5658a30b5efa 100644 --- a/compilerplugins/clang/unusedenumconstants.writeonly.results +++ b/compilerplugins/clang/unusedenumconstants.writeonly.results @@ -3326,14 +3326,6 @@ include/tools/poly.hxx:36 enum PolyOptimizeFlags NO_SAME include/tools/poly.hxx:37 enum PolyOptimizeFlags REDUCE -include/tools/resmgr.hxx:55 - enum RCFlags AUTORELEASE -include/tools/resmgr.hxx:56 - enum RCFlags NOTFOUND -include/tools/resmgr.hxx:57 - enum RCFlags FALLBACK_DOWN -include/tools/resmgr.hxx:58 - enum RCFlags FALLBACK_UP include/tools/stream.hxx:49 enum StreamMode NOCREATE include/tools/stream.hxx:51 diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx index 8efc72ceccfd..a2fcf1103683 100644 --- a/connectivity/source/commontools/sqlerror.cxx +++ b/connectivity/source/commontools/sqlerror.cxx @@ -26,9 +26,7 @@ #include #include -#include -#include -#include +#include #include #include @@ -269,7 +267,7 @@ namespace connectivity ::osl::MutexGuard aGuard( m_aMutex ); m_bAttemptedInit = true; - m_xResources.reset(new std::locale(Translate::Create("cnr", Application::GetSettings().GetUILanguageTag()))); + m_xResources.reset(new std::locale(Translate::Create("cnr"))); return m_xResources.get() != nullptr; } diff --git a/connectivity/source/resource/sharedresources.cxx b/connectivity/source/resource/sharedresources.cxx index 1767bfaec8a0..65090fd8d483 100644 --- a/connectivity/source/resource/sharedresources.cxx +++ b/connectivity/source/resource/sharedresources.cxx @@ -23,10 +23,8 @@ #include #include -#include +#include #include -#include -#include namespace connectivity { @@ -68,7 +66,7 @@ namespace connectivity oslInterlockedCount SharedResources_Impl::s_nClients( 0 ); SharedResources_Impl::SharedResources_Impl() - : m_aLocale(Translate::Create("cnr", Application::GetSettings().GetUILanguageTag())) + : m_aLocale(Translate::Create("cnr")) { } diff --git a/cppcanvas/inc/pch/precompiled_cppcanvas.hxx b/cppcanvas/inc/pch/precompiled_cppcanvas.hxx index 91a51cac250c..c0361cdf8da2 100644 --- a/cppcanvas/inc/pch/precompiled_cppcanvas.hxx +++ b/cppcanvas/inc/pch/precompiled_cppcanvas.hxx @@ -194,7 +194,6 @@ #include #include #include -#include #include #include #include @@ -209,6 +208,7 @@ #include #include #include +#include #include #include #include diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx index 9fb83399de3f..26dc928a4f77 100644 --- a/cui/inc/pch/precompiled_cui.hxx +++ b/cui/inc/pch/precompiled_cui.hxx @@ -457,7 +457,6 @@ #include #include #include -#include #include #include #include @@ -481,6 +480,7 @@ #include #include #include +#include #include /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/cuiresmgr.cxx b/cui/source/factory/cuiresmgr.cxx index c03d3dbbc476..7a3b82f25335 100644 --- a/cui/source/factory/cuiresmgr.cxx +++ b/cui/source/factory/cuiresmgr.cxx @@ -18,22 +18,12 @@ */ #include -#include -#include -#include - -namespace -{ - const std::locale& GetResLocale() - { - static std::locale loc(Translate::Create("cui", Application::GetSettings().GetUILanguageTag())); - return loc; - } -} +#include OUString CuiResId(const char *pKey) { - return Translate::get(pKey, GetResLocale()); + static std::locale loc(Translate::Create("cui")); + return Translate::get(pKey, loc); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/inc/pch/precompiled_dba.hxx b/dbaccess/inc/pch/precompiled_dba.hxx index 592f0f7acb1e..d74fe1b1d2cd 100644 --- a/dbaccess/inc/pch/precompiled_dba.hxx +++ b/dbaccess/inc/pch/precompiled_dba.hxx @@ -276,7 +276,6 @@ #include #include #include -#include #include #include #include @@ -292,6 +291,7 @@ #include #include #include +#include #include #include #include diff --git a/dbaccess/inc/pch/precompiled_dbmm.hxx b/dbaccess/inc/pch/precompiled_dbmm.hxx index 5280bb6c3ba2..dd65550f889e 100644 --- a/dbaccess/inc/pch/precompiled_dbmm.hxx +++ b/dbaccess/inc/pch/precompiled_dbmm.hxx @@ -202,7 +202,6 @@ #include #include #include -#include #include #include #include @@ -217,6 +216,7 @@ #include #include #include +#include #include #include diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx index ad52b1638f90..a82f56fec58d 100644 --- a/dbaccess/source/core/resource/core_resource.cxx +++ b/dbaccess/source/core/resource/core_resource.cxx @@ -19,11 +19,9 @@ #include "core_resource.hxx" -#include +#include // ---- needed as long as we have no contexts for components --- -#include -#include #include #include @@ -45,7 +43,7 @@ namespace dbaccess if (m_pImpl) return; - m_pImpl = new std::locale(Translate::Create("dba", Application::GetSettings().GetUILanguageTag())); + m_pImpl = new std::locale(Translate::Create("dba")); } OUString ResourceManager::loadString(const char* pResId) diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index f4af4bcecc9d..50e3a0fa3811 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/desktop/inc/dp_shared.hxx b/desktop/inc/dp_shared.hxx index 425cda8ea906..8c38545ed7fa 100644 --- a/desktop/inc/dp_shared.hxx +++ b/desktop/inc/dp_shared.hxx @@ -22,16 +22,14 @@ #include #include -#include -#include -#include +#include namespace dp { struct DeploymentLocale : public ::rtl::StaticWithInit { std::locale operator () () { - return Translate::Create("dkt", Application::GetSettings().GetUILanguageTag()); + return Translate::Create("dkt"); } }; diff --git a/desktop/inc/pch/precompiled_sofficeapp.hxx b/desktop/inc/pch/precompiled_sofficeapp.hxx index 95e6c6fa7892..efc3a6dcc909 100644 --- a/desktop/inc/pch/precompiled_sofficeapp.hxx +++ b/desktop/inc/pch/precompiled_sofficeapp.hxx @@ -246,7 +246,6 @@ #include #include #include -#include #include #include #include @@ -262,6 +261,7 @@ #include #include #include +#include #include #include diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index e80eb3c8ddcd..e85b7bbe3d95 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -95,7 +95,7 @@ struct StrAllFiles : public rtl::StaticWithInit< OUString, StrAllFiles > { const OUString operator () () { const SolarMutexGuard guard; - std::locale loc = Translate::Create("fps", Application::GetSettings().GetUILanguageTag()); + std::locale loc = Translate::Create("fps"); return Translate::get(STR_FILTERNAME_ALL, loc); } }; diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx index 2d37cd6685b5..9a70ab218083 100644 --- a/desktop/source/deployment/misc/dp_resource.cxx +++ b/desktop/source/deployment/misc/dp_resource.cxx @@ -22,7 +22,7 @@ #include "dp_resource.h" #include #include -#include +#include #include #include #include diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index d4e4d9c00b33..b76904e3885a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx index 923335bb3290..30f5573ad038 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx @@ -22,7 +22,7 @@ #include "dp_shared.hxx" #include "unopkg_shared.h" #include -#include +#include #include #include #include diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index 20ade0b5e4fd..7a3e51f41e8f 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx index a30afe4d008c..a881347ca551 100644 --- a/editeng/inc/pch/precompiled_editeng.hxx +++ b/editeng/inc/pch/precompiled_editeng.hxx @@ -273,7 +273,6 @@ #include #include #include -#include #include #include #include @@ -290,6 +289,7 @@ #include #include #include +#include #include #include #include diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index d23885ea1fec..ca66b2f55379 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -18,7 +18,7 @@ */ -#include +#include #include #include #include @@ -209,11 +209,10 @@ EditDLL::~EditDLL() std::locale& EditDLL::GetResLocale() { - static std::locale loc = Translate::Create("editeng", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("editeng"); return loc; } - editeng::SharedVclResources::SharedVclResources() : m_pVirDev(VclPtr::Create()) { diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx index b774ab6aa479..a43ae65dddac 100644 --- a/embeddedobj/source/general/docholder.cxx +++ b/embeddedobj/source/general/docholder.cxx @@ -66,7 +66,7 @@ #include #include #include -#include +#include #include #include @@ -971,7 +971,7 @@ bool DocumentHolder::LoadDocToFrame( bool bInPlace ) css::uno::Reference< css::frame::XTitle > xModelTitle( xDoc, css::uno::UNO_QUERY ); if( xModelTitle.is() ) { - std::locale aResLoc = Translate::Create("sfx", SvtSysLocale().GetUILanguageTag()); + std::locale aResLoc = Translate::Create("sfx"); OUString sEmbedded = Translate::get(STR_EMBEDDED_TITLE, aResLoc); xModelTitle->setTitle( m_pEmbedObj->getContainerName() + sEmbedded); m_aContainerName = m_pEmbedObj->getContainerName(); diff --git a/extensions/CppunitTest_extensions_test_update.mk b/extensions/CppunitTest_extensions_test_update.mk index 18d312a0d019..e2cdaf58c315 100644 --- a/extensions/CppunitTest_extensions_test_update.mk +++ b/extensions/CppunitTest_extensions_test_update.mk @@ -23,7 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,extensions_test_update, \ sal \ salhelper \ test \ - tl \ + utl \ unotest \ vcl \ )) diff --git a/extensions/Library_updatecheckui.mk b/extensions/Library_updatecheckui.mk index a98cf964645b..86c59b608389 100644 --- a/extensions/Library_updatecheckui.mk +++ b/extensions/Library_updatecheckui.mk @@ -23,6 +23,7 @@ $(eval $(call gb_Library_use_sdk_api,updatecheckui)) $(eval $(call gb_Library_use_libraries,updatecheckui,\ vcl \ tl \ + utl \ comphelper \ cppuhelper \ cppu \ diff --git a/extensions/Library_updchk.mk b/extensions/Library_updchk.mk index 27928d1c94e2..269a0d4dd36b 100644 --- a/extensions/Library_updchk.mk +++ b/extensions/Library_updchk.mk @@ -23,7 +23,7 @@ $(eval $(call gb_Library_use_libraries,updchk,\ cppu \ sal \ salhelper \ - tl \ + utl \ vcl \ )) diff --git a/extensions/source/abpilot/unodialogabp.hxx b/extensions/source/abpilot/unodialogabp.hxx index b5532179b3ff..a2ab837a0bb4 100644 --- a/extensions/source/abpilot/unodialogabp.hxx +++ b/extensions/source/abpilot/unodialogabp.hxx @@ -33,10 +33,9 @@ namespace abp typedef ::comphelper::OPropertyArrayUsageHelper< OABSPilotUno > OABSPilotUno_PBase; /// the UNO wrapper for the address book source pilot class OABSPilotUno - :public compmodule::OModuleResourceClient - ,public svt::OGenericUnoDialog - ,public OABSPilotUno_JBase - ,public OABSPilotUno_PBase + : public svt::OGenericUnoDialog + , public OABSPilotUno_JBase + , public OABSPilotUno_PBase { OUString m_sDataSourceName; diff --git a/extensions/source/bibliography/bibmod.cxx b/extensions/source/bibliography/bibmod.cxx index c40b83b2ac68..661a10f9f5e9 100644 --- a/extensions/source/bibliography/bibmod.cxx +++ b/extensions/source/bibliography/bibmod.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include @@ -70,7 +70,7 @@ OUString BibResId(const char* pId) BibConfig* BibModul::pBibConfig = nullptr; BibModul::BibModul() - : m_aResLocale(Translate::Create("pcr", Application::GetSettings().GetUILanguageTag())) + : m_aResLocale(Translate::Create("pcr")) { } diff --git a/extensions/source/dbpilots/unoautopilot.hxx b/extensions/source/dbpilots/unoautopilot.hxx index 5b148ffdcaa7..68180d2bb486 100644 --- a/extensions/source/dbpilots/unoautopilot.hxx +++ b/extensions/source/dbpilots/unoautopilot.hxx @@ -36,7 +36,6 @@ namespace dbp class OUnoAutoPilot :public OUnoAutoPilot_Base ,public ::comphelper::OPropertyArrayUsageHelper< OUnoAutoPilot< TYPE, SERVICEINFO > > - ,public compmodule::OModuleResourceClient { explicit OUnoAutoPilot(const css::uno::Reference< css::uno::XComponentContext >& _rxORB) : OUnoAutoPilot_Base(_rxORB) diff --git a/extensions/source/inc/componentmodule.cxx b/extensions/source/inc/componentmodule.cxx index 619c5472ab6d..40273cf879de 100644 --- a/extensions/source/inc/componentmodule.cxx +++ b/extensions/source/inc/componentmodule.cxx @@ -19,7 +19,7 @@ #include #include "componentmodule.hxx" -#include +#include #include #include #include @@ -27,89 +27,22 @@ #include #include -#define ENTER_MOD_METHOD() \ - ::osl::MutexGuard aGuard(s_aMutex); \ - ensureImpl() - - namespace compmodule { - - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::registry; using namespace ::comphelper; using namespace ::cppu; - // implementation for OModule. not threadsafe, has to be guarded by its owner - class OModuleImpl - { - std::locale m_aResLocale; - bool m_bInitialized; - - public: - /// ctor - OModuleImpl(); - - /// get the manager for the resources of the module - const std::locale& getResLocale(); - }; - - - OModuleImpl::OModuleImpl() - : m_bInitialized(false) - { - } - - const std::locale& OModuleImpl::getResLocale() + OUString ModuleRes(const char* pId) { - // note that this method is not threadsafe, which counts for the whole class ! - if (!m_bInitialized) - { - // create a manager with a fixed prefix - m_aResLocale = Translate::Create("pcr", Application::GetSettings().GetUILanguageTag()); - m_bInitialized = true; - } - return m_aResLocale; - } - - ::osl::Mutex OModule::s_aMutex; - sal_Int32 OModule::s_nClients = 0; - OModuleImpl* OModule::s_pImpl = nullptr; - - const std::locale& OModule::getResLocale() - { - ENTER_MOD_METHOD(); - return s_pImpl->getResLocale(); - } - - void OModule::registerClient() - { - ::osl::MutexGuard aGuard(s_aMutex); - ++s_nClients; - } - - void OModule::revokeClient() - { - ::osl::MutexGuard aGuard(s_aMutex); - if (!--s_nClients && s_pImpl) - { - delete s_pImpl; - s_pImpl = nullptr; - } - } - - void OModule::ensureImpl() - { - if (s_pImpl) - return; - s_pImpl = new OModuleImpl(); + static std::locale loc = Translate::Create("pcr"); + return Translate::get(pId, loc); } //- registration helper - std::vector< OUString >* OModule::s_pImplementationNames = nullptr; std::vector< Sequence< OUString > >* OModule::s_pSupportedServices = nullptr; std::vector< ComponentInstantiation >* OModule::s_pCreationFunctionPointers = nullptr; diff --git a/extensions/source/inc/componentmodule.hxx b/extensions/source/inc/componentmodule.hxx index 163b394f7f15..92bb52d1de5a 100644 --- a/extensions/source/inc/componentmodule.hxx +++ b/extensions/source/inc/componentmodule.hxx @@ -26,7 +26,7 @@ */ #include -#include +#include #include #include #include @@ -47,20 +47,12 @@ typedef css::uno::Reference< css::lang::XSingleServiceFactory > (SAL_CALL *Facto rtl_ModuleCount* ); - class OModuleImpl; class OModule { - friend class OModuleResourceClient; - private: OModule() = delete; //TODO: get rid of this class protected: - // resource administration - static ::osl::Mutex s_aMutex; /// access safety - static sal_Int32 s_nClients; /// number of registered clients - static OModuleImpl* s_pImpl; /// impl class. lives as long as at least one client for the module is registered - // auto registration administration static std::vector< OUString >* s_pImplementationNames; @@ -112,35 +104,10 @@ typedef css::uno::Reference< css::lang::XSingleServiceFactory > (SAL_CALL *Facto const OUString& _rImplementationName, const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxServiceManager ); - - protected: - /// register a client for the module - static void registerClient(); - /// revoke a client for the module - static void revokeClient(); - - private: - /** ensure that the impl class exists - @precond m_aMutex is guarded when this method gets called - */ - static void ensureImpl(); }; - - // base class for objects which uses any global module-specific resources - class OModuleResourceClient - { - public: - OModuleResourceClient() { OModule::registerClient(); } - ~OModuleResourceClient() { OModule::revokeClient(); } - }; - - // specialized ResId, using the resource locale provided by the global module - static inline OUString ModuleRes(const char* pId) - { - return Translate::get(pId, OModule::getResLocale()); - } + OUString ModuleRes(const char* pId); template class OMultiInstanceAutoRegistration diff --git a/extensions/source/propctrlr/modulepcr.cxx b/extensions/source/propctrlr/modulepcr.cxx index 56931b21bc14..8fedf6499ad0 100644 --- a/extensions/source/propctrlr/modulepcr.cxx +++ b/extensions/source/propctrlr/modulepcr.cxx @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -44,7 +44,6 @@ namespace pcr }; PcrModule::PcrModule() - :BaseClass( OString( "pcr" ), Application::GetSettings().GetUILanguageTag() ) { } @@ -56,7 +55,8 @@ namespace pcr OUString PcrRes(const char* pId) { - return Translate::get(pId, PcrModule::getInstance().getResLocale()); + static std::locale loc = Translate::Create("pcr"); + return Translate::get(pId, loc); } } // namespace pcr diff --git a/extensions/source/propctrlr/modulepcr.hxx b/extensions/source/propctrlr/modulepcr.hxx index 652ff0b93f8a..6fcbfef5100f 100644 --- a/extensions/source/propctrlr/modulepcr.hxx +++ b/extensions/source/propctrlr/modulepcr.hxx @@ -20,15 +20,15 @@ #ifndef INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_MODULEPCR_HXX #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_MODULEPCR_HXX -#include +#include namespace pcr { /* -------------------------------------------------------------------- */ - class PcrModule : public ::utl::OComponentResourceModule + class PcrModule : public ::comphelper::OModule { friend struct CreateModuleClass; - typedef ::utl::OComponentResourceModule BaseClass; + typedef ::comphelper::OModule BaseClass; public: static PcrModule& getInstance(); private: diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 5294357a30c2..8bf4fb01fdab 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -321,7 +321,7 @@ namespace { OUString SaneResId(const char *pID) { - static std::locale loc = Translate::Create("pcr", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("pcr"); return Translate::get(pID, loc); } diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 4c4eca89b045..81bdee096fa2 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -61,7 +61,7 @@ #include "com/sun/star/task/InteractionRequestStringResolver.hpp" #include "strings.hrc" -#include +#include #include #include #include @@ -614,7 +614,7 @@ void UpdateHandler::loadStrings() else mbStringsLoaded = true; - std::locale loc = Translate::Create("pcr", Application::GetSettings().GetUILanguageTag()); + std::locale loc = Translate::Create("pcr"); msChecking = loadString( loc, RID_UPDATE_STR_CHECKING ); msCheckingError = loadString( loc, RID_UPDATE_STR_CHECKING_ERR ); diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index b271c8f4eea2..2e334fc2c361 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -196,7 +196,7 @@ UpdateCheckUI::UpdateCheckUI(const uno::Reference& xCont , mbBubbleChanged( false ) , mnIconID( 0 ) { - maSfxLocale = Translate::Create("sfx", Application::GetSettings().GetUILanguageTag()); + maSfxLocale = Translate::Create("sfx"); maBubbleImage = GetBubbleImage( maBubbleImageURL ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 93d216bc8cc9..51577eb31393 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -437,7 +437,7 @@ bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Filter if ( mbStatus && mnLevelWarning && pFilterConfigItem ) { - std::locale loc = Translate::Create("flt", Application::GetSettings().GetUILanguageTag()); + std::locale loc = Translate::Create("flt"); ScopedVclPtrInstance< InfoBox > aInfoBox(nullptr, Translate::get(KEY_VERSION_CHECK, loc)); aInfoBox->Execute(); } diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 56e3370158e0..8419678e6564 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -28,7 +28,7 @@ #include #include "sfx2/passwd.hxx" #include "svtools/miscopt.hxx" -#include "tools/resmgr.hxx" +#include "unotools/resmgr.hxx" #include "comphelper/propertyvalue.hxx" #include "comphelper/sequence.hxx" @@ -44,7 +44,7 @@ static std::locale& getPDFFilterResLocale() { - static std::locale loc = Translate::Create("flt", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("flt"); return loc; } diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index 611315c51d5f..818946bd69df 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -884,7 +884,7 @@ bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue >& if ( mxStatusIndicator.is() ) { - std::locale loc(Translate::Create("flt", Application::GetSettings().GetUILanguageTag())); + std::locale loc(Translate::Create("flt")); sal_Int32 nTotalPageCount = aRangeEnum.size(); if ( bExportPages && bExportNotesPages ) nTotalPageCount *= 2; diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx index ea20785d4995..476d3b59cdae 100644 --- a/filter/source/t602/t602filter.cxx +++ b/filter/source/t602/t602filter.cxx @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include using namespace ::cppu; diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 9ff9d81a046e..7d6c81f6edae 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -23,7 +23,7 @@ #include #include "com/sun/star/ui/dialogs/TemplateDescription.hpp" -#include +#include #include #include #include @@ -71,7 +71,7 @@ EnsureResLocale::EnsureResLocale() { if (!pXSLTResLocale) { - m_xResLocale.reset(new std::locale(Translate::Create("flt", Application::GetSettings().GetUILanguageTag()))); + m_xResLocale.reset(new std::locale(Translate::Create("flt"))); pXSLTResLocale = m_xResLocale.get(); } } diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx index 2db0f6a08707..624fed6ef3a1 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/forms/source/resource/frm_resource.cxx b/forms/source/resource/frm_resource.cxx index 4a3ff363abf6..aacea75a5811 100644 --- a/forms/source/resource/frm_resource.cxx +++ b/forms/source/resource/frm_resource.cxx @@ -18,10 +18,7 @@ */ #include "frm_resource.hxx" -#include - -#include -#include +#include namespace frm { @@ -29,7 +26,7 @@ namespace frm { OUString loadString(const char* pResId) { - static std::locale loc = Translate::Create("frm", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("frm"); return Translate::get(pResId, loc); } } diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index 8f778bde6b45..5ff5067505c6 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -27,7 +27,7 @@ #include "osl/mutex.hxx" #include -#include +#include #include #include #include diff --git a/formula/source/core/resource/core_resource.cxx b/formula/source/core/resource/core_resource.cxx index b03668d3c783..5163d41b5ae7 100644 --- a/formula/source/core/resource/core_resource.cxx +++ b/formula/source/core/resource/core_resource.cxx @@ -19,11 +19,9 @@ #include "core_resource.hxx" -#include +#include // ---- needed as long as we have no contexts for components --- -#include -#include #include #include @@ -48,7 +46,7 @@ namespace formula if (m_pImpl) return; - m_pImpl = new std::locale(Translate::Create("for", Application::GetSettings().GetUILanguageTag())); + m_pImpl = new std::locale(Translate::Create("for")); } void ResourceManager::registerClient() diff --git a/formula/source/ui/inc/ModuleHelper.hxx b/formula/source/ui/inc/ModuleHelper.hxx index c5e92847b701..91cbb88a0b29 100644 --- a/formula/source/ui/inc/ModuleHelper.hxx +++ b/formula/source/ui/inc/ModuleHelper.hxx @@ -21,7 +21,7 @@ #define INCLUDED_FORMULA_SOURCE_UI_INC_MODULEHELPER_HXX #include -#include +#include namespace formula { diff --git a/formula/source/ui/resource/ModuleHelper.cxx b/formula/source/ui/resource/ModuleHelper.cxx index 80636792aa14..0b0ff18403b7 100644 --- a/formula/source/ui/resource/ModuleHelper.cxx +++ b/formula/source/ui/resource/ModuleHelper.cxx @@ -66,7 +66,7 @@ const std::locale& OModuleImpl::getResLocale() if (!m_xResources) { // create a manager with a fixed prefix - m_xResources.reset(new std::locale(Translate::Create("for", Application::GetSettings().GetUILanguageTag()))); + m_xResources.reset(new std::locale(Translate::Create("for"))); } return *m_xResources; } diff --git a/fpicker/inc/fpsofficeResMgr.hxx b/fpicker/inc/fpsofficeResMgr.hxx index 1e7711d670b5..1d38ae7d4fa7 100644 --- a/fpicker/inc/fpsofficeResMgr.hxx +++ b/fpicker/inc/fpsofficeResMgr.hxx @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -21,7 +21,7 @@ namespace fpicker { std::locale* operator ()() { - return new std::locale(Translate::Create("fps", Application::GetSettings().GetUILanguageTag())); + return new std::locale(Translate::Create("fps")); } static std::locale* getOrCreate() diff --git a/fpicker/source/aqua/resourceprovider.mm b/fpicker/source/aqua/resourceprovider.mm index e924179f4f40..7543d322c295 100644 --- a/fpicker/source/aqua/resourceprovider.mm +++ b/fpicker/source/aqua/resourceprovider.mm @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 9ee48838fc54..03bbfa2ab03a 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -20,7 +20,7 @@ #include "iodlgimp.hxx" #include "svtools/headbar.hxx" #include -#include +#include #include #include #include @@ -144,7 +144,7 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu ) if ( nCount == 1 ) { // adjust the title of the top level entry (the workspace) - std::locale loc = Translate::Create("svl", Application::GetSettings().GetUILanguageTag()); + std::locale loc = Translate::Create("svl"); _pMenu->SetItemText(--nItemId, Translate::get(STR_SVT_MIMETYPE_CNT_FSYSBOX, loc)); } --nCount; diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx index e2782b1a984e..7e055c5d8ce1 100644 --- a/fpicker/source/win32/misc/resourceprovider.cxx +++ b/fpicker/source/win32/misc/resourceprovider.cxx @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include "fpsofficeResMgr.hxx" diff --git a/framework/inc/pch/precompiled_fwe.hxx b/framework/inc/pch/precompiled_fwe.hxx index 86fb2645b5ff..a27767744984 100644 --- a/framework/inc/pch/precompiled_fwe.hxx +++ b/framework/inc/pch/precompiled_fwe.hxx @@ -217,7 +217,6 @@ #include #include #include -#include #include #include #include @@ -232,6 +231,7 @@ #include #include #include +#include #include #include #include diff --git a/framework/inc/pch/precompiled_fwi.hxx b/framework/inc/pch/precompiled_fwi.hxx index 724aa721cc42..5e771f75775a 100644 --- a/framework/inc/pch/precompiled_fwi.hxx +++ b/framework/inc/pch/precompiled_fwi.hxx @@ -156,7 +156,6 @@ #include #include #include -#include #include #include #include @@ -166,6 +165,7 @@ #include #include #include +#include #include /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/pch/precompiled_fwk.hxx b/framework/inc/pch/precompiled_fwk.hxx index 900e1b3c75da..cb285f5b48a4 100644 --- a/framework/inc/pch/precompiled_fwk.hxx +++ b/framework/inc/pch/precompiled_fwk.hxx @@ -342,7 +342,6 @@ #include #include #include -#include #include #include #include @@ -359,6 +358,7 @@ #include #include #include +#include #include #include #include diff --git a/framework/inc/pch/precompiled_fwl.hxx b/framework/inc/pch/precompiled_fwl.hxx index 2f59e411a3f8..11b2e2a558dd 100644 --- a/framework/inc/pch/precompiled_fwl.hxx +++ b/framework/inc/pch/precompiled_fwl.hxx @@ -325,7 +325,6 @@ #include #include #include -#include #include #include #include @@ -339,6 +338,7 @@ #include #include #include +#include #include #include diff --git a/framework/source/fwe/classes/fwkresid.cxx b/framework/source/fwe/classes/fwkresid.cxx index 8ed6c1dbb5e5..4d421df5c4bd 100644 --- a/framework/source/fwe/classes/fwkresid.cxx +++ b/framework/source/fwe/classes/fwkresid.cxx @@ -18,30 +18,12 @@ */ #include "classes/fwkresid.hxx" -#include -#include -#include - -#include - -namespace -{ - const std::locale& GetResLocale() - { - static std::locale* pResLocale = nullptr; - if (!pResLocale) - { - SolarMutexGuard aSolarGuard; - static std::locale loc(Translate::Create("fwe", Application::GetSettings().GetUILanguageTag())); - pResLocale = &loc; - } - return *pResLocale; - } -} +#include OUString FwkResId(const char* pId) { - return Translate::get(pId, GetResLocale()); + static std::locale loc(Translate::Create("fwe")); + return Translate::get(pId, loc); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/uiconfiguration/ImageList.cxx b/framework/source/uiconfiguration/ImageList.cxx index 46202f8c8a38..f515e2997d24 100644 --- a/framework/source/uiconfiguration/ImageList.cxx +++ b/framework/source/uiconfiguration/ImageList.cxx @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/include/tools/resmgr.hxx b/include/tools/resmgr.hxx deleted file mode 100644 index fe5b68e6328e..000000000000 --- a/include/tools/resmgr.hxx +++ /dev/null @@ -1,38 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_TOOLS_RESMGR_HXX -#define INCLUDED_TOOLS_RESMGR_HXX - -#include -#include - -typedef OUString (*ResHookProc)(const OUString& rStr); - -namespace Translate -{ - TOOLS_DLLPUBLIC std::locale Create(const sal_Char* pPrefixName, const LanguageTag& rLocale); - TOOLS_DLLPUBLIC OUString get(const char* pId, const std::locale &loc); - TOOLS_DLLPUBLIC void SetReadStringHook( ResHookProc pProc ); - TOOLS_DLLPUBLIC ResHookProc GetReadStringHook(); - TOOLS_DLLPUBLIC OUString ExpandVariables(const OUString& rString); -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/unotools/componentresmodule.hxx b/include/unotools/componentresmodule.hxx deleted file mode 100644 index ee19e99f53b0..000000000000 --- a/include/unotools/componentresmodule.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef INCLUDED_UNOTOOLS_COMPONENTRESMODULE_HXX -#define INCLUDED_UNOTOOLS_COMPONENTRESMODULE_HXX - -#include -#include -#include -#include - -class LanguageTag; - -namespace utl -{ - - class OComponentResModuleImpl; - - /** extends the comphelper::OModule implementation with - simply resource access - */ - class UNOTOOLS_DLLPUBLIC OComponentResourceModule : public ::comphelper::OModule - { - private: - typedef ::comphelper::OModule BaseClass; - - private: - ::std::unique_ptr< OComponentResModuleImpl > m_pImpl; - - public: - OComponentResourceModule(const OString& _rResFilePrefix, const LanguageTag& rLanguage); - virtual ~OComponentResourceModule() override; - - /// get the resource locale of the module - const std::locale& getResLocale(); - }; - -} // namespace utl - -#endif // INCLUDED_UNOTOOLS_COMPONENTRESMODULE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/unotools/resmgr.hxx b/include/unotools/resmgr.hxx new file mode 100644 index 000000000000..65e730bd0021 --- /dev/null +++ b/include/unotools/resmgr.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_UNOTOOLS_RESMGR_HXX +#define INCLUDED_UNOTOOLS_RESMGR_HXX + +#include +#include +#include + +typedef OUString (*ResHookProc)(const OUString& rStr); + +namespace Translate +{ + UNOTOOLS_DLLPUBLIC std::locale Create(const sal_Char* pPrefixName, const LanguageTag& rLocale = SvtSysLocale().GetUILanguageTag()); + UNOTOOLS_DLLPUBLIC OUString get(const char* pId, const std::locale &loc); + UNOTOOLS_DLLPUBLIC void SetReadStringHook( ResHookProc pProc ); + UNOTOOLS_DLLPUBLIC ResHookProc GetReadStringHook(); + UNOTOOLS_DLLPUBLIC OUString ExpandVariables(const OUString& rString); +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index a098ff15d31f..27a1f86a2d71 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/ios/CustomTarget_Lo_Xcconfig.mk b/ios/CustomTarget_Lo_Xcconfig.mk index 75a6cb094a18..3e3be5eca4d1 100644 --- a/ios/CustomTarget_Lo_Xcconfig.mk +++ b/ios/CustomTarget_Lo_Xcconfig.mk @@ -60,7 +60,7 @@ $(LO_XCCONFIG) : cp $(INSTDIR)/program/services.rdb $(IOSRESOURCE) # copy .res files - # program/resource is hardcoded in tools/source/rc/resmgr.cxx. Sure, + # program/resource is hardcoded in unotools/source/i18n/resmgr.cxx. Sure, # we could set STAR_RESOURCE_PATH instead. sigh... mkdir -p $(IOSRESOURCE)/program/resource cp $(INSTDIR)/program/resource/*en-US.res $(IOSRESOURCE)/program/resource diff --git a/reportdesign/inc/pch/precompiled_rpt.hxx b/reportdesign/inc/pch/precompiled_rpt.hxx index 4e5e9da61abf..a449efc9b906 100644 --- a/reportdesign/inc/pch/precompiled_rpt.hxx +++ b/reportdesign/inc/pch/precompiled_rpt.hxx @@ -315,7 +315,6 @@ #include #include #include -#include #include #include #include @@ -335,6 +334,7 @@ #include #include #include +#include #include #include diff --git a/reportdesign/inc/pch/precompiled_rptui.hxx b/reportdesign/inc/pch/precompiled_rptui.hxx index 75292c8b43d1..07c3c3d6819d 100644 --- a/reportdesign/inc/pch/precompiled_rptui.hxx +++ b/reportdesign/inc/pch/precompiled_rptui.hxx @@ -524,7 +524,6 @@ #include #include #include -#include #include #include #include @@ -545,6 +544,7 @@ #include #include #include +#include #include #include diff --git a/reportdesign/source/core/resource/core_resource.cxx b/reportdesign/source/core/resource/core_resource.cxx index 21718d124830..8f1a10f7bbeb 100644 --- a/reportdesign/source/core/resource/core_resource.cxx +++ b/reportdesign/source/core/resource/core_resource.cxx @@ -17,12 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include "core_resource.hxx" -#include +#include // ---- needed as long as we have no contexts for components --- -#include -#include - #include #include #include @@ -33,7 +30,7 @@ OUString RptResId(const char* pId) { - static std::locale loc = Translate::Create("rpt", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("rpt"); return Translate::get(pId, loc); } diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx index 36a25e337294..60cf31e4d2fe 100644 --- a/reportdesign/source/core/sdr/RptModel.cxx +++ b/reportdesign/source/core/sdr/RptModel.cxx @@ -20,7 +20,7 @@ #include "RptModel.hxx" #include "RptPage.hxx" #include -#include +#include #include #include diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx index 869df6bbc266..40f1de0244d4 100644 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -562,7 +562,6 @@ #include #include #include -#include #include #include #include @@ -583,6 +582,7 @@ #include #include #include +#include #include #include #include diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index 3424e4abcc19..aae468ffd160 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 8e7b3d6aaab1..daa0c7cf06ea 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include "scitems.hxx" diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 7b8a2cfd1f74..a92e1a86a610 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -62,7 +62,7 @@ #include #include #include -#include +#include #include #include @@ -138,7 +138,7 @@ void ScModule::InitInterface_Impl() } ScModule::ScModule( SfxObjectFactory* pFact ) : - SfxModule( Translate::Create("sc", Application::GetSettings().GetUILanguageTag()), {pFact} ), + SfxModule( Translate::Create("sc"), {pFact} ), aIdleTimer("sc ScModule IdleTimer"), aSpellIdle("sc ScModule SpellIdle"), mpDragData(new ScDragData), diff --git a/scaddins/Library_analysis.mk b/scaddins/Library_analysis.mk index 2c56e9daa9ee..dc854a0fb56d 100644 --- a/scaddins/Library_analysis.mk +++ b/scaddins/Library_analysis.mk @@ -39,7 +39,7 @@ $(eval $(call gb_Library_use_libraries,analysis,\ cppu \ cppuhelper \ sal \ - tl \ + utl \ i18nlangtag \ )) diff --git a/scaddins/Library_date.mk b/scaddins/Library_date.mk index 71c3db9ccb5d..96b1e58430d5 100644 --- a/scaddins/Library_date.mk +++ b/scaddins/Library_date.mk @@ -38,7 +38,7 @@ $(eval $(call gb_Library_use_libraries,date,\ cppu \ cppuhelper \ sal \ - tl \ + utl \ i18nlangtag \ )) diff --git a/scaddins/Library_pricing.mk b/scaddins/Library_pricing.mk index 2f221c9964fd..1c5e43a22da3 100644 --- a/scaddins/Library_pricing.mk +++ b/scaddins/Library_pricing.mk @@ -38,7 +38,7 @@ $(eval $(call gb_Library_use_libraries,pricing,\ cppu \ cppuhelper \ sal \ - tl \ + utl \ i18nlangtag \ )) diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx index 4d98db9a1ea3..b0f55f5af779 100644 --- a/scaddins/source/analysis/analysis.cxx +++ b/scaddins/source/analysis/analysis.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index ef73390c854b..f061695dc1c9 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "deffuncname.hxx" diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index 3df3fe78a061..d54055649538 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include using namespace ::com::sun::star; using namespace sca::pricing; diff --git a/sccomp/Library_solver.mk b/sccomp/Library_solver.mk index 2d30205fe4b0..3339c0ed70df 100644 --- a/sccomp/Library_solver.mk +++ b/sccomp/Library_solver.mk @@ -34,8 +34,7 @@ $(eval $(call gb_Library_use_libraries,solver,\ cppu \ cppuhelper \ sal \ - tl \ - vcl \ + utl \ i18nlangtag \ )) diff --git a/sccomp/source/solver/SolverComponent.cxx b/sccomp/source/solver/SolverComponent.cxx index 134226d02a55..6e52ebc8653a 100644 --- a/sccomp/source/solver/SolverComponent.cxx +++ b/sccomp/source/solver/SolverComponent.cxx @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include @@ -46,7 +46,7 @@ using namespace com::sun::star; OUString SolverComponent::GetResourceString(const char* pId) { - static std::locale loc = Translate::Create("scc", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("scc"); return Translate::get(pId, loc); } diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx index b59e3b64638c..fec38b05e857 100644 --- a/sd/inc/pch/precompiled_sd.hxx +++ b/sd/inc/pch/precompiled_sd.hxx @@ -489,7 +489,6 @@ #include #include #include -#include #include #include #include @@ -508,6 +507,7 @@ #include #include #include +#include #include #include #include diff --git a/sd/inc/pch/precompiled_sdui.hxx b/sd/inc/pch/precompiled_sdui.hxx index 6b48d65e2659..0e51c502110c 100644 --- a/sd/inc/pch/precompiled_sdui.hxx +++ b/sd/inc/pch/precompiled_sdui.hxx @@ -498,7 +498,6 @@ #include #include #include -#include #include #include #include @@ -521,6 +520,7 @@ #include #include #include +#include #include #include diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 334095989164..f72c6206b297 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index 0768dfc22fb2..aef1dddaebea 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -65,7 +65,7 @@ void SdModule::InitInterface_Impl() // Ctor SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 ) -: SfxModule( Translate::Create("sd", Application::GetSettings().GetUILanguageTag()), {pFact1, pFact2} ), +: SfxModule( Translate::Create("sd"), {pFact1, pFact2} ), pTransferClip(nullptr), pTransferDrag(nullptr), pTransferSelection(nullptr), diff --git a/sfx2/inc/pch/precompiled_sfx.hxx b/sfx2/inc/pch/precompiled_sfx.hxx index e381e7370484..cea43ef5b833 100644 --- a/sfx2/inc/pch/precompiled_sfx.hxx +++ b/sfx2/inc/pch/precompiled_sfx.hxx @@ -403,7 +403,6 @@ #include #include #include -#include #include #include #include @@ -428,6 +427,7 @@ #include #include #include +#include #include #include #include diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 2bc435a1da16..d163e80226dc 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include @@ -215,9 +215,9 @@ void SfxApplication::Initialize_Impl() getRID_ERRHDL(), ErrCode(ERRCODE_AREA_IO), ErrCode(ERRCODE_AREA_SVX)); #if HAVE_FEATURE_SCRIPTING - pImpl->aBasicResLocale = Translate::Create("sb", Application::GetSettings().GetUILanguageTag()); + pImpl->aBasicResLocale = Translate::Create("sb"); #endif - pImpl->aSvtResLocale = Translate::Create("svt", Application::GetSettings().GetUILanguageTag()); + pImpl->aSvtResLocale = Translate::Create("svt"); pImpl->m_pSoErrorHdl = new SfxErrorHandler( getRID_SO_ERROR_HANDLER(), ErrCode(ERRCODE_AREA_SO), ErrCode(ERRCODE_AREA_SO_END), &(pImpl->aSvtResLocale)); diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index f25562df5647..773f5c09bdf8 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/sfx2/source/bastyp/sfxresid.cxx b/sfx2/source/bastyp/sfxresid.cxx index 97c8f48a436d..3aa36da218f9 100644 --- a/sfx2/source/bastyp/sfxresid.cxx +++ b/sfx2/source/bastyp/sfxresid.cxx @@ -19,9 +19,8 @@ #include -#include -#include -#include "tools/resmgr.hxx" +#include +#include "unotools/resmgr.hxx" static std::locale* pResLocale = nullptr; @@ -29,7 +28,7 @@ std::locale* SfxResLocale::GetResLocale() { if (!pResLocale) { - pResLocale = new std::locale(Translate::Create("sfx", Application::GetSettings().GetUILanguageTag())); + pResLocale = new std::locale(Translate::Create("sfx")); } return pResLocale; diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx index 907b4ead60ef..6b4c453bfdd0 100644 --- a/sfx2/source/dialog/styfitem.cxx +++ b/sfx2/source/dialog/styfitem.cxx @@ -18,7 +18,7 @@ */ #include -#include +#include SfxStyleFamilyItem::SfxStyleFamilyItem(SfxStyleFamily nFamily_, const OUString &rName, const Image& rImage, const std::pair* pStringArray, const std::locale& rResLocale) : nFamily(nFamily_) diff --git a/slideshow/inc/pch/precompiled_slideshow.hxx b/slideshow/inc/pch/precompiled_slideshow.hxx index 9694010b291c..9bb3facc88eb 100644 --- a/slideshow/inc/pch/precompiled_slideshow.hxx +++ b/slideshow/inc/pch/precompiled_slideshow.hxx @@ -241,7 +241,6 @@ #include #include #include -#include #include #include #include @@ -256,6 +255,7 @@ #include #include #include +#include #include #include diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index af4623c9bfcc..37548597e82b 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include "smmod.hxx" @@ -121,7 +121,7 @@ void SmModule::InitInterface_Impl() } SmModule::SmModule(SfxObjectFactory* pObjFact) - : SfxModule(Translate::Create("sm", Application::GetSettings().GetUILanguageTag()), {pObjFact}) + : SfxModule(Translate::Create("sm"), {pObjFact}) { SetName("StarMath"); diff --git a/svl/source/misc/getstringresource.cxx b/svl/source/misc/getstringresource.cxx index 59ee843391cb..ff95e7d2c22c 100644 --- a/svl/source/misc/getstringresource.cxx +++ b/svl/source/misc/getstringresource.cxx @@ -19,20 +19,17 @@ #include -#include #include #include -#include #include #include -#include -#include +#include #include "getstringresource.hxx" OUString SvlResId(const char* id) { - static std::locale loc = Translate::Create("svl", SvtSysLocale().GetUILanguageTag()); + static std::locale loc = Translate::Create("svl"); return Translate::get(id, loc); } diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx index 189391a74379..d7e516d25daf 100644 --- a/svtools/inc/pch/precompiled_svt.hxx +++ b/svtools/inc/pch/precompiled_svt.hxx @@ -375,7 +375,6 @@ #include #include #include -#include #include #include #include @@ -398,6 +397,7 @@ #include #include #include +#include #include #include #include diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 6c8f162da847..892f4299977f 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 6e38437f79ac..47a5689ec031 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include #include @@ -145,7 +145,7 @@ SfxErrorHandler::SfxErrorHandler(const ErrMsgCode* pIdPs, ErrCode lStartP, ErrCo ErrorRegistry::RegisterDisplay(&aWndFunc); if (!pResLocale) { - xFreeLocale.reset(new std::locale(Translate::Create("svt", Application::GetSettings().GetUILanguageTag()))); + xFreeLocale.reset(new std::locale(Translate::Create("svt"))); pResLocale = xFreeLocale.get(); } } @@ -197,7 +197,7 @@ void SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr) */ { - std::locale loc(Translate::Create("svt", Application::GetSettings().GetUILanguageTag())); + std::locale loc(Translate::Create("svt")); for (const ErrMsgCode* pItem = getRID_ERRHDL(); pItem->second; ++pItem) { if (sal_uInt32(pItem->second) == lClassId) @@ -277,7 +277,7 @@ bool SfxErrorContext::GetString(ErrCode nErrId, OUString &rStr) std::locale* pFreeLocale = nullptr; if (!pResLocale) { - pFreeLocale = new std::locale(Translate::Create("svt", Application::GetSettings().GetUILanguageTag())); + pFreeLocale = new std::locale(Translate::Create("svt")); pResLocale = pFreeLocale; } if (pResLocale) diff --git a/svtools/source/misc/svtresid.cxx b/svtools/source/misc/svtresid.cxx index c3e5ecbd1239..e6cac0b9b981 100644 --- a/svtools/source/misc/svtresid.cxx +++ b/svtools/source/misc/svtresid.cxx @@ -17,17 +17,16 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include +#include #include -#include -#include static std::locale* pResLocale=nullptr; std::locale* SvtResLocale::GetResLocale() { if (!pResLocale) - pResLocale = new std::locale(Translate::Create("svt", SvtSysLocale().GetUILanguageTag())); + pResLocale = new std::locale(Translate::Create("svt")); return pResLocale; } diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx index 72422d06817c..f8e34c2d40b8 100644 --- a/svx/inc/pch/precompiled_svx.hxx +++ b/svx/inc/pch/precompiled_svx.hxx @@ -387,7 +387,6 @@ #include #include #include -#include #include #include #include @@ -403,6 +402,7 @@ #include #include #include +#include #include #include #include diff --git a/svx/inc/pch/precompiled_svxcore.hxx b/svx/inc/pch/precompiled_svxcore.hxx index 49ee27ea7a1c..e5c5833f6ab0 100644 --- a/svx/inc/pch/precompiled_svxcore.hxx +++ b/svx/inc/pch/precompiled_svxcore.hxx @@ -419,7 +419,6 @@ #include #include #include -#include #include #include #include @@ -438,6 +437,7 @@ #include #include #include +#include #include #include #include diff --git a/svx/source/dialog/dialmgr.cxx b/svx/source/dialog/dialmgr.cxx index 145ef6bf0745..870cd05f295f 100644 --- a/svx/source/dialog/dialmgr.cxx +++ b/svx/source/dialog/dialmgr.cxx @@ -17,14 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include -#include -#include const std::locale& SvxResLocale() { - static std::locale loc = Translate::Create("svx", Application::GetSettings().GetUILanguageTag()); + static std::locale loc = Translate::Create("svx"); return loc; } diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 80806697767e..da2303afc156 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -30,7 +30,7 @@ #include "fpicker/strings.hrc" #include #include -#include +#include #include #include #include @@ -3355,7 +3355,7 @@ namespace svxform m_pFilePickerBtn->SetClickHdl( LINK( this, AddInstanceDialog, FilePickerHdl ) ); // load the filter name from fps resource - m_sAllFilterName = Translate::get(STR_FILTERNAME_ALL, Translate::Create("fps", Application::GetSettings().GetUILanguageTag())); + m_sAllFilterName = Translate::get(STR_FILTERNAME_ALL, Translate::Create("fps")); } AddInstanceDialog::~AddInstanceDialog() diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index f87769814f7d..e77ed61a49fa 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index 8efe25d6111f..cf712c30a116 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/inc/pch/precompiled_msword.hxx b/sw/inc/pch/precompiled_msword.hxx index 29e6f0b6d0d8..6a3ccf2b6a78 100644 --- a/sw/inc/pch/precompiled_msword.hxx +++ b/sw/inc/pch/precompiled_msword.hxx @@ -646,7 +646,6 @@ #include #include #include -#include #include #include #include @@ -672,6 +671,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx index 27eb99b158c0..8e56844a6334 100644 --- a/sw/inc/pch/precompiled_sw.hxx +++ b/sw/inc/pch/precompiled_sw.hxx @@ -520,7 +520,6 @@ #include #include #include -#include #include #include #include @@ -560,6 +559,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/inc/pch/precompiled_swui.hxx b/sw/inc/pch/precompiled_swui.hxx index d0326823fa6d..44f69c1c9bbd 100644 --- a/sw/inc/pch/precompiled_swui.hxx +++ b/sw/inc/pch/precompiled_swui.hxx @@ -578,7 +578,6 @@ #include #include #include -#include #include #include #include @@ -607,6 +606,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/inc/pch/precompiled_vbaswobj.hxx b/sw/inc/pch/precompiled_vbaswobj.hxx index 9cbc82468cb9..ff5c46d8b026 100644 --- a/sw/inc/pch/precompiled_vbaswobj.hxx +++ b/sw/inc/pch/precompiled_vbaswobj.hxx @@ -375,7 +375,6 @@ #include #include #include -#include #include #include #include @@ -396,6 +395,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index 40cb9aa2135c..dfd1f6aa1912 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -146,7 +146,7 @@ using namespace ::com::sun::star::uno; SwModule::SwModule( SfxObjectFactory* pWebFact, SfxObjectFactory* pFact, SfxObjectFactory* pGlobalFact ) - : SfxModule( Translate::Create("sw", SvtSysLocale().GetUILanguageTag()), {pWebFact, pFact, pGlobalFact} ), + : SfxModule( Translate::Create("sw"), {pWebFact, pFact, pGlobalFact} ), m_pModuleConfig(nullptr), m_pUsrPref(nullptr), m_pWebUsrPref(nullptr), diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index 7ae20567b393..415292bd2a26 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/test/source/setupvcl.cxx b/test/source/setupvcl.cxx index 8be40094d84c..de27c7acff48 100644 --- a/test/source/setupvcl.cxx +++ b/test/source/setupvcl.cxx @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index f24d4a5851a4..d0d9f4516c2b 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -69,7 +69,6 @@ $(eval $(call gb_Library_add_exception_objects,tl,\ tools/source/memtools/unqidx \ tools/source/misc/cpuid \ tools/source/misc/extendapplicationenvironment \ - tools/source/rc/resmgr \ tools/source/ref/globname \ tools/source/ref/pstm \ tools/source/ref/ref \ @@ -94,7 +93,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,tl,\ $(eval $(call gb_Library_use_externals,tl,\ boost_headers \ - boost_locale \ zlib \ )) diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx deleted file mode 100644 index 842e58cee3b9..000000000000 --- a/tools/source/rc/resmgr.cxx +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include - -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -namespace -{ - OUString createFromUtf8(const char* data, size_t size) - { - OUString aTarget; - bool bSuccess = rtl_convertStringToUString(&aTarget.pData, - data, - size, - RTL_TEXTENCODING_UTF8, - RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR|RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR|RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR); - (void) bSuccess; - assert(bSuccess); - return aTarget; - } - - OString genKeyId(const OString& rGenerator) - { - sal_uInt32 nCRC = rtl_crc32(0, rGenerator.getStr(), rGenerator.getLength()); - // Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs - static const char sSymbols[] = - "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789"; - char sKeyId[6]; - for (short nKeyInd = 0; nKeyInd < 5; ++nKeyInd) - { - sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % strlen(sSymbols)]; - nCRC >>= 6; - } - sKeyId[5] = '\0'; - return OString(sKeyId); - } -} - -namespace Translate -{ - std::locale Create(const sal_Char* pPrefixName, const LanguageTag& rLocale) - { - static std::unordered_map aCache; - OString sIdentifier = rLocale.getGlibcLocaleString(".UTF-8").toUtf8(); - OString sUnique = sIdentifier + OString(pPrefixName); - auto aFind = aCache.find(sUnique); - if (aFind != aCache.end()) - return aFind->second; - boost::locale::generator gen; - gen.characters(boost::locale::char_facet); - gen.categories(boost::locale::message_facet | boost::locale::information_facet); - OUString uri("$BRAND_BASE_DIR/$BRAND_SHARE_RESOURCE_SUBDIR/"); - rtl::Bootstrap::expandMacros(uri); - OUString path; - osl::File::getSystemPathFromFileURL(uri, path); - gen.add_messages_path(OUStringToOString(path, osl_getThreadTextEncoding()).getStr()); - gen.add_messages_domain(pPrefixName); - std::locale aRet(gen(sIdentifier.getStr())); - aCache[sUnique] = aRet; - return aRet; - } - - OUString get(const char* pContextAndId, const std::locale &loc) - { - OString sContext; - const char *pId = strchr(pContextAndId, '\004'); - if (!pId) - pId = pContextAndId; - else - { - sContext = OString(pContextAndId, pId - pContextAndId); - ++pId; - } - - //if its a key id locale, generate it here - if (std::use_facet(loc).language() == "qtz") - { - OString sKeyId(genKeyId(OString(pContextAndId).replace('\004', '|'))); - return OUString::fromUtf8(sKeyId) + OUStringLiteral1(0x2016) + createFromUtf8(pId, strlen(pId)); - } - - //otherwise translate it - const std::string ret = boost::locale::pgettext(sContext.getStr(), pId, loc); - return ExpandVariables(createFromUtf8(ret.data(), ret.size())); - } - - static ResHookProc pImplResHookProc = nullptr; - - OUString ExpandVariables(const OUString& rString) - { - if (pImplResHookProc) - return pImplResHookProc(rString); - return rString; - } - - void SetReadStringHook( ResHookProc pProc ) - { - pImplResHookProc = pProc; - } - - ResHookProc GetReadStringHook() - { - return pImplResHookProc; - } -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk index 8656ebbe594c..0bfcbad5e383 100644 --- a/unotools/Library_utl.mk +++ b/unotools/Library_utl.mk @@ -11,7 +11,10 @@ # utl is the name of the library as it is found in Repository.mk $(eval $(call gb_Library_Library,utl)) -$(eval $(call gb_Library_use_external,utl,boost_headers)) +$(eval $(call gb_Library_use_externals,utl,\ + boost_headers \ + boost_locale \ +)) $(eval $(call gb_Library_use_custom_headers,utl,\ officecfg/registry \ @@ -92,10 +95,10 @@ $(eval $(call gb_Library_add_exception_objects,utl,\ unotools/source/i18n/localedatawrapper \ unotools/source/i18n/nativenumberwrapper \ unotools/source/i18n/readwritemutexguard \ + unotools/source/i18n/resmgr \ unotools/source/i18n/textsearch \ unotools/source/i18n/transliterationwrapper \ unotools/source/misc/closeveto \ - unotools/source/misc/componentresmodule \ unotools/source/misc/datetime \ unotools/source/misc/desktopterminationobserver \ unotools/source/misc/eventlisteneradapter \ diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx new file mode 100644 index 000000000000..492c7fcf8632 --- /dev/null +++ b/unotools/source/i18n/resmgr.cxx @@ -0,0 +1,158 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#include + +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace +{ + OUString createFromUtf8(const char* data, size_t size) + { + OUString aTarget; + bool bSuccess = rtl_convertStringToUString(&aTarget.pData, + data, + size, + RTL_TEXTENCODING_UTF8, + RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR|RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_ERROR|RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR); + (void) bSuccess; + assert(bSuccess); + return aTarget; + } + + OString genKeyId(const OString& rGenerator) + { + sal_uInt32 nCRC = rtl_crc32(0, rGenerator.getStr(), rGenerator.getLength()); + // Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs + static const char sSymbols[] = + "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789"; + char sKeyId[6]; + for (short nKeyInd = 0; nKeyInd < 5; ++nKeyInd) + { + sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % strlen(sSymbols)]; + nCRC >>= 6; + } + sKeyId[5] = '\0'; + return OString(sKeyId); + } +} + +namespace Translate +{ + std::locale Create(const sal_Char* pPrefixName, const LanguageTag& rLocale) + { + static std::unordered_map aCache; + OString sIdentifier = rLocale.getGlibcLocaleString(".UTF-8").toUtf8(); + OString sUnique = sIdentifier + OString(pPrefixName); + auto aFind = aCache.find(sUnique); + if (aFind != aCache.end()) + return aFind->second; + boost::locale::generator gen; + gen.characters(boost::locale::char_facet); + gen.categories(boost::locale::message_facet | boost::locale::information_facet); + OUString uri("$BRAND_BASE_DIR/$BRAND_SHARE_RESOURCE_SUBDIR/"); + rtl::Bootstrap::expandMacros(uri); + OUString path; + osl::File::getSystemPathFromFileURL(uri, path); + gen.add_messages_path(OUStringToOString(path, osl_getThreadTextEncoding()).getStr()); + gen.add_messages_domain(pPrefixName); + std::locale aRet(gen(sIdentifier.getStr())); + aCache[sUnique] = aRet; + return aRet; + } + + OUString get(const char* pContextAndId, const std::locale &loc) + { + OString sContext; + const char *pId = strchr(pContextAndId, '\004'); + if (!pId) + pId = pContextAndId; + else + { + sContext = OString(pContextAndId, pId - pContextAndId); + ++pId; + } + + //if its a key id locale, generate it here + if (std::use_facet(loc).language() == "qtz") + { + OString sKeyId(genKeyId(OString(pContextAndId).replace('\004', '|'))); + return OUString::fromUtf8(sKeyId) + OUStringLiteral1(0x2016) + createFromUtf8(pId, strlen(pId)); + } + + //otherwise translate it + const std::string ret = boost::locale::pgettext(sContext.getStr(), pId, loc); + return ExpandVariables(createFromUtf8(ret.data(), ret.size())); + } + + static ResHookProc pImplResHookProc = nullptr; + + OUString ExpandVariables(const OUString& rString) + { + if (pImplResHookProc) + return pImplResHookProc(rString); + return rString; + } + + void SetReadStringHook( ResHookProc pProc ) + { + pImplResHookProc = pProc; + } + + ResHookProc GetReadStringHook() + { + return pImplResHookProc; + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unotools/source/misc/componentresmodule.cxx b/unotools/source/misc/componentresmodule.cxx deleted file mode 100644 index cb1f718fca44..000000000000 --- a/unotools/source/misc/componentresmodule.cxx +++ /dev/null @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -#include -#include -#include - -namespace utl -{ - - //= OComponentResModuleImpl - - /** PIMPL-class for OComponentResourceModule - - not threadsafe! - */ - class OComponentResModuleImpl - { - private: - std::locale m_aLocale; - bool m_bLocaleInitialized; - OString m_sResFilePrefix; - LanguageTag m_aLanguage; - - OComponentResModuleImpl(const OComponentResModuleImpl&) = delete; - OComponentResModuleImpl& operator=(const OComponentResModuleImpl&) = delete; - - public: - explicit OComponentResModuleImpl(const OString& _rResFilePrefix, const LanguageTag& rLanguage) - : m_bLocaleInitialized( false ) - , m_sResFilePrefix( _rResFilePrefix ) - , m_aLanguage( rLanguage ) - { - } - - /** retrieves our resource manager - */ - const std::locale& getResLocale(); - }; - - const std::locale& OComponentResModuleImpl::getResLocale() - { - if (!m_bLocaleInitialized) - { - m_aLocale = Translate::Create(m_sResFilePrefix.getStr(), m_aLanguage); - m_bLocaleInitialized = true; - } - return m_aLocale; - } - - //= OComponentResourceModule - OComponentResourceModule::OComponentResourceModule(const OString& _rResFilePrefix, const LanguageTag& rLanguage) - :BaseClass() - ,m_pImpl( new OComponentResModuleImpl( _rResFilePrefix, rLanguage ) ) - { - } - - OComponentResourceModule::~OComponentResourceModule() - { - } - - const std::locale& OComponentResourceModule::getResLocale() - { - ::osl::MutexGuard aGuard( m_aMutex ); - return m_pImpl->getResLocale(); - } - -} // namespace utl - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx index 9445fc4b0fa0..755d82171edc 100644 --- a/uui/source/alreadyopen.cxx +++ b/uui/source/alreadyopen.cxx @@ -19,7 +19,7 @@ #include "strings.hrc" #include "alreadyopen.hxx" -#include +#include AlreadyOpenQueryBox::AlreadyOpenQueryBox( vcl::Window* pParent, const std::locale& rLocale, const OUString& aMessage, bool bIsStoring ) : MessBox(pParent, 0, diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx index 7fefdba84f08..97c98d216438 100644 --- a/uui/source/filechanged.cxx +++ b/uui/source/filechanged.cxx @@ -18,7 +18,7 @@ */ #include "strings.hrc" -#include +#include #include "filechanged.hxx" FileChangedQueryBox::FileChangedQueryBox( vcl::Window* pParent, const std::locale& rLocale ) : diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index bf1392e90f0f..a45cae432d1b 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include #include @@ -101,7 +101,7 @@ executeLoginDialog( if (bSavePassword) { - std::locale aLocale(Translate::Create("uui", Application::GetSettings().GetUILanguageTag())); + std::locale aLocale(Translate::Create("uui")); xDialog->SetSavePasswordText( Translate::get(rInfo.GetIsRememberPersistent() ? RID_SAVE_PASSWORD @@ -414,7 +414,7 @@ executeMasterPasswordDialog( { SolarMutexGuard aGuard; - std::locale aResLocale(Translate::Create("uui", Application::GetSettings().GetUILanguageTag())); + std::locale aResLocale(Translate::Create("uui")); if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) { ScopedVclPtrInstance< MasterPasswordCreateDialog > xDialog( @@ -512,7 +512,7 @@ executePasswordDialog( { SolarMutexGuard aGuard; - std::locale aResLocale(Translate::Create("uui", Application::GetSettings().GetUILanguageTag())); + std::locale aResLocale(Translate::Create("uui")); if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) { if (bIsSimplePasswordRequest) diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 5818b24220eb..260ad0b9aa01 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "ids.hxx" #include "ids.hrc" @@ -167,7 +167,7 @@ UUIInteractionHelper::handleErrorHandlerRequest( SOURCE_SVX : SOURCE_UUI; - std::locale aResLocale = Translate::Create(aManager[eSource], Application::GetSettings().GetUILanguageTag()); + std::locale aResLocale = Translate::Create(aManager[eSource]); ErrorResource aErrorResource(aId[eSource], aResLocale); if (!aErrorResource.getString(nErrorCode, aMessage)) return; diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx index 927351727129..1ea6cf3e9de4 100644 --- a/uui/source/iahndl-locking.cxx +++ b/uui/source/iahndl-locking.cxx @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -74,7 +74,7 @@ handleLockedDocumentRequest_( try { SolarMutexGuard aGuard; - std::locale aResLocale = Translate::Create("uui", Application::GetSettings().GetUILanguageTag()); + std::locale aResLocale = Translate::Create("uui"); OUString aMessage; std::vector< OUString > aArguments; @@ -153,7 +153,7 @@ handleChangedByOthersRequest_( try { SolarMutexGuard aGuard; - std::locale aResLocale = Translate::Create("uui", Application::GetSettings().GetUILanguageTag()); + std::locale aResLocale = Translate::Create("uui"); ScopedVclPtrInstance< FileChangedQueryBox > xDialog(pParent, aResLocale); sal_Int32 nResult = xDialog->Execute(); @@ -189,7 +189,7 @@ handleLockFileProblemRequest_( try { SolarMutexGuard aGuard; - std::locale aResLocale = Translate::Create("uui", Application::GetSettings().GetUILanguageTag()); + std::locale aResLocale = Translate::Create("uui"); sal_Int32 nResult; diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index c835cdeb1f04..e27efb9ff10f 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include @@ -155,7 +155,7 @@ executeUnknownAuthDialog( std::vector< OUString > aArguments; aArguments.push_back( getContentPart( rXCert->getSubjectName()) ); - std::locale aResLocale(Translate::Create("uui", Application::GetSettings().GetUILanguageTag())); + std::locale aResLocale(Translate::Create("uui")); ErrorResource aErrorResource(RID_UUI_ERRHDL, aResLocale); if (aErrorResource.getString(ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED, aMessage)) @@ -213,7 +213,7 @@ executeSSLWarnDialog( break; } - std::locale aResLocale(Translate::Create("uui", Application::GetSettings().GetUILanguageTag())); + std::locale aResLocale(Translate::Create("uui")); ErrorResource aErrorResource(RID_UUI_ERRHDL, aResLocale); if (aErrorResource.getString( diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index b397d52b7a97..5b4447bd83f2 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -61,7 +61,7 @@ #include #include -#include +#include #include #include #include @@ -998,7 +998,7 @@ NameClashResolveDialogResult executeSimpleNameClashResolveDialog( vcl::Window *p OUString & rProposedNewName, bool bAllowOverwrite ) { - std::locale aResLocale = Translate::Create("uui", Application::GetSettings().GetUILanguageTag()); + std::locale aResLocale = Translate::Create("uui"); ScopedVclPtrInstance aDialog(pParent, aResLocale, rTargetFolderURL, rClashingName, rProposedNewName, bAllowOverwrite); @@ -1100,7 +1100,7 @@ UUIInteractionHelper::handleGenericErrorRequest( OUString aErrorString; ErrorHandler::GetErrorString( nErrorCode, aErrorString ); - std::locale aResLocale = Translate::Create("uui", Application::GetSettings().GetUILanguageTag()); + std::locale aResLocale = Translate::Create("uui"); OUString aTitle( utl::ConfigManager::getProductName() ); OUString aErrTitle = Translate::get(STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE, aResLocale); @@ -1194,7 +1194,7 @@ UUIInteractionHelper::handleBrokenPackageRequest( OUString aMessage; { - std::locale aResLocale = Translate::Create("uui", Application::GetSettings().GetUILanguageTag()); + std::locale aResLocale = Translate::Create("uui"); ErrorResource aErrorResource(RID_UUI_ERRHDL, aResLocale); if (!aErrorResource.getString(nErrorCode, aMessage)) return; diff --git a/uui/source/lockcorrupt.cxx b/uui/source/lockcorrupt.cxx index 9230dc80e890..a101a6794332 100644 --- a/uui/source/lockcorrupt.cxx +++ b/uui/source/lockcorrupt.cxx @@ -20,7 +20,7 @@ #include "ids.hxx" #include "strings.hrc" #include "lockcorrupt.hxx" -#include +#include #include LockCorruptQueryBox::LockCorruptQueryBox(vcl::Window* pParent, const std::locale& rResLocale) diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx index 4b829e9af568..e5d00b9a01a6 100644 --- a/uui/source/lockfailed.cxx +++ b/uui/source/lockfailed.cxx @@ -19,7 +19,7 @@ #include "strings.hrc" #include "lockfailed.hxx" -#include +#include #include LockFailedQueryBox::LockFailedQueryBox(vcl::Window* pParent, const std::locale& rResLocale) diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx index 58e6a736a316..37e5c2a53116 100644 --- a/uui/source/masterpasscrtdlg.cxx +++ b/uui/source/masterpasscrtdlg.cxx @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include "strings.hrc" #include "masterpasscrtdlg.hxx" diff --git a/uui/source/masterpassworddlg.cxx b/uui/source/masterpassworddlg.cxx index 3afe239cd039..2ee6308c6cbc 100644 --- a/uui/source/masterpassworddlg.cxx +++ b/uui/source/masterpassworddlg.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include #include "strings.hrc" #include "masterpassworddlg.hxx" diff --git a/uui/source/nameclashdlg.cxx b/uui/source/nameclashdlg.cxx index 2d5f1f0ed24b..a2b8164a8eab 100644 --- a/uui/source/nameclashdlg.cxx +++ b/uui/source/nameclashdlg.cxx @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include "strings.hrc" diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx index 1808a405995d..cae6baa2b0c0 100644 --- a/uui/source/openlocked.cxx +++ b/uui/source/openlocked.cxx @@ -19,7 +19,7 @@ #include "strings.hrc" #include "openlocked.hxx" -#include +#include OpenLockedQueryBox::OpenLockedQueryBox( vcl::Window* pParent, const std::locale& rResLocale, const OUString& aMessage ) : MessBox(pParent, 0, diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx index aa1fd0e53cb5..c4edd844b0d5 100644 --- a/uui/source/passworddlg.cxx +++ b/uui/source/passworddlg.cxx @@ -20,7 +20,7 @@ #include "passworddlg.hxx" #include "strings.hrc" -#include +#include #include #include diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx index de5ca390580d..a7eb623d1fc4 100644 --- a/uui/source/trylater.cxx +++ b/uui/source/trylater.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include +#include #include "strings.hrc" #include "trylater.hxx" diff --git a/vbahelper/inc/pch/precompiled_msforms.hxx b/vbahelper/inc/pch/precompiled_msforms.hxx index ec5ebf2e2085..9ded5c254641 100644 --- a/vbahelper/inc/pch/precompiled_msforms.hxx +++ b/vbahelper/inc/pch/precompiled_msforms.hxx @@ -321,7 +321,6 @@ #include #include #include -#include #include #include #include @@ -343,6 +342,7 @@ #include #include #include +#include #include #include #include diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 9c1e119ded7a..57d536a5c90c 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -166,7 +166,7 @@ const std::locale& ImplGetResLocale() ImplSVData* pSVData = ImplGetSVData(); if (!pSVData->mbResLocaleSet) { - pSVData->maResLocale = Translate::Create("vcl", Application::GetSettings().GetUILanguageTag()); + pSVData->maResLocale = Translate::Create("vcl"); pSVData->mbResLocaleSet = true; } return pSVData->maResLocale; diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 58a5260d4e6b..61f589aaf93a 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index 39a7d2fb1a3e..554f16850c2c 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -21,7 +21,7 @@ #include -#include +#include #include #include diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 23070eb10622..5fea84fed4e2 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index b72d10882e22..31da4bbff58c 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx index 2a81e8a59f02..76400558fe27 100644 --- a/vcl/source/image/Image.cxx +++ b/vcl/source/image/Image.cxx @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 5a7faafb87a9..ac84840c29cf 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -2078,7 +2078,7 @@ void VclBuilder::handleChild(vcl::Window *pParent, xmlreader::XmlReader &reader) { name = reader.getAttributeValue(false); sType = OString(name.begin, name.length); - m_pParserState->m_aResLocale = Translate::Create(sType.getStr(), Application::GetSettings().GetUILanguageTag()); + m_pParserState->m_aResLocale = Translate::Create(sType.getStr()); } } ++nLevel; diff --git a/vcl/unx/gtk/fpicker/resourceprovider.cxx b/vcl/unx/gtk/fpicker/resourceprovider.cxx index 349247c9235a..152395d61463 100644 --- a/vcl/unx/gtk/fpicker/resourceprovider.cxx +++ b/vcl/unx/gtk/fpicker/resourceprovider.cxx @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include diff --git a/writerfilter/source/dmapper/GraphicHelpers.cxx b/writerfilter/source/dmapper/GraphicHelpers.cxx index 0ba0b03dcb8f..62579dbaa864 100644 --- a/writerfilter/source/dmapper/GraphicHelpers.cxx +++ b/writerfilter/source/dmapper/GraphicHelpers.cxx @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 165299318016..119e6271d336 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -33,7 +33,7 @@ #include "OOXMLFastDocumentHandler.hxx" #include "OOXMLPropertySet.hxx" -#include +#include #include #include #include diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx index f1d28a85e305..2c06c816e47f 100644 --- a/writerfilter/source/rtftok/rtftokenizer.cxx +++ b/writerfilter/source/rtftok/rtftokenizer.cxx @@ -8,7 +8,7 @@ */ #include -#include +#include #include #include #include diff --git a/writerperfect/inc/WPFTResMgr.hxx b/writerperfect/inc/WPFTResMgr.hxx index 4b7bbf3e2a19..17bfc872731a 100644 --- a/writerperfect/inc/WPFTResMgr.hxx +++ b/writerperfect/inc/WPFTResMgr.hxx @@ -5,7 +5,7 @@ #include "writerperfectdllapi.h" -#include +#include struct WRITERPERFECT_DLLPUBLIC WPFTResLocale { diff --git a/writerperfect/source/common/WPFTResMgr.cxx b/writerperfect/source/common/WPFTResMgr.cxx index c207d25ffca9..f61c470d8e17 100644 --- a/writerperfect/source/common/WPFTResMgr.cxx +++ b/writerperfect/source/common/WPFTResMgr.cxx @@ -2,12 +2,9 @@ #include "WPFTResMgr.hxx" -#include -#include - std::locale &WPFTResLocale::GetResLocale() { - static std::locale loc(Translate::Create("wpt", Application::GetSettings().GetUILanguageTag())); + static std::locale loc(Translate::Create("wpt")); return loc; } diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx index 3bfbe07dabc5..c234e5c2fd85 100644 --- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx @@ -277,7 +277,6 @@ #include #include #include -#include #include #include #include @@ -298,6 +297,7 @@ #include #include #include +#include #include #include diff --git a/xmlsecurity/inc/resourcemanager.hxx b/xmlsecurity/inc/resourcemanager.hxx index cba9e7061f98..3516bcfa0db4 100644 --- a/xmlsecurity/inc/resourcemanager.hxx +++ b/xmlsecurity/inc/resourcemanager.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_XMLSECURITY_SOURCE_DIALOGS_RESOURCEMANAGER_HXX #define INCLUDED_XMLSECURITY_SOURCE_DIALOGS_RESOURCEMANAGER_HXX -#include +#include #include #include #include diff --git a/xmlsecurity/source/dialogs/resourcemanager.cxx b/xmlsecurity/source/dialogs/resourcemanager.cxx index 9296c02a89d4..4df58e9868d1 100644 --- a/xmlsecurity/source/dialogs/resourcemanager.cxx +++ b/xmlsecurity/source/dialogs/resourcemanager.cxx @@ -34,7 +34,7 @@ namespace XmlSec { const std::locale& GetResLocale() { - static const std::locale loc = Translate::Create("xsc", Application::GetSettings().GetUILanguageTag()); + static const std::locale loc = Translate::Create("xsc"); return loc; } -- cgit v1.2.3