diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-19 13:18:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-05 09:39:11 +0200 |
commit | 14cfff500e93f0d6cbf8412065feea85c01ea81d (patch) | |
tree | 76e3fb8fbf2b0d8a12c8406d8cf994ea6a37aaff /reportdesign/inc | |
parent | d924ce30e0ca260682bd2aed192b8b1b2ca3e7c0 (diff) |
Pass context and resource string down to boost::locale separately
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.
Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign/inc')
-rw-r--r-- | reportdesign/inc/UndoActions.hxx | 8 | ||||
-rw-r--r-- | reportdesign/inc/core_resource.hxx | 4 | ||||
-rw-r--r-- | reportdesign/inc/stringarray.hrc | 34 | ||||
-rw-r--r-- | reportdesign/inc/strings.hrc | 2 |
4 files changed, 24 insertions, 24 deletions
diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx index 1764f27ffb33..7b1fb2005380 100644 --- a/reportdesign/inc/UndoActions.hxx +++ b/reportdesign/inc/UndoActions.hxx @@ -141,7 +141,7 @@ namespace rptui ::dbaui::IController* m_pController; public: - OCommentUndoAction(SdrModel& rMod, const char* pCommentID); + OCommentUndoAction(SdrModel& rMod, TranslateId pCommentID); virtual ~OCommentUndoAction() override; virtual OUString GetComment() const override { return m_strComment; } @@ -169,7 +169,7 @@ namespace rptui ,Action _eAction ,const css::uno::Reference< css::container::XIndexContainer >& rContainer ,const css::uno::Reference< css::uno::XInterface>& xElem - ,const char* pCommentId); + ,TranslateId pCommentId); virtual ~OUndoContainerAction() override; virtual void Undo() override; @@ -193,7 +193,7 @@ namespace rptui ,::std::function<css::uno::Reference< css::report::XSection >(OReportHelper *)> _pMemberFunction ,const css::uno::Reference< css::report::XReportDefinition >& _xReport ,const css::uno::Reference< css::uno::XInterface>& xElem - ,const char* pCommentId); + ,TranslateId pCommentId); private: virtual void implReInsert( ) override; @@ -212,7 +212,7 @@ namespace rptui ,::std::function<css::uno::Reference< css::report::XSection >(OGroupHelper *)> _pMemberFunction ,const css::uno::Reference< css::report::XGroup >& _xGroup ,const css::uno::Reference< css::uno::XInterface>& xElem - ,const char* pCommentId); + ,TranslateId pCommentId); private: virtual void implReInsert( ) override; diff --git a/reportdesign/inc/core_resource.hxx b/reportdesign/inc/core_resource.hxx index f5d6bfb6e1a7..4c298216d1b9 100644 --- a/reportdesign/inc/core_resource.hxx +++ b/reportdesign/inc/core_resource.hxx @@ -22,9 +22,9 @@ #include "dllapi.h" #include <rtl/ustring.hxx> -#include <string_view> +#include <unotools/resmgr.hxx> -OUString REPORTDESIGN_DLLPUBLIC RptResId(std::string_view pId); +OUString REPORTDESIGN_DLLPUBLIC RptResId(TranslateId pId); #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_CORE_RESOURCE_HXX diff --git a/reportdesign/inc/stringarray.hrc b/reportdesign/inc/stringarray.hrc index b49f401d0f54..99bdc9a296c5 100644 --- a/reportdesign/inc/stringarray.hrc +++ b/reportdesign/inc/stringarray.hrc @@ -10,72 +10,72 @@ #ifndef INCLUDED_REPORTDESIGN_INC_FNP_HRC #define INCLUDED_REPORTDESIGN_INC_FNP_HRC -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) -const char* RID_STR_FORCENEWPAGE_CONST[] = +const TranslateId RID_STR_FORCENEWPAGE_CONST[] = { NC_("RID_STR_FORCENEWPAGE_CONST", "None"), NC_("RID_STR_FORCENEWPAGE_CONST", "Before Section"), NC_("RID_STR_FORCENEWPAGE_CONST", "After Section"), NC_("RID_STR_FORCENEWPAGE_CONST", "Before & After Section"), - nullptr + {} }; -const char* RID_STR_GROUPKEEPTOGETHER_CONST[] = +const TranslateId RID_STR_GROUPKEEPTOGETHER_CONST[] = { NC_("RID_STR_GROUPKEEPTOGETHER_CONST", "Per Page"), NC_("RID_STR_GROUPKEEPTOGETHER_CONST", "Per Column"), - nullptr + {} }; -const char* RID_STR_REPORTPRINTOPTION_CONST[] = +const TranslateId RID_STR_REPORTPRINTOPTION_CONST[] = { NC_("RID_STR_REPORTPRINTOPTION_CONST", "All Pages"), NC_("RID_STR_REPORTPRINTOPTION_CONST", "Not With Report Header"), NC_("RID_STR_REPORTPRINTOPTION_CONST", "Not With Report Footer"), NC_("RID_STR_REPORTPRINTOPTION_CONST", "Not With Report Header/Footer"), - nullptr + {} }; -const char* RID_STR_TYPE_CONST[] = +const TranslateId RID_STR_TYPE_CONST[] = { NC_("RID_STR_TYPE_CONST", "Field or Formula"), NC_("RID_STR_TYPE_CONST", "Function"), NC_("RID_STR_TYPE_CONST", "Counter"), NC_("RID_STR_TYPE_CONST", "User defined Function"), - nullptr + {} }; -const char* RID_STR_BOOL[] = +const TranslateId RID_STR_BOOL[] = { NC_("RID_STR_BOOL", "No"), NC_("RID_STR_BOOL", "Yes"), - nullptr + {} }; -const char* RID_STR_KEEPTOGETHER_CONST[] = +const TranslateId RID_STR_KEEPTOGETHER_CONST[] = { NC_("RID_STR_KEEPTOGETHER_CONST", "No"), NC_("RID_STR_KEEPTOGETHER_CONST", "Whole Group"), NC_("RID_STR_KEEPTOGETHER_CONST", "With First Detail"), - nullptr + {} }; -const char* RID_STR_VERTICAL_ALIGN_CONST[] = +const TranslateId RID_STR_VERTICAL_ALIGN_CONST[] = { NC_("RID_STR_VERTICAL_ALIGN_CONST", "Top"), NC_("RID_STR_VERTICAL_ALIGN_CONST", "Middle"), NC_("RID_STR_VERTICAL_ALIGN_CONST", "Bottom"), - nullptr + {} }; -const char* RID_STR_PARAADJUST_CONST[] = +const TranslateId RID_STR_PARAADJUST_CONST[] = { NC_("RID_STR_PARAADJUST_CONST", "Left"), NC_("RID_STR_PARAADJUST_CONST", "Right"), NC_("RID_STR_PARAADJUST_CONST", "Block"), NC_("RID_STR_PARAADJUST_CONST", "Center"), - nullptr + {} }; #endif diff --git a/reportdesign/inc/strings.hrc b/reportdesign/inc/strings.hrc index 87eae041d6e4..0a2ca496a9d5 100644 --- a/reportdesign/inc/strings.hrc +++ b/reportdesign/inc/strings.hrc @@ -20,7 +20,7 @@ #ifndef INCLUDED_REPORTDESIGN_INC_STRINGS_HRC #define INCLUDED_REPORTDESIGN_INC_STRINGS_HRC -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) #define RID_STR_PROPPAGE_DEFAULT NC_("RID_STR_PROPPAGE_DEFAULT", "General") #define RID_STR_PROPPAGE_DATA NC_("RID_STR_PROPPAGE_DATA", "Data") |