diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-08-01 13:50:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-08-02 10:36:07 +0200 |
commit | 13fac4894f752e922727c6f22c6303712e06ba12 (patch) | |
tree | 5689829e917927bb13461d91988ec99e461f1831 /include/svtools | |
parent | 13cadf3fe38daa0b4cfddcfa68ec8631bc85f44a (diff) |
normalize resource locale ctor construction mechanisms
make them all the same and share std::locales more
various OModuleClient, etc, classes go away
Change-Id: I7e3ff01a69332eeacd22e3078f66a60318de62d5
Reviewed-on: https://gerrit.libreoffice.org/40634
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/svtools')
-rw-r--r-- | include/svtools/ehdl.hxx | 13 | ||||
-rw-r--r-- | include/svtools/svtresid.hxx | 10 |
2 files changed, 9 insertions, 14 deletions
diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx index b858f2b31d37..102bf115d4ab 100644 --- a/include/svtools/ehdl.hxx +++ b/include/svtools/ehdl.hxx @@ -22,7 +22,7 @@ #include <memory> #include <svtools/svtdllapi.h> - +#include <svtools/svtresid.hxx> #include <vcl/errinf.hxx> typedef std::pair<const char*, ErrCode> ErrMsgCode; @@ -36,23 +36,23 @@ class SVT_DLLPUBLIC SfxErrorContext : private ErrorContext public: SfxErrorContext( sal_uInt16 nCtxIdP, vcl::Window *pWin=nullptr, - const ErrMsgCode* pIds = nullptr, const std::locale* pResLocaleP = nullptr); + const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale()); SfxErrorContext( sal_uInt16 nCtxIdP, const OUString &aArg1, vcl::Window *pWin=nullptr, - const ErrMsgCode* pIds = nullptr, const std::locale* pResLocaleP = nullptr); + const ErrMsgCode* pIds = nullptr, const std::locale& rResLocaleP = SvtResLocale()); bool GetString(ErrCode nErrId, OUString &rStr) override; private: sal_uInt16 nCtxId; const ErrMsgCode* pIds; - const std::locale *pResLocale; + const std::locale& rResLocale; OUString aArg1; }; class SVT_DLLPUBLIC SfxErrorHandler : private ErrorHandler { public: - SfxErrorHandler(const ErrMsgCode* pIds, ErrCode lStart, ErrCode lEnd, const std::locale* pResLocale = nullptr); + SfxErrorHandler(const ErrMsgCode* pIds, ErrCode lStart, ErrCode lEnd, const std::locale& rResLocale = SvtResLocale()); virtual ~SfxErrorHandler() override; protected: @@ -63,8 +63,7 @@ private: ErrCode lStart; ErrCode lEnd; const ErrMsgCode* pIds; - const std::locale* pResLocale; - std::unique_ptr<std::locale> xFreeLocale; + const std::locale& rResLocale; SVT_DLLPRIVATE static void GetClassString(sal_uLong lErrId, OUString &); virtual bool CreateString(const ErrorInfo *, OUString &) const override; diff --git a/include/svtools/svtresid.hxx b/include/svtools/svtresid.hxx index 8f6cfc8b43f0..cae5861a4df9 100644 --- a/include/svtools/svtresid.hxx +++ b/include/svtools/svtresid.hxx @@ -21,14 +21,10 @@ #define INCLUDED_SVTOOLS_SVTRESID_HXX #include <svtools/svtdllapi.h> -#include <com/sun/star/lang/Locale.hpp> - -struct SVT_DLLPUBLIC SvtResLocale -{ - static std::locale* GetResLocale(); - static void DeleteResLocale(); -}; +#include <rtl/ustring.hxx> +#include <locale> +SVT_DLLPUBLIC const std::locale& SvtResLocale(); SVT_DLLPUBLIC OUString SvtResId(const char* pId); #endif // INCLUDED_SVTOOLS_SVTRESID_HXX |