diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-23 13:44:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-23 21:11:32 +0200 |
commit | 4bb2bca091ffa0cc8a5f4a850eef146bb66feaa0 (patch) | |
tree | e5cbebaf295f857d73ac73a1d3ea9f542961b898 /extensions | |
parent | 3c077e587d36170be53bad90bd5c87364295426c (diff) |
remove now unnecessary comphelper::OModuleClient stuff
after the great gettext migration of 2017
Change-Id: I704389b1ae1fb34dae0429c98cbfc89c2d3b8e27
Reviewed-on: https://gerrit.libreoffice.org/40322
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/MasterDetailLinkDialog.hxx | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/browserlistbox.hxx | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/controlfontdialog.hxx | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/formbrowsertools.cxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/formmetadata.cxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/formmetadata.hxx | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/modulepcr.cxx | 28 | ||||
-rw-r--r-- | extensions/source/propctrlr/modulepcr.hxx | 23 | ||||
-rw-r--r-- | extensions/source/propctrlr/pcrunodialogs.hxx | 1 | ||||
-rw-r--r-- | extensions/source/propctrlr/propertyhandler.hxx | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/selectlabeldialog.hxx | 1 |
11 files changed, 48 insertions, 18 deletions
diff --git a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx index 62422e21e873..88f1ab689957 100644 --- a/extensions/source/propctrlr/MasterDetailLinkDialog.hxx +++ b/extensions/source/propctrlr/MasterDetailLinkDialog.hxx @@ -31,7 +31,6 @@ namespace pcr class MasterDetailLinkDialog : public MasterDetailLinkDialog_DBase ,public MasterDetailLinkDialog_PBase - ,public PcrClient { public: explicit MasterDetailLinkDialog(const css::uno::Reference< css::uno::XComponentContext >& _rxContext); diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index edd715033523..dfdbefaa4e90 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -74,7 +74,6 @@ namespace pcr class OBrowserListBox :public Control ,public IButtonClickListener - ,public PcrClient { protected: VclPtr<Window> m_aLinesPlayground; diff --git a/extensions/source/propctrlr/controlfontdialog.hxx b/extensions/source/propctrlr/controlfontdialog.hxx index bbf1ffcc1818..2b94c58d8c8c 100644 --- a/extensions/source/propctrlr/controlfontdialog.hxx +++ b/extensions/source/propctrlr/controlfontdialog.hxx @@ -37,7 +37,6 @@ namespace pcr class OControlFontDialog :public OControlFontDialog_DBase ,public OControlFontDialog_PBase - ,public PcrClient { protected: // <properties> diff --git a/extensions/source/propctrlr/formbrowsertools.cxx b/extensions/source/propctrlr/formbrowsertools.cxx index c7801df339ff..fe64952d7df6 100644 --- a/extensions/source/propctrlr/formbrowsertools.cxx +++ b/extensions/source/propctrlr/formbrowsertools.cxx @@ -39,9 +39,6 @@ namespace pcr OUString GetUIHeadlineName(sal_Int16 nClassId, const Any& aUnoObj) { - PcrClient aResourceAccess; - // this ensures that we have our resource file loaded - OUString sClassName; switch (nClassId) { diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index 334c4cbc8292..11e91e716a7c 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -103,9 +103,6 @@ namespace pcr if ( s_pPropertyInfos ) return s_pPropertyInfos; - PcrClient aResourceAccess; - // this ensures that we have our resource file loaded - static OPropertyInfoImpl aPropertyInfos[] = { /* diff --git a/extensions/source/propctrlr/formmetadata.hxx b/extensions/source/propctrlr/formmetadata.hxx index 27e289692efe..7e5e750ba027 100644 --- a/extensions/source/propctrlr/formmetadata.hxx +++ b/extensions/source/propctrlr/formmetadata.hxx @@ -36,7 +36,6 @@ namespace pcr class OPropertyInfoService :public IPropertyInfoService - ,public PcrClient { protected: static sal_uInt16 s_nCount; diff --git a/extensions/source/propctrlr/modulepcr.cxx b/extensions/source/propctrlr/modulepcr.cxx index 87ec308dbe36..56931b21bc14 100644 --- a/extensions/source/propctrlr/modulepcr.cxx +++ b/extensions/source/propctrlr/modulepcr.cxx @@ -27,12 +27,36 @@ namespace pcr { - IMPLEMENT_MODULE( PcrModule, "pcr" ) + struct CreateModuleClass + { + PcrModule* operator()() + { + static PcrModule* pModule = new PcrModule; + return pModule; + /* yes, in theory, this is a resource leak, since the PcrModule + will never be cleaned up. However, using a non-heap instance of PcrModule + would not work: It would be cleaned up when the module is unloaded. + This might happen (and is likely to happen) *after* the tools-library + has been unloaded. However, the module's dtor is where we would delete + our resource manager (in case not all our clients de-registered) - which + would call into the already-unloaded tools-library. */ + } + }; + + PcrModule::PcrModule() + :BaseClass( OString( "pcr" ), Application::GetSettings().GetUILanguageTag() ) + { + } + + PcrModule& PcrModule::getInstance() + { + return *rtl_Instance< PcrModule, CreateModuleClass, ::osl::MutexGuard, ::osl::GetGlobalMutex >:: + create( CreateModuleClass(), ::osl::GetGlobalMutex() ); + } OUString PcrRes(const char* pId) { return Translate::get(pId, PcrModule::getInstance().getResLocale()); - } } // namespace pcr diff --git a/extensions/source/propctrlr/modulepcr.hxx b/extensions/source/propctrlr/modulepcr.hxx index 69665e075887..652ff0b93f8a 100644 --- a/extensions/source/propctrlr/modulepcr.hxx +++ b/extensions/source/propctrlr/modulepcr.hxx @@ -24,7 +24,28 @@ namespace pcr { - DEFINE_MODULE(PcrModule, PcrClient) + /* -------------------------------------------------------------------- */ + class PcrModule : public ::utl::OComponentResourceModule + { + friend struct CreateModuleClass; + typedef ::utl::OComponentResourceModule BaseClass; + public: + static PcrModule& getInstance(); + private: + PcrModule(); + }; + + /* -------------------------------------------------------------------- */ + template < class TYPE > + class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > + { + private: + typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; + public: + OAutoRegistration() : BaseClass( PcrModule::getInstance() ) + { + } + }; OUString PcrRes(const char* pId); } // namespace pcr diff --git a/extensions/source/propctrlr/pcrunodialogs.hxx b/extensions/source/propctrlr/pcrunodialogs.hxx index 98c6a1342b5c..fc3b1189bb3f 100644 --- a/extensions/source/propctrlr/pcrunodialogs.hxx +++ b/extensions/source/propctrlr/pcrunodialogs.hxx @@ -38,7 +38,6 @@ namespace pcr class OTabOrderDialog :public OTabOrderDialog_DBase ,public OTabOrderDialog_PBase - ,public PcrClient { protected: // <properties> diff --git a/extensions/source/propctrlr/propertyhandler.hxx b/extensions/source/propctrlr/propertyhandler.hxx index 88c1caecce8d..7711e6055af0 100644 --- a/extensions/source/propctrlr/propertyhandler.hxx +++ b/extensions/source/propctrlr/propertyhandler.hxx @@ -76,9 +76,6 @@ namespace pcr m_aSupportedProperties; mutable bool m_bSupportedPropertiesAreKnown; - /// helper which ensures that we can access resources as long as the instance lives - PcrClient m_aEnsureResAccess; - private: /// the property listener which has been registered PropertyChangeListeners m_aPropertyListeners; diff --git a/extensions/source/propctrlr/selectlabeldialog.hxx b/extensions/source/propctrlr/selectlabeldialog.hxx index 626a40ce816f..e31f86a88e60 100644 --- a/extensions/source/propctrlr/selectlabeldialog.hxx +++ b/extensions/source/propctrlr/selectlabeldialog.hxx @@ -37,7 +37,6 @@ namespace pcr class OSelectLabelDialog :public ModalDialog - ,public PcrClient { VclPtr<FixedText> m_pMainDesc; VclPtr<SvTreeListBox> m_pControlTree; |