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 /extensions | |
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 'extensions')
21 files changed, 64 insertions, 55 deletions
diff --git a/extensions/inc/command.hrc b/extensions/inc/command.hrc index 8ae09743b154..ca05f1c4e732 100644 --- a/extensions/inc/command.hrc +++ b/extensions/inc/command.hrc @@ -20,11 +20,13 @@ #ifndef INCLUDED_EXTENSIONS_INC_COMMAND_HRC #define INCLUDED_EXTENSIONS_INC_COMMAND_HRC -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) +#include <unotools/resmgr.hxx> + +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) namespace { -const char* RID_RSC_ENUM_COMMAND_TYPE[] = +const TranslateId RID_RSC_ENUM_COMMAND_TYPE[] = { NC_("RID_RSC_ENUM_COMMAND_TYPE", "Table"), NC_("RID_RSC_ENUM_COMMAND_TYPE", "Query"), diff --git a/extensions/inc/showhide.hrc b/extensions/inc/showhide.hrc index 0f7ec42ad346..5f96170a71f9 100644 --- a/extensions/inc/showhide.hrc +++ b/extensions/inc/showhide.hrc @@ -20,11 +20,11 @@ #ifndef INCLUDED_EXTENSIONS_INC_SHOWHIDE_HRC #define INCLUDED_EXTENSIONS_INC_SHOWHIDE_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)) namespace { -const char* RID_RSC_ENUM_SHOWHIDE[] = +const TranslateId RID_RSC_ENUM_SHOWHIDE[] = { NC_("RID_RSC_ENUM_SHOWHIDE", "Hide"), NC_("RID_RSC_ENUM_SHOWHIDE", "Show") diff --git a/extensions/inc/stringarrays.hrc b/extensions/inc/stringarrays.hrc index c7053e143bf0..2de092317cac 100644 --- a/extensions/inc/stringarrays.hrc +++ b/extensions/inc/stringarrays.hrc @@ -20,29 +20,29 @@ #ifndef INCLUDED_EXTENSIONS_INC_STRINGARRAYS_HRC #define INCLUDED_EXTENSIONS_INC_STRINGARRAYS_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_RSC_ENUM_VERTICAL_ALIGN[] = +const TranslateId RID_RSC_ENUM_VERTICAL_ALIGN[] = { NC_("RID_RSC_ENUM_VERTICAL_ALIGN", "Top"), NC_("RID_RSC_ENUM_VERTICAL_ALIGN", "Middle"), NC_("RID_RSC_ENUM_VERTICAL_ALIGN", "Bottom") }; -const char* RID_RSC_ENUM_ICONSIZE_TYPE[] = +const TranslateId RID_RSC_ENUM_ICONSIZE_TYPE[] = { NC_("RID_RSC_ENUM_ICONSIZE_TYPE", "Small"), NC_("RID_RSC_ENUM_ICONSIZE_TYPE", "Large") }; -const char* RID_RSC_ENUM_BORDER_TYPE[] = +const TranslateId RID_RSC_ENUM_BORDER_TYPE[] = { NC_("RID_RSC_ENUM_BORDER_TYPE", "Without frame"), NC_("RID_RSC_ENUM_BORDER_TYPE", "3D look"), NC_("RID_RSC_ENUM_BORDER_TYPE", "Flat") }; -const char* RID_RSC_ENUM_LISTSOURCE_TYPE[] = +const TranslateId RID_RSC_ENUM_LISTSOURCE_TYPE[] = { NC_("RID_RSC_ENUM_LISTSOURCE_TYPE", "Valuelist"), NC_("RID_RSC_ENUM_LISTSOURCE_TYPE", "Table"), @@ -52,14 +52,14 @@ const char* RID_RSC_ENUM_LISTSOURCE_TYPE[] = NC_("RID_RSC_ENUM_LISTSOURCE_TYPE", "Tablefields" ) }; -const char* RID_RSC_ENUM_ALIGNMENT[] = +const TranslateId RID_RSC_ENUM_ALIGNMENT[] = { NC_("RID_RSC_ENUM_ALIGNMENT", "Left"), NC_("RID_RSC_ENUM_ALIGNMENT", "Center"), NC_("RID_RSC_ENUM_ALIGNMENT", "Right" ) }; -const char* RID_RSC_ENUM_BUTTONTYPE[] = +const TranslateId RID_RSC_ENUM_BUTTONTYPE[] = { NC_("RID_RSC_ENUM_BUTTONTYPE", "None"), NC_("RID_RSC_ENUM_BUTTONTYPE", "Submit form"), @@ -76,20 +76,20 @@ const char* RID_RSC_ENUM_BUTTONTYPE[] = NC_("RID_RSC_ENUM_BUTTONTYPE", "Refresh form") }; -const char* RID_RSC_ENUM_SUBMIT_METHOD[] = +const TranslateId RID_RSC_ENUM_SUBMIT_METHOD[] = { NC_("RID_RSC_ENUM_SUBMIT_METHOD", "Get"), NC_("RID_RSC_ENUM_SUBMIT_METHOD", "Post" ) }; -const char* RID_RSC_ENUM_SUBMIT_ENCODING[] = +const TranslateId RID_RSC_ENUM_SUBMIT_ENCODING[] = { NC_("RID_RSC_ENUM_SUBMIT_ENCODING", "URL"), NC_("RID_RSC_ENUM_SUBMIT_ENCODING", "Multipart"), NC_("RID_RSC_ENUM_SUBMIT_ENCODING", "Text" ) }; -const char* RID_RSC_ENUM_DATEFORMAT_LIST[] = +const TranslateId RID_RSC_ENUM_DATEFORMAT_LIST[] = { NC_("RID_RSC_ENUM_DATEFORMAT_LIST", "Standard (short)"), NC_("RID_RSC_ENUM_DATEFORMAT_LIST", "Standard (short YY)"), @@ -105,7 +105,7 @@ const char* RID_RSC_ENUM_DATEFORMAT_LIST[] = NC_("RID_RSC_ENUM_DATEFORMAT_LIST", "YYYY-MM-DD" ), }; -const char* RID_RSC_ENUM_TIMEFORMAT_LIST[] = +const TranslateId RID_RSC_ENUM_TIMEFORMAT_LIST[] = { NC_("RID_RSC_ENUM_TIMEFORMAT_LIST", "13:45"), NC_("RID_RSC_ENUM_TIMEFORMAT_LIST", "13:45:00"), @@ -113,28 +113,28 @@ const char* RID_RSC_ENUM_TIMEFORMAT_LIST[] = NC_("RID_RSC_ENUM_TIMEFORMAT_LIST", "01:45:00 PM" ), }; -const char* RID_RSC_ENUM_CHECKED[] = +const TranslateId RID_RSC_ENUM_CHECKED[] = { NC_("RID_RSC_ENUM_CHECKED", "Not Selected"), NC_("RID_RSC_ENUM_CHECKED", "Selected"), NC_("RID_RSC_ENUM_CHECKED", "Not Defined" ) }; -const char* RID_RSC_ENUM_CYCLE[] = +const TranslateId RID_RSC_ENUM_CYCLE[] = { NC_("RID_RSC_ENUM_CYCLE", "All records"), NC_("RID_RSC_ENUM_CYCLE", "Active record"), NC_("RID_RSC_ENUM_CYCLE", "Current page" ) }; -const char* RID_RSC_ENUM_NAVIGATION[] = +const TranslateId RID_RSC_ENUM_NAVIGATION[] = { NC_("RID_RSC_ENUM_NAVIGATION", "No"), NC_("RID_RSC_ENUM_NAVIGATION", "Yes"), NC_("RID_RSC_ENUM_NAVIGATION", "Parent Form") }; -const char* RID_RSC_ENUM_SUBMIT_TARGET[] = +const TranslateId RID_RSC_ENUM_SUBMIT_TARGET[] = { NC_("RID_RSC_ENUM_SUBMIT_TARGET", "_blank"), NC_("RID_RSC_ENUM_SUBMIT_TARGET", "_parent"), @@ -142,7 +142,7 @@ const char* RID_RSC_ENUM_SUBMIT_TARGET[] = NC_("RID_RSC_ENUM_SUBMIT_TARGET", "_top") }; -const char* RID_RSC_ENUM_SELECTION_TYPE[] = +const TranslateId RID_RSC_ENUM_SELECTION_TYPE[] = { NC_("RID_RSC_ENUM_SELECTION_TYPE", "None" ), NC_("RID_RSC_ENUM_SELECTION_TYPE", "Single" ), @@ -150,13 +150,13 @@ const char* RID_RSC_ENUM_SELECTION_TYPE[] = NC_("RID_RSC_ENUM_SELECTION_TYPE", "Range" ) }; -const char* RID_RSC_ENUM_ORIENTATION[] = +const TranslateId RID_RSC_ENUM_ORIENTATION[] = { NC_("RID_RSC_ENUM_ORIENTATION", "Horizontal"), NC_("RID_RSC_ENUM_ORIENTATION", "Vertical") }; -const char* RID_RSC_ENUM_PUSHBUTTONTYPE[] = +const TranslateId RID_RSC_ENUM_PUSHBUTTONTYPE[] = { NC_("RID_RSC_ENUM_PUSHBUTTONTYPE", "Default"), NC_("RID_RSC_ENUM_PUSHBUTTONTYPE", "OK"), @@ -164,26 +164,26 @@ const char* RID_RSC_ENUM_PUSHBUTTONTYPE[] = NC_("RID_RSC_ENUM_PUSHBUTTONTYPE", "Help") }; -const char* RID_RSC_ENUM_CELL_EXCHANGE_TYPE[] = +const TranslateId RID_RSC_ENUM_CELL_EXCHANGE_TYPE[] = { NC_("RID_RSC_ENUM_CELL_EXCHANGE_TYPE", "The selected entry"), NC_("RID_RSC_ENUM_CELL_EXCHANGE_TYPE", "Position of the selected entry") }; -const char* RID_RSC_ENUM_TEXTTYPE[] = +const TranslateId RID_RSC_ENUM_TEXTTYPE[] = { NC_("RID_RSC_ENUM_TEXTTYPE", "Single-line"), NC_("RID_RSC_ENUM_TEXTTYPE", "Multi-line"), NC_("RID_RSC_ENUM_TEXTTYPE", "Multi-line with formatting") }; -const char* RID_RSC_ENUM_LINEEND_FORMAT[] = +const TranslateId RID_RSC_ENUM_LINEEND_FORMAT[] = { NC_("RID_RSC_ENUM_LINEEND_FORMAT", "LF (Unix)"), NC_("RID_RSC_ENUM_LINEEND_FORMAT", "CR+LF (Windows)") }; -const char* RID_RSC_ENUM_SCROLLBARS[] = +const TranslateId RID_RSC_ENUM_SCROLLBARS[] = { NC_("RID_RSC_ENUM_SCROLLBARS", "None"), NC_("RID_RSC_ENUM_SCROLLBARS", "Horizontal"), @@ -191,13 +191,13 @@ const char* RID_RSC_ENUM_SCROLLBARS[] = NC_("RID_RSC_ENUM_SCROLLBARS", "Both") }; -const char* RID_RSC_ENUM_VISUALEFFECT[] = +const TranslateId RID_RSC_ENUM_VISUALEFFECT[] = { NC_("RID_RSC_ENUM_VISUALEFFECT", "3D"), NC_("RID_RSC_ENUM_VISUALEFFECT", "Flat"), }; -const char* RID_RSC_ENUM_IMAGE_POSITION[] = +const TranslateId RID_RSC_ENUM_IMAGE_POSITION[] = { NC_("RID_RSC_ENUM_IMAGE_POSITION", "Left top"), NC_("RID_RSC_ENUM_IMAGE_POSITION", "Left centered"), @@ -214,35 +214,35 @@ const char* RID_RSC_ENUM_IMAGE_POSITION[] = NC_("RID_RSC_ENUM_IMAGE_POSITION", "Centered"), }; -const char* RID_RSC_ENUM_WHITESPACE_HANDLING[] = +const TranslateId RID_RSC_ENUM_WHITESPACE_HANDLING[] = { NC_("RID_RSC_ENUM_WHITESPACE_HANDLING", "Preserve"), NC_("RID_RSC_ENUM_WHITESPACE_HANDLING", "Replace"), NC_("RID_RSC_ENUM_WHITESPACE_HANDLING", "Collapse") }; -const char* RID_RSC_ENUM_SCALE_MODE[] = +const TranslateId RID_RSC_ENUM_SCALE_MODE[] = { NC_("RID_RSC_ENUM_SCALE_MODE", "No"), NC_("RID_RSC_ENUM_SCALE_MODE", "Keep Ratio"), NC_("RID_RSC_ENUM_SCALE_MODE", "Fit to Size") }; -const char* RID_RSC_ENUM_WRITING_MODE[] = +const TranslateId RID_RSC_ENUM_WRITING_MODE[] = { NC_("RID_RSC_ENUM_WRITING_MODE", "Left-to-right"), NC_("RID_RSC_ENUM_WRITING_MODE", "Right-to-left"), NC_("RID_RSC_ENUM_WRITING_MODE", "Use superordinate object settings") }; -const char* RID_RSC_ENUM_WHEEL_BEHAVIOR[] = +const TranslateId RID_RSC_ENUM_WHEEL_BEHAVIOR[] = { NC_("RID_RSC_ENUM_WHEEL_BEHAVIOR", "Never"), NC_("RID_RSC_ENUM_WHEEL_BEHAVIOR", "When focused"), NC_("RID_RSC_ENUM_WHEEL_BEHAVIOR", "Always") }; -const char* RID_RSC_ENUM_TEXT_ANCHOR_TYPE[] = +const TranslateId RID_RSC_ENUM_TEXT_ANCHOR_TYPE[] = { NC_("RID_RSC_ENUM_TEXT_ANCHOR_TYPE", "To Paragraph"), NC_("RID_RSC_ENUM_TEXT_ANCHOR_TYPE", "As Character"), @@ -251,7 +251,7 @@ const char* RID_RSC_ENUM_TEXT_ANCHOR_TYPE[] = NC_("RID_RSC_ENUM_TEXT_ANCHOR_TYPE", "To Character") }; -const char* RID_RSC_ENUM_SHEET_ANCHOR_TYPE[] = +const TranslateId RID_RSC_ENUM_SHEET_ANCHOR_TYPE[] = { NC_("RID_RSC_ENUM_SHEET_ANCHOR_TYPE", "To Page"), NC_("RID_RSC_ENUM_SHEET_ANCHOR_TYPE", "To Cell") diff --git a/extensions/inc/strings.hrc b/extensions/inc/strings.hrc index 63dc3ced1b7d..8d6ed0580256 100644 --- a/extensions/inc/strings.hrc +++ b/extensions/inc/strings.hrc @@ -20,7 +20,9 @@ #ifndef INCLUDED_EXTENSIONS_INC_STRINGS_HRC #define INCLUDED_EXTENSIONS_INC_STRINGS_HRC -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) +#include <unotools/resmgr.hxx> + +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) #define RID_STR_EDITMASK NC_("RID_STR_EDITMASK", "Edit mask") #define RID_STR_LITERALMASK NC_("RID_STR_LITERALMASK", "Literal mask") diff --git a/extensions/inc/yesno.hrc b/extensions/inc/yesno.hrc index 3992a1e8ab28..32792bb81300 100644 --- a/extensions/inc/yesno.hrc +++ b/extensions/inc/yesno.hrc @@ -20,11 +20,13 @@ #ifndef INCLUDED_EXTENSIONS_INC_YESNO_HRC #define INCLUDED_EXTENSIONS_INC_YESNO_HRC -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) +#include <unotools/resmgr.hxx> + +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) namespace { -const char* RID_RSC_ENUM_YESNO[] = +const TranslateId RID_RSC_ENUM_YESNO[] = { NC_("RID_RSC_ENUM_YESNO", "No" ), NC_("RID_RSC_ENUM_YESNO", "Yes" ) diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index fee75664d983..5600e819fb07 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -119,7 +119,7 @@ namespace abp OUString OAddressBookSourcePilot::getStateDisplayName( WizardState _nState ) const { - const char* pResId = nullptr; + TranslateId pResId; switch ( _nState ) { case STATE_SELECT_ABTYPE: pResId = RID_STR_SELECT_ABTYPE; break; diff --git a/extensions/source/bibliography/bibmod.cxx b/extensions/source/bibliography/bibmod.cxx index 5f32aef3a366..3a6d06672004 100644 --- a/extensions/source/bibliography/bibmod.cxx +++ b/extensions/source/bibliography/bibmod.cxx @@ -54,7 +54,7 @@ void CloseBibModul(HdlBibModul ppBibModul) } } -OUString BibResId(std::string_view aId) +OUString BibResId(TranslateId aId) { return Translate::get(aId, pBibModul->GetResLocale()); } diff --git a/extensions/source/bibliography/bibresid.hxx b/extensions/source/bibliography/bibresid.hxx index 7de3d0c46bfb..6e17e76f2af7 100644 --- a/extensions/source/bibliography/bibresid.hxx +++ b/extensions/source/bibliography/bibresid.hxx @@ -20,8 +20,8 @@ #pragma once #include <rtl/ustring.hxx> -#include <string_view> +#include <unotools/resmgr.hxx> -OUString BibResId(std::string_view aId); +OUString BibResId(TranslateId aId); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index b442aca3fdbe..e8a2dfef1189 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -185,7 +185,7 @@ namespace dbp m_xFormDatasource->set_label(sDataSource); m_xFormTable->set_label(sCommand); - const char* pCommandTypeResourceId = nullptr; + TranslateId pCommandTypeResourceId; switch (nCommandType) { case CommandType::TABLE: diff --git a/extensions/source/inc/componentmodule.cxx b/extensions/source/inc/componentmodule.cxx index 69d2234adbdb..e1b29b2ecef6 100644 --- a/extensions/source/inc/componentmodule.cxx +++ b/extensions/source/inc/componentmodule.cxx @@ -23,7 +23,7 @@ namespace compmodule { - OUString ModuleRes(const char* pId) + OUString ModuleRes(TranslateId pId) { return Translate::get(pId, Translate::Create("pcr")); } diff --git a/extensions/source/inc/componentmodule.hxx b/extensions/source/inc/componentmodule.hxx index 80bc71169190..24b5032cd98e 100644 --- a/extensions/source/inc/componentmodule.hxx +++ b/extensions/source/inc/componentmodule.hxx @@ -20,12 +20,13 @@ #pragma once #include <rtl/ustring.hxx> +#include <unotools/resmgr.hxx> namespace compmodule { // specialized ResId, using the resource locale provided by the global module - OUString ModuleRes(const char* pId); + OUString ModuleRes(TranslateId pId); } // namespace compmodule diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index b3b0c82af496..a2b1d2d26ea1 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -131,7 +131,7 @@ namespace pcr static struct { const char* programmaticName; - const char* uiNameResId; + TranslateId uiNameResId; const char* helpId; } const aCategories[] = { { "General", RID_STR_PROPPAGE_DEFAULT, HID_FM_PROPDLG_TAB_GENERAL }, diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 74a1ba13a94b..940d7d48f379 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -123,7 +123,7 @@ namespace pcr namespace FormComponentType = css::form::FormComponentType; EventDescription::EventDescription( EventId _nId, const char* _pListenerNamespaceAscii, const char* _pListenerClassAsciiName, - const char* _pListenerMethodAsciiName, const char* pDisplayNameResId, const OString& _sHelpId, const OString& _sUniqueBrowseId ) + const char* _pListenerMethodAsciiName, TranslateId pDisplayNameResId, const OString& _sHelpId, const OString& _sUniqueBrowseId ) :sDisplayName(PcrRes( pDisplayNameResId )) ,sListenerMethodName( OUString::createFromAscii( _pListenerMethodAsciiName ) ) ,sHelpId( _sHelpId ) diff --git a/extensions/source/propctrlr/eventhandler.hxx b/extensions/source/propctrlr/eventhandler.hxx index 320875a418fb..1447276a3b62 100644 --- a/extensions/source/propctrlr/eventhandler.hxx +++ b/extensions/source/propctrlr/eventhandler.hxx @@ -28,6 +28,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/compbase.hxx> +#include <unotools/resmgr.hxx> #include <unordered_map> @@ -58,7 +59,7 @@ namespace pcr const char* _pListenerNamespaceAscii, const char* _pListenerClassAsciiName, const char* _pListenerMethodAsciiName, - const char* pDisplayNameResId, + TranslateId pDisplayNameResId, const OString& _sHelpId, const OString& _sUniqueBrowseId ); }; diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 0cf3bc52f171..abbb5d418dc6 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -739,7 +739,7 @@ namespace pcr // font style ::FontWeight eWeight = vcl::unohelper::ConvertFontWeight( aFont.Weight ); - const char* pStyleResID = RID_STR_FONTSTYLE_REGULAR; + TranslateId pStyleResID = RID_STR_FONTSTYLE_REGULAR; if ( aFont.Slant == FontSlant_ITALIC ) { if ( eWeight > WEIGHT_NORMAL ) diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index 3fd9e92b3a0f..f9147cb4469a 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -410,7 +410,7 @@ namespace pcr OSL_ENSURE( ( ( getPropertyUIFlags( _nId ) & PROP_FLAG_ENUM ) != 0 ) || ( _nId == PROPERTY_ID_TARGET_FRAME ), "OPropertyInfoService::getPropertyEnumRepresentations: this is no enum property!" ); - const char** pStringItemsResId = nullptr; + const TranslateId* pStringItemsResId = nullptr; int nElements = 0; switch ( _nId ) { diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx index b83773b6f00a..cc9e08561dda 100644 --- a/extensions/source/propctrlr/handlerhelper.cxx +++ b/extensions/source/propctrlr/handlerhelper.cxx @@ -139,7 +139,7 @@ namespace pcr } Reference< XPropertyControl > PropertyHandlerHelper::createListBoxControl( const Reference< XPropertyControlFactory >& _rxControlFactory, - const char** pTransIds, size_t nElements, bool _bReadOnlyControl ) + const TranslateId* pTransIds, size_t nElements, bool _bReadOnlyControl ) { std::vector<OUString> aInitialListEntries; for (size_t i = 0; i < nElements; ++i) diff --git a/extensions/source/propctrlr/handlerhelper.hxx b/extensions/source/propctrlr/handlerhelper.hxx index a53a24a9256f..21c0fd2fe162 100644 --- a/extensions/source/propctrlr/handlerhelper.hxx +++ b/extensions/source/propctrlr/handlerhelper.hxx @@ -25,6 +25,7 @@ #include <com/sun/star/inspection/XPropertyControlFactory.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/Optional.hpp> +#include <unotools/resmgr.hxx> #include <vector> @@ -116,7 +117,7 @@ namespace pcr static css::uno::Reference< css::inspection::XPropertyControl > createListBoxControl( const css::uno::Reference< css::inspection::XPropertyControlFactory >& _rxControlFactory, - const char** pTransIds, size_t nElements, + const TranslateId* pTransIds, size_t nElements, bool _bReadOnlyControl ); diff --git a/extensions/source/propctrlr/modulepcr.cxx b/extensions/source/propctrlr/modulepcr.cxx index 67a6e198b27e..da8336e10991 100644 --- a/extensions/source/propctrlr/modulepcr.cxx +++ b/extensions/source/propctrlr/modulepcr.cxx @@ -23,7 +23,7 @@ namespace pcr { -OUString PcrRes(std::string_view aId) { return Translate::get(aId, Translate::Create("pcr")); } +OUString PcrRes(TranslateId aId) { return Translate::get(aId, Translate::Create("pcr")); } } // namespace pcr diff --git a/extensions/source/propctrlr/modulepcr.hxx b/extensions/source/propctrlr/modulepcr.hxx index c8eed78eef32..d0b854893ea2 100644 --- a/extensions/source/propctrlr/modulepcr.hxx +++ b/extensions/source/propctrlr/modulepcr.hxx @@ -20,11 +20,11 @@ #pragma once #include <rtl/ustring.hxx> -#include <string_view> +#include <unotools/resmgr.hxx> namespace pcr { -OUString PcrRes(std::string_view pId); +OUString PcrRes(TranslateId pId); } // namespace pcr /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index 87c17e56fe78..e76575cd9bc9 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -273,7 +273,7 @@ SaneDlg::~SaneDlg() namespace { -OUString SaneResId(std::string_view aID) +OUString SaneResId(TranslateId aID) { return Translate::get(aID, Translate::Create("pcr")); } |