Kaydet (Commit) b1d829e5 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst f4e5940a
......@@ -316,7 +316,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/toolsdllapi.h>
......@@ -331,6 +330,7 @@
#include <unotools/accessiblestatesethelper.hxx>
#include <unotools/fontdefs.hxx>
#include <unotools/options.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/unotoolsdllapi.h>
#include <extended/AccessibleBrowseBox.hxx>
#include <extended/AccessibleBrowseBoxBase.hxx>
......
......@@ -18,10 +18,7 @@
*/
#include <helper/accresmgr.hxx>
#include <tools/resmgr.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <unotools/resmgr.hxx>
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)
{
......
......@@ -17,17 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <tools/resmgr.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <unotools/resmgr.hxx>
#include <mediamisc.hxx>
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;
}
......
......@@ -21,7 +21,7 @@
#define INCLUDED_AVMEDIA_SOURCE_INC_MEDIAMISC_HXX
#include <config_features.h>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#define AVMEDIA_MANAGER_SERVICE_PREFERRED "com.sun.star.comp.avmedia.Manager_VLC"
#ifdef _WIN32
......
......@@ -543,7 +543,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/svborder.hxx>
......@@ -565,6 +564,7 @@
#include <unotools/fontdefs.hxx>
#include <unotools/options.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/unotoolsdllapi.h>
#include <xmlscript/xmldlg_imexp.hxx>
......
......@@ -33,7 +33,7 @@
#include <svx/svxids.hrc>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/script/XLibraryContainerPassword.hpp>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <o3tl/make_unique.hxx>
......@@ -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<Module>(loc, &rFactory);
SfxModule* pMod = pModule.get();
......
......@@ -26,7 +26,7 @@
#include <basic/sbstar.hxx>
#include <basic/basrdll.hxx>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include "strings.hrc"
#include <sbxbase.hxx>
......@@ -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)
{ }
};
......
......@@ -20,7 +20,7 @@
#include <config_features.h>
#include <vcl/errcode.hxx>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <basic/sbx.hxx>
#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;
}
......
......@@ -496,7 +496,6 @@
#include <tools/multisel.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/time.hxx>
......@@ -520,6 +519,7 @@
#include <unotools/nativenumberwrapper.hxx>
#include <unotools/options.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <unotools/unotoolsdllapi.h>
......
......@@ -19,7 +19,7 @@
#include "ResId.hxx"
#include "ResourceManager.hxx"
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
namespace chart
{
......
......@@ -18,16 +18,14 @@
*/
#include "ResourceManager.hxx"
#include <tools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <unotools/resmgr.hxx>
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;
}
......
......@@ -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
......
......@@ -26,9 +26,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/ustrbuf.hxx>
#include <tools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <unotools/resmgr.hxx>
#include <osl/diagnose.h>
#include <strings.hrc>
......@@ -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;
}
......
......@@ -23,10 +23,8 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <tools/diagnose_ex.h>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <osl/diagnose.h>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
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"))
{
}
......
......@@ -194,7 +194,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/toolsdllapi.h>
......@@ -209,6 +208,7 @@
#include <unotools/fontdefs.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/unotoolsdllapi.h>
#include <cppcanvas/color.hxx>
......
......@@ -457,7 +457,6 @@
#include <tools/multisel.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/time.hxx>
......@@ -481,6 +480,7 @@
#include <unotools/options.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/unotoolsdllapi.h>
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -18,22 +18,12 @@
*/
#include <dialmgr.hxx>
#include <tools/resmgr.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
namespace
{
const std::locale& GetResLocale()
{
static std::locale loc(Translate::Create("cui", Application::GetSettings().GetUILanguageTag()));
return loc;
}
}
#include <unotools/resmgr.hxx>
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: */
......@@ -276,7 +276,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/toolsdllapi.h>
......@@ -292,6 +291,7 @@
#include <unotools/localedatawrapper.hxx>
#include <unotools/options.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/saveopt.hxx>
#include <unotools/sharedunocomponent.hxx>
#include <unotools/syslocale.hxx>
......
......@@ -202,7 +202,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/toolsdllapi.h>
......@@ -217,6 +216,7 @@
#include <unotools/fontdefs.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/unotoolsdllapi.h>
......
......@@ -19,11 +19,9 @@
#include "core_resource.hxx"
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
// ---- needed as long as we have no contexts for components ---
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <rtl/instance.hxx>
#include <svl/solar.hrc>
......@@ -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)
......
......@@ -25,8 +25,8 @@
#include <sal/log.hxx>
#include <vcl/svapp.hxx>
#include <vcl/timer.hxx>
#include <tools/resmgr.hxx>
#include <unotools/bootstrap.hxx>
#include <unotools/resmgr.hxx>
#include <com/sun/star/frame/XDesktop2.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/uno/Reference.h>
......
......@@ -22,16 +22,14 @@
#include <osl/diagnose.h>
#include <rtl/instance.hxx>
#include <tools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <unotools/resmgr.hxx>
namespace dp {
struct DeploymentLocale :
public ::rtl::StaticWithInit<std::locale, DeploymentLocale > {
std::locale operator () () {
return Translate::Create("dkt", Application::GetSettings().GetUILanguageTag());
return Translate::Create("dkt");
}
};
......
......@@ -246,7 +246,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/toolsdllapi.h>
......@@ -262,6 +261,7 @@
#include <unotools/localedatawrapper.hxx>
#include <unotools/options.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/syslocale.hxx>
#include <unotools/unotoolsdllapi.h>
......
......@@ -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);
}
};
......
......@@ -22,7 +22,7 @@
#include "dp_resource.h"
#include <osl/module.hxx>
#include <osl/mutex.hxx>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <rtl/ustring.h>
#include <unotools/configmgr.hxx>
#include <i18nlangtag/languagetag.hxx>
......
......@@ -68,7 +68,7 @@
#include <svx/svxids.hrc>
#include <svx/ucsubset.hxx>
#include <vcl/svapp.hxx>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <tools/fract.hxx>
#include <svtools/ctrltool.hxx>
#include <vcl/fontcharmap.hxx>
......
......@@ -22,7 +22,7 @@
#include "dp_shared.hxx"
#include "unopkg_shared.h"
#include <osl/thread.h>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <comphelper/anytostring.hxx>
......
......@@ -23,7 +23,7 @@
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/deployment/XPackage.hpp>
#include <osl/diagnose.h>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <rtl/ustring.hxx>
#include <unotools/configmgr.hxx>
#include <i18nlangtag/languagetag.hxx>
......
......@@ -273,7 +273,6 @@
#include <tools/mapunit.hxx>
#include <tools/poly.hxx>
#include <tools/ref.hxx>
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
#include <tools/tenccvt.hxx>
......@@ -290,6 +289,7 @@
#include <unotools/localedatawrapper.hxx>
#include <unotools/options.hxx>
#include <unotools/readwritemutexguard.hxx>
#include <unotools/resmgr.hxx>
#include <unotools/saveopt.hxx>
#include <unotools/unotoolsdllapi.h>
#include <xmloff/dllapi.h>
......
......@@ -18,7 +18,7 @@
*/
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/dialog.hxx>
#include <vcl/msgbox.hxx>
......@@ -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<VirtualDevice>::Create())
{
......
......@@ -66,7 +66,7 @@
#include <rtl/process.h>
#include <vcl/svapp.hxx>
#include <svtools/embedhlp.hxx>
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <sfx2/strings.hrc>
......@@ -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();
......
......@@ -23,7 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,extensions_test_update, \
sal \
salhelper \
test \
tl \
utl \
unotest \
vcl \
))
......
......@@ -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 \
......
......@@ -23,7 +23,7 @@ $(eval $(call gb_Library_use_libraries,updchk,\
cppu \
sal \
salhelper \
tl \
utl \
vcl \
))
......
......@@ -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;
......
......@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <svl/urihelper.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
......@@ -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"))
{
}
......
......@@ -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)
......
......@@ -19,7 +19,7 @@
#include <memory>
#include "componentmodule.hxx"
#include <tools/resmgr.hxx>
#include <unotools/resmgr.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
#include <svl/solar.hrc>
......@@ -27,89 +27,22 @@
#include <tools/debug.hxx>
#include <rtl/strbuf.hxx>
#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 <type>OModule</type>. 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);