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 /sw | |
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 'sw')
57 files changed, 188 insertions, 187 deletions
diff --git a/sw/inc/AccessibilityCheckStrings.hrc b/sw/inc/AccessibilityCheckStrings.hrc index 97e8c2120cad..2c098e50edc8 100644 --- a/sw/inc/AccessibilityCheckStrings.hrc +++ b/sw/inc/AccessibilityCheckStrings.hrc @@ -11,7 +11,7 @@ #ifndef INCLUDED_SW_INC_ACCESSIBILITY_CHECK_STRINGS_HRC #define INCLUDED_SW_INC_ACCESSIBILITY_CHECK_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 STR_NO_ALT NC_("STR_NO_ALT", "No alt text for graphic '%OBJECT_NAME%'") #define STR_TABLE_MERGE_SPLIT NC_("STR_TABLE_MERGE_SPLIT", "Table '%OBJECT_NAME%' contains merges or splits") diff --git a/sw/inc/app.hrc b/sw/inc/app.hrc index 9b195c02e60d..c5b32d444b9d 100644 --- a/sw/inc/app.hrc +++ b/sw/inc/app.hrc @@ -20,11 +20,11 @@ #ifndef INCLUDED_SW_INC_APP_HRC #define INCLUDED_SW_INC_APP_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)) #include <svl/style.hxx> -const std::pair<const char*, SfxStyleSearchBits> RID_PARAGRAPHSTYLEFAMILY[] = +const std::pair<TranslateId, SfxStyleSearchBits> RID_PARAGRAPHSTYLEFAMILY[] = { { NC_("RID_PARAGRAPHSTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, { NC_("RID_PARAGRAPHSTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, @@ -38,52 +38,52 @@ const std::pair<const char*, SfxStyleSearchBits> RID_PARAGRAPHSTYLEFAMILY[] = { NC_("RID_PARAGRAPHSTYLEFAMILY", "Special Styles") , SfxStyleSearchBits::SwExtra }, { NC_("RID_PARAGRAPHSTYLEFAMILY", "HTML Styles") , SfxStyleSearchBits::SwHtml }, { NC_("RID_PARAGRAPHSTYLEFAMILY", "Conditional Styles") , SfxStyleSearchBits::SwCondColl }, - { nullptr, SfxStyleSearchBits::Auto } + { {}, SfxStyleSearchBits::Auto } }; -const std::pair<const char*, SfxStyleSearchBits> RID_CHARACTERSTYLEFAMILY[] = +const std::pair<TranslateId, SfxStyleSearchBits> RID_CHARACTERSTYLEFAMILY[] = { { NC_("RID_CHARACTERSTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, { NC_("RID_CHARACTERSTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, { NC_("RID_CHARACTERSTYLEFAMILY", "Applied Styles") , SfxStyleSearchBits::Used }, { NC_("RID_CHARACTERSTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, - { nullptr, SfxStyleSearchBits::Auto } + { {}, SfxStyleSearchBits::Auto } }; -const std::pair<const char*, SfxStyleSearchBits> RID_FRAMESTYLEFAMILY[] = +const std::pair<TranslateId, SfxStyleSearchBits> RID_FRAMESTYLEFAMILY[] = { { NC_("RID_FRAMESTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, { NC_("RID_FRAMESTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, { NC_("RID_FRAMESTYLEFAMILY", "Applied Styles") , SfxStyleSearchBits::Used }, { NC_("RID_FRAMESTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, - { nullptr, SfxStyleSearchBits::Auto } + { {}, SfxStyleSearchBits::Auto } }; -const std::pair<const char*, SfxStyleSearchBits> RID_PAGESTYLEFAMILY[] = +const std::pair<TranslateId, SfxStyleSearchBits> RID_PAGESTYLEFAMILY[] = { { NC_("RID_PAGESTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, { NC_("RID_PAGESTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, { NC_("RID_PAGESTYLEFAMILY", "Applied Styles") , SfxStyleSearchBits::Used }, { NC_("RID_PAGESTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, - { nullptr, SfxStyleSearchBits::Auto } + { {}, SfxStyleSearchBits::Auto } }; -const std::pair<const char*, SfxStyleSearchBits> RID_LISTSTYLEFAMILY[] = +const std::pair<TranslateId, SfxStyleSearchBits> RID_LISTSTYLEFAMILY[] = { { NC_("RID_LISTSTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, { NC_("RID_LISTSTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, { NC_("RID_LISTSTYLEFAMILY", "Applied Styles") , SfxStyleSearchBits::Used }, { NC_("RID_LISTSTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, - { nullptr, SfxStyleSearchBits::Auto } + { {}, SfxStyleSearchBits::Auto } }; -const std::pair<const char*, SfxStyleSearchBits> RID_TABLESTYLEFAMILY[] = +const std::pair<TranslateId, SfxStyleSearchBits> RID_TABLESTYLEFAMILY[] = { { NC_("RID_TABLESTYLEFAMILY", "All Styles") , SfxStyleSearchBits::AllVisible }, { NC_("RID_TABLESTYLEFAMILY", "Hidden Styles") , SfxStyleSearchBits::Hidden }, { NC_("RID_TABLESTYLEFAMILY", "Applied Styles") , SfxStyleSearchBits::Used }, { NC_("RID_TABLESTYLEFAMILY", "Custom Styles") , SfxStyleSearchBits::UserDefined }, - { nullptr, SfxStyleSearchBits::Auto } + { {}, SfxStyleSearchBits::Auto } }; #endif diff --git a/sw/inc/cnttab.hrc b/sw/inc/cnttab.hrc index f0823fd24997..ccb469092899 100644 --- a/sw/inc/cnttab.hrc +++ b/sw/inc/cnttab.hrc @@ -22,9 +22,9 @@ #include "tox.hxx" -#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 std::pair<const char*, SwTOOElements> RES_SRCTYPES[] = +const std::pair<TranslateId, SwTOOElements> RES_SRCTYPES[] = { { NC_("RES_SRCTYPES", "%PRODUCTNAME Math"), SwTOOElements::Math}, { NC_("RES_SRCTYPES", "%PRODUCTNAME Chart"), SwTOOElements::Chart}, diff --git a/sw/inc/dbui.hrc b/sw/inc/dbui.hrc index 778f229ed4f3..4abc1148755d 100644 --- a/sw/inc/dbui.hrc +++ b/sw/inc/dbui.hrc @@ -21,8 +21,10 @@ #define INCLUDED_SW_INC_DBUI_HRC #include <utility> +#include <unotools/resmgr.hxx> -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) + +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) // Elements ----------------------------------------------------------------- #define MM_PART_TITLE 0 @@ -40,7 +42,7 @@ #define MM_PART_E_MAIL 12 #define MM_PART_GENDER 13 -const std::pair<const char*, int> SA_ADDRESS_HEADER[] = +const std::pair<TranslateId, int> SA_ADDRESS_HEADER[] = { { NC_("SA_ADDRESS_HEADER", "Title") , MM_PART_TITLE }, { NC_("SA_ADDRESS_HEADER", "First Name") , MM_PART_FIRSTNAME }, diff --git a/sw/inc/error.hrc b/sw/inc/error.hrc index b2d55025ca25..c6db37c65fea 100644 --- a/sw/inc/error.hrc +++ b/sw/inc/error.hrc @@ -25,7 +25,7 @@ #include "swerror.h" -#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 ERR_CODE( class, err ) ErrCode(ErrCodeArea::Sw, class, err.GetCode()) #define WARN_CODE( class, err ) ErrCode(ErrCodeArea::Sw, class, err.GetCode()) @@ -58,7 +58,7 @@ const ErrMsgCode RID_SW_ERRHDL[] = { NC_("RID_SW_ERRHDL", "This HTML document contains Basic macros.\nThey were not saved with the current export settings."), WARN_SWG_HTML_NO_MACROS }, { NC_("RID_SW_ERRHDL", "Error in writing sub-document $(ARG1)."), WARN_WRITE_ERROR_FILE }, { NC_("RID_SW_ERRHDL", "Format error discovered in the file in sub-document $(ARG1) at $(ARG2)(row,col)."), WARN_FORMAT_FILE_ROWCOL }, - { nullptr, ERRCODE_NONE } + { {}, ERRCODE_NONE } }; #endif diff --git a/sw/inc/flddinf.hrc b/sw/inc/flddinf.hrc index c9b1f3f6ac43..bc9dfcc69f57 100644 --- a/sw/inc/flddinf.hrc +++ b/sw/inc/flddinf.hrc @@ -20,9 +20,9 @@ #ifndef INCLUDED_SW_INC_FLDDINF_HRC #define INCLUDED_SW_INC_FLDDINF_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* FLD_SELECT[] = +const TranslateId FLD_SELECT[] = { NC_("flddocinfopage|liststore1", "Author"), NC_("flddocinfopage|liststore1", "Time"), diff --git a/sw/inc/fldref.hrc b/sw/inc/fldref.hrc index 9dca24fa88c1..ad519bcbbf2d 100644 --- a/sw/inc/fldref.hrc +++ b/sw/inc/fldref.hrc @@ -20,9 +20,9 @@ #ifndef INCLUDED_SW_INC_FLDREF_HRC #define INCLUDED_SW_INC_FLDREF_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* FLD_REF_PAGE_TYPES[] = +const TranslateId FLD_REF_PAGE_TYPES[] = { NC_("fldrefpage|liststore1", "Bookmarks"), NC_("fldrefpage|liststore1", "Footnotes"), diff --git a/sw/inc/inspectorproperties.hrc b/sw/inc/inspectorproperties.hrc index 0def6ab41780..03c2cc8c60b4 100644 --- a/sw/inc/inspectorproperties.hrc +++ b/sw/inc/inspectorproperties.hrc @@ -19,8 +19,8 @@ #pragma once -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) -#define NNC_(Context, StringSingular, StringPlural) reinterpret_cast<char const *>(Context "\004" u8##StringSingular "\004" u8##StringPlural) +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NNC_(Context, StringSingular, StringPlural) TranslateNId(Context, reinterpret_cast<char const *>(u8##StringSingular), reinterpret_cast<char const *>(u8##StringPlural)) /*-------------------------------------------------------------------- Description: API names for Paragraph, Character diff --git a/sw/inc/mdiexp.hxx b/sw/inc/mdiexp.hxx index dea2b4361825..4706810617fe 100644 --- a/sw/inc/mdiexp.hxx +++ b/sw/inc/mdiexp.hxx @@ -23,6 +23,7 @@ #include <tools/long.hxx> #include "tblenum.hxx" #include "swdllapi.h" +#include <unotools/resmgr.hxx> class SwRect; class Size; @@ -39,7 +40,7 @@ extern void PageNumNotify(SwViewShell const * pVwSh); enum FlyMode { FLY_DRAG_START, FLY_DRAG, FLY_DRAG_END }; extern void FrameNotify( SwViewShell* pVwSh, FlyMode eMode = FLY_DRAG ); -SW_DLLPUBLIC void StartProgress(const char* pMessId, tools::Long nStartVal, tools::Long nEndVal, SwDocShell *pDocSh = nullptr); +SW_DLLPUBLIC void StartProgress(TranslateId pMessId, tools::Long nStartVal, tools::Long nEndVal, SwDocShell *pDocSh = nullptr); SW_DLLPUBLIC void EndProgress ( SwDocShell const *pDocSh ); SW_DLLPUBLIC void SetProgressState ( tools::Long nPosition, SwDocShell const *pDocShell ); void RescheduleProgress( SwDocShell const *pDocShell ); diff --git a/sw/inc/mmaddressblockpage.hrc b/sw/inc/mmaddressblockpage.hrc index ba026a890411..a1b914c6eea4 100644 --- a/sw/inc/mmaddressblockpage.hrc +++ b/sw/inc/mmaddressblockpage.hrc @@ -20,16 +20,16 @@ #ifndef INCLUDED_SW_INC_MMADDRESSBLOCK_HRC #define INCLUDED_SW_INC_MMADDRESSBLOCK_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* RA_SALUTATION[] = +const TranslateId RA_SALUTATION[] = { NC_("RA_SALUTATION", "Dear"), NC_("RA_SALUTATION", "Hello"), NC_("RA_SALUTATION", "Hi") }; -const char* RA_PUNCTUATION[] = +const TranslateId RA_PUNCTUATION[] = { NC_("RA_PUNCTUATION", ","), NC_("RA_PUNCTUATION", ":"), diff --git a/sw/inc/optload.hrc b/sw/inc/optload.hrc index 201fbff5986c..a86d7ac57246 100644 --- a/sw/inc/optload.hrc +++ b/sw/inc/optload.hrc @@ -23,9 +23,9 @@ #include <tools/fldunit.hxx> #include <utility> -#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 std::pair<const char*, FieldUnit> STR_ARR_METRIC[] = +const std::pair<TranslateId, FieldUnit> STR_ARR_METRIC[] = { { NC_("STR_ARR_METRIC", "Millimeter") , FieldUnit::MM }, { NC_("STR_ARR_METRIC", "Centimeter") , FieldUnit::CM }, diff --git a/sw/inc/outline.hrc b/sw/inc/outline.hrc index c3202a39e404..65c180cac3e0 100644 --- a/sw/inc/outline.hrc +++ b/sw/inc/outline.hrc @@ -20,9 +20,9 @@ #ifndef INCLUDED_SW_INC_OUTLINE_HRC #define INCLUDED_SW_INC_OUTLINE_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* OUTLINE_STYLE[] = +const TranslateId OUTLINE_STYLE[] = { NC_("numberingnamedialog|liststore1", "Untitled 1"), NC_("numberingnamedialog|liststore1", "Untitled 2"), diff --git a/sw/inc/pageformatpanel.hrc b/sw/inc/pageformatpanel.hrc index 97ccdee9e844..34296c7615e6 100644 --- a/sw/inc/pageformatpanel.hrc +++ b/sw/inc/pageformatpanel.hrc @@ -10,7 +10,7 @@ #ifndef INCLUDED_SW_INC_PAGEFORMATPANEL_HRC #define INCLUDED_SW_INC_PAGEFORMATPANEL_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)) #include <utility> @@ -18,7 +18,7 @@ namespace sw { // To translators: this is a listbox labelled by "Margins:", inch units -const std::pair<const char*, int> RID_PAGEFORMATPANEL_MARGINS_INCH[] = +const std::pair<TranslateId, int> RID_PAGEFORMATPANEL_MARGINS_INCH[] = { { NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "None"), 0 }, { NC_("RID_PAGEFORMATPANEL_MARGINS_INCH", "Narrow"), 0 }, @@ -34,7 +34,7 @@ const std::pair<const char*, int> RID_PAGEFORMATPANEL_MARGINS_INCH[] = }; // To translators: this is a listbox labelled by "Margins:", cm units -const std::pair<const char*, int> RID_PAGEFORMATPANEL_MARGINS_CM[] = +const std::pair<TranslateId, int> RID_PAGEFORMATPANEL_MARGINS_CM[] = { { NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "None"), 0 }, { NC_("RID_PAGEFORMATPANEL_MARGINS_CM", "Narrow"), 0 }, diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index a7981f2c9929..4d374a5591f5 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -20,8 +20,8 @@ #ifndef INCLUDED_SW_INC_STRINGS_HRC #define INCLUDED_SW_INC_STRINGS_HRC -#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" u8##String) -#define NNC_(Context, StringSingular, StringPlural) reinterpret_cast<char const *>(Context "\004" u8##StringSingular "\004" u8##StringPlural) +#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NNC_(Context, StringSingular, StringPlural) TranslateNId(Context, reinterpret_cast<char const *>(u8##StringSingular), reinterpret_cast<char const *>(u8##StringPlural)) // Dialog buttons #define STR_STANDARD_LABEL NC_("STR_STANDARD_LABEL", "Reset to ~Parent") diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index dd15ce03bb88..81ad502b82be 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -28,6 +28,7 @@ #include <i18nlangtag/lang.h> #include <vcl/outdev.hxx> #include <svx/flagsdef.hxx> +#include <unotools/resmgr.hxx> namespace com::sun::star { namespace linguistic2{ @@ -109,8 +110,8 @@ constexpr short lOutlineMinTextDistance = 216; // 0.15 inch = 0.38 cm #define INIT_SEQ_FLDTYPES 5 // defined in sw/source/uibase/app/swmodule.cxx -SW_DLLPUBLIC OUString SwResId(std::string_view aId); -OUString SwResId(std::string_view aId, int nCardinality); +SW_DLLPUBLIC OUString SwResId(TranslateId aId); +OUString SwResId(TranslateNId aContextSingularPlural, int nCardinality); css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker(); css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator(); diff --git a/sw/inc/utlui.hrc b/sw/inc/utlui.hrc index 5bf81226392d..a14e1452bc38 100644 --- a/sw/inc/utlui.hrc +++ b/sw/inc/utlui.hrc @@ -20,9 +20,9 @@ #ifndef INCLUDED_SW_INC_UTLUI_HRC #define INCLUDED_SW_INC_UTLUI_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_SHELLRES_AUTOFMTSTRS[] = +const TranslateId RID_SHELLRES_AUTOFMTSTRS[] = { NC_("RID_SHELLRES_AUTOFMTSTRS", "Remove empty paragraphs"), NC_("RID_SHELLRES_AUTOFMTSTRS", "Use replacement table"), diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index dde550ef2b9e..ecfcc65b60bc 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -1434,7 +1434,7 @@ bool SwAccessibleContext::Select( SwPaM *pPaM, SdrObject *pObj, return bRet; } -OUString SwAccessibleContext::GetResource(const char* pResId, +OUString SwAccessibleContext::GetResource(TranslateId pResId, const OUString *pArg1, const OUString *pArg2) { diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx index a77cf6cb74b6..999f57374afc 100644 --- a/sw/source/core/access/acccontext.hxx +++ b/sw/source/core/access/acccontext.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase.hxx> +#include <unotools/resmgr.hxx> #include <memory> #include <mutex> @@ -353,7 +354,7 @@ public: virtual bool SetSelectedState(bool bSeleted); bool IsSeletedInDoc() const { return m_isSelectedInDoc; } - static OUString GetResource(const char* pResId, + static OUString GetResource(TranslateId pResId, const OUString *pArg1 = nullptr, const OUString *pArg2 = nullptr); }; diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx index 43d8a2b6e10c..6fb7ebca864c 100644 --- a/sw/source/core/access/accfootnote.cxx +++ b/sw/source/core/access/accfootnote.cxx @@ -46,7 +46,7 @@ SwAccessibleFootnote::SwAccessibleFootnote( bIsEndnote ? AccessibleRole::END_NOTE : AccessibleRole::FOOTNOTE, pFootnoteFrame ) { - const char* pResId = bIsEndnote ? STR_ACCESS_ENDNOTE_NAME + TranslateId pResId = bIsEndnote ? STR_ACCESS_ENDNOTE_NAME : STR_ACCESS_FOOTNOTE_NAME; OUString sArg; @@ -71,7 +71,7 @@ OUString SAL_CALL SwAccessibleFootnote::getAccessibleDescription() ThrowIfDisposed(); - const char* pResId = AccessibleRole::END_NOTE == GetRole() + TranslateId pResId = AccessibleRole::END_NOTE == GetRole() ? STR_ACCESS_ENDNOTE_DESC : STR_ACCESS_FOOTNOTE_DESC ; diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx index bf1f8bf6d2ad..d07b2c80255e 100644 --- a/sw/source/core/access/accheaderfooter.cxx +++ b/sw/source/core/access/accheaderfooter.cxx @@ -62,7 +62,7 @@ OUString SAL_CALL SwAccessibleHeaderFooter::getAccessibleDescription() ThrowIfDisposed(); - const char* pResId = AccessibleRole::HEADER == GetRole() + TranslateId pResId = AccessibleRole::HEADER == GetRole() ? STR_ACCESS_HEADER_DESC : STR_ACCESS_FOOTER_DESC ; diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 9238622db126..c69df3adc003 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -280,7 +280,7 @@ namespace } } -static const char* STR_POOLCOLL_TEXT_ARY[] = +const TranslateId STR_POOLCOLL_TEXT_ARY[] = { // Category Text STR_POOLCOLL_STANDARD, @@ -306,7 +306,7 @@ static const char* STR_POOLCOLL_TEXT_ARY[] = STR_POOLCOLL_HEADLINE10 }; -static const char* STR_POOLCOLL_LISTS_ARY[] +const TranslateId STR_POOLCOLL_LISTS_ARY[] { // Category Lists STR_POOLCOLL_NUMBER_BULLET_BASE, @@ -356,7 +356,7 @@ static const char* STR_POOLCOLL_LISTS_ARY[] }; // Special Areas -static const char* STR_POOLCOLL_EXTRA_ARY[] +const TranslateId STR_POOLCOLL_EXTRA_ARY[] { // Subcategory Header STR_POOLCOLL_HEADERFOOTER, @@ -385,7 +385,7 @@ static const char* STR_POOLCOLL_EXTRA_ARY[] STR_POOLCOLL_LABEL_DRAWING }; -static const char* STR_POOLCOLL_REGISTER_ARY[] = +const TranslateId STR_POOLCOLL_REGISTER_ARY[] = { // Category Directories STR_POOLCOLL_REGISTER_BASE, @@ -435,7 +435,7 @@ static const char* STR_POOLCOLL_REGISTER_ARY[] = STR_POOLCOLL_TOX_USER10 }; -static const char* STR_POOLCOLL_DOC_ARY[] = +const TranslateId STR_POOLCOLL_DOC_ARY[] = { // Category Chapter/Document STR_POOLCOLL_DOC_TITLE, @@ -443,7 +443,7 @@ static const char* STR_POOLCOLL_DOC_ARY[] = STR_POOLCOLL_DOC_APPENDIX }; -static const char* STR_POOLCOLL_HTML_ARY[] = +const TranslateId STR_POOLCOLL_HTML_ARY[] = { // Category HTML-Templates STR_POOLCOLL_HTML_BLOCKQUOTE, @@ -453,7 +453,7 @@ static const char* STR_POOLCOLL_HTML_ARY[] = STR_POOLCOLL_HTML_DT }; -static const char* STR_POOLCHR_ARY[] = +const TranslateId STR_POOLCHR_ARY[] = { STR_POOLCHR_FOOTNOTE, STR_POOLCHR_PAGENO, @@ -474,7 +474,7 @@ static const char* STR_POOLCHR_ARY[] = STR_POOLCHR_VERT_NUM }; -static const char* STR_POOLCHR_HTML_ARY[] = +const TranslateId STR_POOLCHR_HTML_ARY[] = { STR_POOLCHR_HTML_EMPHASIS, STR_POOLCHR_HTML_CITATION, @@ -487,7 +487,7 @@ static const char* STR_POOLCHR_HTML_ARY[] = STR_POOLCHR_HTML_TELETYPE }; -static const char* STR_POOLFRM_ARY[] = +const TranslateId STR_POOLFRM_ARY[] = { STR_POOLFRM_FRAME, STR_POOLFRM_GRAPHIC, @@ -498,7 +498,7 @@ static const char* STR_POOLFRM_ARY[] = STR_POOLFRM_LABEL }; -static const char* STR_POOLPAGE_ARY[] = +const TranslateId STR_POOLPAGE_ARY[] = { // Page styles STR_POOLPAGE_STANDARD, @@ -513,7 +513,7 @@ static const char* STR_POOLPAGE_ARY[] = STR_POOLPAGE_LANDSCAPE }; -static const char* STR_POOLNUMRULE_NUM_ARY[] = +const TranslateId STR_POOLNUMRULE_NUM_ARY[] = { // Numbering styles STR_POOLNUMRULE_NOLIST, @@ -532,7 +532,7 @@ static const char* STR_POOLNUMRULE_NUM_ARY[] = // XXX MUST match the entries of TableStyleProgNameTable in // sw/source/core/doc/SwStyleNameMapper.cxx and MUST match the order of // RES_POOL_TABLESTYLE_TYPE in sw/inc/poolfmt.hxx -static const char* STR_TABSTYLE_ARY[] = +const TranslateId STR_TABSTYLE_ARY[] = { // XXX MUST be in order, Writer first, then Svx old, then Svx new // 1 Writer resource string @@ -610,7 +610,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, } // Didn't find it until here -> create anew - const char* pResId = nullptr; + TranslateId pResId; if (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) { static_assert(SAL_N_ELEMENTS(STR_POOLCOLL_TEXT_ARY) == RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN, "### unexpected size!"); @@ -1437,7 +1437,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) SwFormatsBase* pArray[ 2 ]; sal_uInt16 nArrCnt = 1; - const char* pRCId = nullptr; + TranslateId pRCId; WhichRangesContainer const* pWhichRange; switch( nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) ) @@ -2574,7 +2574,7 @@ DocumentStylePoolManager::~DocumentStylePoolManager() } static std::vector<OUString> -lcl_NewUINameArray(const char** pIds, const size_t nLen, const size_t nSvxIds = 0) +lcl_NewUINameArray(const TranslateId* pIds, const size_t nLen, const size_t nSvxIds = 0) { assert(nSvxIds <= nLen); const size_t nWriterIds = nLen - nSvxIds; diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index a566ee51e112..091fc3bc743f 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1326,7 +1326,7 @@ namespace } } -static OUString lcl_GetUniqueFlyName(const SwDoc& rDoc, const char* pDefStrId, sal_uInt16 eType) +static OUString lcl_GetUniqueFlyName(const SwDoc& rDoc, TranslateId pDefStrId, sal_uInt16 eType) { assert(eType >= RES_FMT_BEGIN && eType < RES_FMT_END); if (rDoc.IsInMailMerge()) @@ -1388,7 +1388,7 @@ OUString SwDoc::GetUniqueShapeName() const OUString SwDoc::GetUniqueDrawObjectName() const { - return lcl_GetUniqueFlyName(*this, "DrawObject", RES_DRAWFRMFMT); + return lcl_GetUniqueFlyName(*this, TranslateId(nullptr, "DrawObject"), RES_DRAWFRMFMT); } const SwFlyFrameFormat* SwDoc::FindFlyByName( const OUString& rName, SwNodeType nNdTyp ) const @@ -1422,7 +1422,7 @@ void SwDoc::SetFlyName( SwFlyFrameFormat& rFormat, const OUString& rName ) OUString sName( rName ); if( sName.isEmpty() || FindFlyByName( sName ) ) { - const char* pTyp = STR_FRAME_DEFNAME; + TranslateId pTyp = STR_FRAME_DEFNAME; const SwNodeIndex* pIdx = rFormat.GetContent().GetContentIdx(); if( pIdx && pIdx->GetNode().GetNodes().IsDocNodes() ) { diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 72dff3406e96..27fbb81534f5 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -966,7 +966,7 @@ void SwRedlineData::SetExtraData( const SwRedlineExtraData* pData ) m_pExtraData = nullptr; } -static const char* STR_REDLINE_ARY[] = +const TranslateId STR_REDLINE_ARY[] = { STR_UNDO_REDLINE_INSERT, STR_UNDO_REDLINE_DELETE, diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index d95314b19961..40556d557612 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -1306,7 +1306,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr } else { - const char* pResId = nullptr; + TranslateId pResId; if( GraphicType::NONE == rGrfObj.GetType() ) pResId = STR_COMCORE_READERROR; diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 2340c1313d0f..330e5871c3ac 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -1038,7 +1038,7 @@ void SwGetRefField::ConvertProgrammaticToUIName() return; sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromProgName( rPar1, SwGetPoolIdFromName::TxtColl ); - const char* pResId = nullptr; + TranslateId pResId; switch( nPoolId ) { case RES_POOLCOLL_LABEL_ABB: diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index ab185b70d893..cf9832887d33 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -110,7 +110,7 @@ using namespace com::sun::star; namespace { -::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& rModel) +::basegfx::B2DPolyPolygon getPolygon(TranslateId pResId, const SdrModel& rModel) { ::basegfx::B2DPolyPolygon aRetval; XLineEndListRef pLineEndList(rModel.GetLineEndList()); diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx index 036f20da411c..120b43f10963 100644 --- a/sw/source/core/layout/pagedesc.cxx +++ b/sw/source/core/layout/pagedesc.cxx @@ -558,7 +558,7 @@ void SwPageDesc::RemoveStashedFormat(bool bHeader, bool bLeft, bool bFirst) } // Page styles -static const char* STR_POOLPAGE[] = +const TranslateId STR_POOLPAGE[] = { STR_POOLPAGE_STANDARD, STR_POOLPAGE_FIRST, diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index d789f91f171b..f24cfdaab814 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -226,7 +226,7 @@ SwTOXType::SwTOXType(const SwTOXType& rCopy) pRegisteredIn->Add(this); } -static const char* STR_POOLCOLL_TOX_ARY[] = +const TranslateId STR_POOLCOLL_TOX_ARY[] = { // Subcategory Index-Directories STR_POOLCOLL_TOX_IDXH, @@ -236,7 +236,7 @@ static const char* STR_POOLCOLL_TOX_ARY[] = STR_POOLCOLL_TOX_IDXBREAK }; -static const char* STR_POOLCOLL_TOX_CNTNT_ARY[] = +const TranslateId STR_POOLCOLL_TOX_CNTNT_ARY[] = { // Subcategory Tables of Contents STR_POOLCOLL_TOX_CNTNTH, @@ -247,7 +247,7 @@ static const char* STR_POOLCOLL_TOX_CNTNT_ARY[] = STR_POOLCOLL_TOX_CNTNT5 }; -static const char* STR_POOLCOLL_TOX_CNTNT_EXTRA_ARY[] = +const TranslateId STR_POOLCOLL_TOX_CNTNT_EXTRA_ARY[] = { // Subcategory Table of Contents more Levels 5 - 10 STR_POOLCOLL_TOX_CNTNT6, @@ -257,7 +257,7 @@ static const char* STR_POOLCOLL_TOX_CNTNT_EXTRA_ARY[] = STR_POOLCOLL_TOX_CNTNT10 }; -static const char* STR_POOLCOLL_TOX_USER_ARY[] = +const TranslateId STR_POOLCOLL_TOX_USER_ARY[] = { // Subcategory User-Directories: STR_POOLCOLL_TOX_USERH, @@ -268,7 +268,7 @@ static const char* STR_POOLCOLL_TOX_USER_ARY[] = STR_POOLCOLL_TOX_USER5 }; -static const char* STR_POOLCOLL_TOX_USER_EXTRA_ARY[] = +const TranslateId STR_POOLCOLL_TOX_USER_EXTRA_ARY[] = { // Subcategory User-Directories more Levels 5 - 10 STR_POOLCOLL_TOX_USER6, @@ -278,35 +278,35 @@ static const char* STR_POOLCOLL_TOX_USER_EXTRA_ARY[] = STR_POOLCOLL_TOX_USER10 }; -static const char* STR_POOLCOLL_TOX_ILLUS_ARY[] = +const TranslateId STR_POOLCOLL_TOX_ILLUS_ARY[] = { // Illustrations Index STR_POOLCOLL_TOX_ILLUSH, STR_POOLCOLL_TOX_ILLUS1 }; -static const char* STR_POOLCOLL_TOX_OBJECT_ARY[] = +const TranslateId STR_POOLCOLL_TOX_OBJECT_ARY[] = { // Object Index STR_POOLCOLL_TOX_OBJECTH, STR_POOLCOLL_TOX_OBJECT1 }; -static const char* STR_POOLCOLL_TOX_TABLES_ARY[] = +const TranslateId STR_POOLCOLL_TOX_TABLES_ARY[] = { // Tables Index STR_POOLCOLL_TOX_TABLESH, STR_POOLCOLL_TOX_TABLES1 }; -static const char* STR_POOLCOLL_TOX_AUTHORITIES_ARY[] = +const TranslateId STR_POOLCOLL_TOX_AUTHORITIES_ARY[] = { // Index of Authorities STR_POOLCOLL_TOX_AUTHORITIESH, STR_POOLCOLL_TOX_AUTHORITIES1 }; -static const char* STR_POOLCOLL_TOX_CITATION_ARY[] = +const TranslateId STR_POOLCOLL_TOX_CITATION_ARY[] = { STR_POOLCOLL_TOX_CITATION }; @@ -325,7 +325,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237# // Keyword has 3 levels + headings+ separator // Indexes of tables, object illustrations and authorities consist of a heading and one level - const char** pPoolId; + const TranslateId* pPoolId; switch( m_eType ) { case TOX_INDEX: pPoolId = STR_POOLCOLL_TOX_ARY; break; diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index a67906d0e4ad..ebe5e18a7952 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -594,7 +594,7 @@ TextAndReading SwTOXPara::GetText_Impl(SwRootFrame const*const pLayout) const return TextAndReading(pFly->GetName(), OUString()); OSL_ENSURE( false, "Graphic/object without name" ); - const char* pId = SwTOXElement::Ole == eType + TranslateId pId = SwTOXElement::Ole == eType ? STR_OBJECT_DEFNAME : SwTOXElement::Graphic == eType ? STR_GRAPHIC_DEFNAME diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 02d2a5327c38..a9566b770ae8 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -271,7 +271,7 @@ void SwUndo::RepeatImpl( ::sw::RepeatContext & ) OUString GetUndoComment(SwUndoId eId) { - const char *pId = nullptr; + TranslateId pId; switch (eId) { case SwUndoId::EMPTY: diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 91cdb37a8c53..50aa72b76894 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1226,7 +1226,7 @@ sal_Bool SwXNumberingRules::hasElements() return true; } -static const char* STR_POOLCOLL_HEADLINE_ARY[] +const TranslateId STR_POOLCOLL_HEADLINE_ARY[] { STR_POOLCOLL_HEADLINE1, STR_POOLCOLL_HEADLINE2, diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 3012637bbe4c..f2f3f3e43b13 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -136,11 +136,11 @@ class SwStyleProperties_Impl; uno::Reference<beans::XPropertySetInfo> m_xPSInfo; SwGetPoolIdFromName m_aPoolId; OUString m_sName; - const char* m_pResId; + TranslateId m_pResId; GetCountOrName_t m_fGetCountOrName; CreateStyle_t m_fCreateStyle; TranslateIndex_t m_fTranslateIndex; - StyleFamilyEntry(SfxStyleFamily eFamily, sal_uInt16 nPropMapType, SwGetPoolIdFromName aPoolId, OUString const& sName, const char* pResId, GetCountOrName_t const & fGetCountOrName, CreateStyle_t const & fCreateStyle, TranslateIndex_t const & fTranslateIndex) + StyleFamilyEntry(SfxStyleFamily eFamily, sal_uInt16 nPropMapType, SwGetPoolIdFromName aPoolId, OUString const& sName, TranslateId pResId, GetCountOrName_t const & fGetCountOrName, CreateStyle_t const & fCreateStyle, TranslateIndex_t const & fTranslateIndex) : m_eFamily(eFamily) , m_nPropMapType(nPropMapType) , m_xPSInfo(aSwMapProvider.GetPropertySet(nPropMapType)->getPropertySetInfo()) @@ -1546,7 +1546,7 @@ public: }; }; - const char* STR_POOLPAGE_ARY[] = + const TranslateId STR_POOLPAGE_ARY[] = { // Page styles STR_POOLPAGE_STANDARD, diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx index e7d5ad8a3930..9fcc33c77ac9 100644 --- a/sw/source/ui/fldui/flddok.cxx +++ b/sw/source/ui/fldui/flddok.cxx @@ -426,7 +426,7 @@ IMPL_LINK_NOARG(SwFieldDokPage, SubTypeHdl, weld::TreeView&, void) const SwFieldTypesEnum nTypeId = static_cast<SwFieldTypesEnum>(m_xSelectionLB->get_id(nPos).toUInt32()); FillFormatLB(nTypeId); - const char* pTextRes = nullptr; + TranslateId pTextRes; switch (nTypeId) { case SwFieldTypesEnum::Chapter: diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 9e61530b172a..9679691a6323 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -174,7 +174,7 @@ void SwFieldFuncPage::Reset(const SfxItemSet* ) } } -static const char* FMT_MARK_ARY[] = +const TranslateId FMT_MARK_ARY[] = { FMT_MARK_TEXT, FMT_MARK_TABLE, diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 21dcb0ca39fd..94f3397046fc 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -747,7 +747,7 @@ enum FMT_REF_IDX } -static const char* FMT_REF_ARY[] = +const TranslateId FMT_REF_ARY[] = { FMT_REF_PAGE, FMT_REF_CHAPTER, diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 0477ab25600f..397e062d7da5 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1727,7 +1727,7 @@ IMPL_LINK_NOARG(SwTOXButton, FocusInHdl, weld::Widget&, void) namespace { - const char* STR_AUTH_FIELD_ARY[] = + const TranslateId STR_AUTH_FIELD_ARY[] = { STR_AUTH_FIELD_IDENTIFIER, STR_AUTH_FIELD_AUTHORITY_TYPE, @@ -2521,13 +2521,13 @@ void SwTOXEntryTabPage::SetWrtShell(SwWrtShell& rSh) RES_POOLCHR_IDX_MAIN_ENTRY, OUString())); } -static const char* STR_TOKEN_ARY[] = + const TranslateId STR_TOKEN_ARY[] = { STR_TOKEN_ENTRY_NO, STR_TOKEN_ENTRY, //mapped from original STR_TOKEN_ENTRY_TEXT, STR_TOKEN_ENTRY, STR_TOKEN_TAB_STOP, - nullptr, + {}, STR_TOKEN_PAGE_NUMS, STR_TOKEN_CHAPTER_INFO, STR_TOKEN_LINK_START, @@ -2535,7 +2535,7 @@ static const char* STR_TOKEN_ARY[] = STR_TOKEN_AUTHORITY }; -static const char* STR_TOKEN_HELP_ARY[] = + const TranslateId STR_TOKEN_HELP_ARY[] = { STR_TOKEN_HELP_ENTRY_NO, STR_TOKEN_HELP_ENTRY, // mapped from original STR_TOKEN_HELP_ENTRY_TEXT, @@ -2569,11 +2569,11 @@ SwTokenWindow::SwTokenWindow(std::unique_ptr<weld::Container> xParent) for (sal_uInt32 i = 0; i < TOKEN_END; ++i) { - const char* pTextId = STR_TOKEN_ARY[i]; + TranslateId pTextId = STR_TOKEN_ARY[i]; if (pTextId) m_aButtonTexts[i] = SwResId(pTextId); - const char* pHelpId = STR_TOKEN_HELP_ARY[i]; + TranslateId pHelpId = STR_TOKEN_HELP_ARY[i]; m_aButtonHelpTexts[i] = SwResId(pHelpId); } diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 291ff0572e6c..d090a1cf2028 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -1526,7 +1526,7 @@ void SwAuthorMarkPane::Activate() namespace { - const char* STR_AUTH_FIELD_ARY[] = + const TranslateId STR_AUTH_FIELD_ARY[] = { STR_AUTH_FIELD_IDENTIFIER, STR_AUTH_FIELD_AUTHORITY_TYPE, diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 8e297f06298f..c581f56b50e7 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -972,7 +972,7 @@ void SwDocShell::Execute(SfxRequest& rReq) uno::Reference < XFilePicker3 > xFP = aDlgHelper.GetFilePicker(); std::shared_ptr<const SfxFilter> pFlt; - const char* pStrId; + TranslateId pStrId; if( bCreateHtml ) { diff --git a/sw/source/uibase/app/mainwn.cxx b/sw/source/uibase/app/mainwn.cxx index dbb6da6e405e..7c21797f8e3d 100644 --- a/sw/source/uibase/app/mainwn.cxx +++ b/sw/source/uibase/app/mainwn.cxx @@ -49,7 +49,7 @@ static SwProgress *lcl_SwFindProgress( SwDocShell const *pDocShell ) return nullptr; } -void StartProgress( const char* pMessResId, tools::Long nStartValue, tools::Long nEndValue, +void StartProgress( TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell ) { if( SW_MOD()->IsEmbeddedLoadSave() ) diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index b0c68b7d72c0..51052b8f82b6 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -162,14 +162,14 @@ SwModule::SwModule( SfxObjectFactory* pWebFact, } } -OUString SwResId(std::string_view aId) +OUString SwResId(TranslateId aId) { return Translate::get(aId, SW_MOD()->GetResLocale()); } -OUString SwResId(std::string_view aId, int nCardinality) +OUString SwResId(TranslateNId aContextSingularPlural, int nCardinality) { - return Translate::nget(aId, nCardinality, SW_MOD()->GetResLocale()); + return Translate::nget(aContextSingularPlural, nCardinality, SW_MOD()->GetResLocale()); } uno::Reference< scanner::XScannerManager2 > const & diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index c36b6d87837b..bae05b03ac66 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2095,7 +2095,7 @@ SotExchangeDest SwTransferable::GetSotDestination( const SwWrtShell& rSh ) bool SwTransferable::PasteFileContent( TransferableDataHelper& rData, SwWrtShell& rSh, SotClipboardFormatId nFormat, bool bMsg, bool bIgnoreComments ) { - const char* pResId = STR_CLPBRD_FORMAT_ERROR; + TranslateId pResId = STR_CLPBRD_FORMAT_ERROR; bool bRet = false; MSE40HTMLClipFormatObj aMSE40ClpObj; @@ -2173,7 +2173,7 @@ bool SwTransferable::PasteFileContent( TransferableDataHelper& rData, pResId = STR_ERROR_CLPBRD_READ; else { - pResId = nullptr; + pResId = TranslateId(); bRet = true; } @@ -3436,19 +3436,17 @@ void SwTransferable::PrePasteSpecial( const SwWrtShell& rSh, TransferableDataHel if( pClipboard ) { aDesc = pClipboard->m_aObjDesc; - const char* pResId; + TranslateId pResId; if( pClipboard->m_eBufferType & TransferBufferType::Document ) pResId = STR_PRIVATETEXT; else if( pClipboard->m_eBufferType & TransferBufferType::Graphic ) pResId = STR_PRIVATEGRAPHIC; else if( pClipboard->m_eBufferType == TransferBufferType::Ole ) pResId = STR_PRIVATEOLE; - else - pResId = nullptr; if (pResId) { - if (strcmp(STR_PRIVATEOLE, pResId) == 0 || strcmp(STR_PRIVATEGRAPHIC, pResId) == 0) + if (STR_PRIVATEOLE == pResId || STR_PRIVATEGRAPHIC == pResId) { // add SotClipboardFormatId::EMBED_SOURCE to the formats. This // format display then the private format name. @@ -3492,15 +3490,13 @@ void SwTransferable::FillClipFormatItem( const SwWrtShell& rSh, SwTransferable *pClipboard = GetSwTransferable( rData ); if( pClipboard ) { - const char* pResId; + TranslateId pResId; if( pClipboard->m_eBufferType & TransferBufferType::Document ) pResId = STR_PRIVATETEXT; else if( pClipboard->m_eBufferType & TransferBufferType::Graphic ) pResId = STR_PRIVATEGRAPHIC; else if( pClipboard->m_eBufferType == TransferBufferType::Ole ) pResId = STR_PRIVATEOLE; - else - pResId = nullptr; if (pResId) rToFill.AddClipbrdFormat(SotClipboardFormatId::EMBED_SOURCE, diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index 06aa389891b6..b9dde38dc1a7 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -170,12 +170,12 @@ OUString SidebarTextControl::RequestHelp(tools::Rectangle& rHelpRect) } } - const char* pResId = nullptr; + TranslateId pResId; switch( mrSidebarWin.GetLayoutStatus() ) { case SwPostItHelper::INSERTED: pResId = STR_REDLINE_INSERT; break; case SwPostItHelper::DELETED: pResId = STR_REDLINE_DELETE; break; - default: pResId = nullptr; + default: break; } SwContentAtPos aContentAtPos( IsAttrAtPos::Redline ); diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index c2c196c329b8..4f98553cd38c 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -57,7 +57,7 @@ static OUString lcl_GetRedlineHelp( const SwRangeRedline& rRedl, bool bBalloon ) { - const char* pResId = nullptr; + TranslateId pResId; switch( rRedl.GetType() ) { case RedlineType::Insert: pResId = STR_REDLINE_INSERT; break; diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 5279ee15b144..99ac9ec5b577 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -127,7 +127,7 @@ const sal_uInt16 VF_COUNT = 1; // { 0 } const sal_uInt16 VF_USR_COUNT = 2; // { 0, nsSwExtendedSubType::SUB_CMD } const sal_uInt16 VF_DB_COUNT = 1; // { nsSwExtendedSubType::SUB_OWN_FMT } -static const char* FLD_EU_ARY[] = +const TranslateId FLD_EU_ARY[] = { FLD_EU_COMPANY, FLD_EU_GIVENNAME, @@ -146,25 +146,25 @@ static const char* FLD_EU_ARY[] = FLD_EU_REGION }; -static const char* FMT_AUTHOR_ARY[] = +const TranslateId FMT_AUTHOR_ARY[] = { FMT_AUTHOR_NAME, FMT_AUTHOR_SCUT }; -static const char* FLD_DATE_ARY[] = +const TranslateId FLD_DATE_ARY[] = { FLD_DATE_FIX, FLD_DATE_STD, }; -static const char* FLD_TIME_ARY[] = +const TranslateId FLD_TIME_ARY[] = { FLD_TIME_FIX, FLD_TIME_STD }; -static const char* FMT_NUM_ARY[] = +const TranslateId FMT_NUM_ARY[] = { FMT_NUM_ABC, FMT_NUM_SABC, @@ -177,7 +177,7 @@ static const char* FMT_NUM_ARY[] = FMT_NUM_PAGESPECIAL }; -static const char* FMT_FF_ARY[] = +const TranslateId FMT_FF_ARY[] = { FMT_FF_NAME, FMT_FF_PATHNAME, @@ -187,7 +187,7 @@ static const char* FMT_FF_ARY[] = FMT_FF_UI_RANGE }; -static const char* FLD_STAT_ARY[] = +const TranslateId FLD_STAT_ARY[] = { FLD_STAT_PAGE, FLD_STAT_PARA, @@ -198,7 +198,7 @@ static const char* FLD_STAT_ARY[] = FLD_STAT_OBJ }; -static const char* FMT_CHAPTER_ARY[] = +const TranslateId FMT_CHAPTER_ARY[] = { FMT_CHAPTER_NO, FMT_CHAPTER_NAME, @@ -206,12 +206,12 @@ static const char* FMT_CHAPTER_ARY[] = FMT_CHAPTER_NO_NOSEPARATOR }; -static const char* FLD_INPUT_ARY[] = +const TranslateId FLD_INPUT_ARY[] = { FLD_INPUT_TEXT }; -static const char* FMT_MARK_ARY[] = +const TranslateId FMT_MARK_ARY[] = { FMT_MARK_TEXT, FMT_MARK_TABLE, @@ -220,7 +220,7 @@ static const char* FMT_MARK_ARY[] = FMT_MARK_OLE }; -static const char* FMT_REF_ARY[] = +const TranslateId FMT_REF_ARY[] = { FMT_REF_PAGE, FMT_REF_CHAPTER, @@ -235,44 +235,44 @@ static const char* FMT_REF_ARY[] = FMT_REF_NUMBER_FULL_CONTEXT }; -static const char* FMT_REG_ARY[] = +const TranslateId FMT_REG_ARY[] = { FMT_REG_AUTHOR, FMT_REG_TIME, FMT_REG_DATE }; -static const char* FMT_DBFLD_ARY[] = +const TranslateId FMT_DBFLD_ARY[] = { FMT_DBFLD_DB, FMT_DBFLD_SYS }; -static const char* FMT_SETVAR_ARY[] = +const TranslateId FMT_SETVAR_ARY[] = { FMT_SETVAR_SYS, FMT_SETVAR_TEXT }; -static const char* FMT_GETVAR_ARY[] = +const TranslateId FMT_GETVAR_ARY[] = { FMT_GETVAR_TEXT, FMT_GETVAR_NAME }; -static const char* FMT_DDE_ARY[] = +const TranslateId FMT_DDE_ARY[] = { FMT_DDE_NORMAL, FMT_DDE_HOT }; -static const char* FLD_PAGEREF_ARY[] = +const TranslateId FLD_PAGEREF_ARY[] = { FLD_PAGEREF_OFF, FLD_PAGEREF_ON }; -static const char* FMT_USERVAR_ARY[] = +const TranslateId FMT_USERVAR_ARY[] = { FMT_USERVAR_TEXT, FMT_USERVAR_CMD @@ -285,10 +285,10 @@ struct SwFieldPack { SwFieldTypesEnum nTypeId; - const char** pSubTypeResIds; + const TranslateId* pSubTypeResIds; size_t nSubTypeLength; - const char** pFormatResIds; + const TranslateId* pFormatResIds; size_t nFormatLength; }; @@ -684,17 +684,17 @@ sal_uInt16 SwFieldMgr::GetFormatCount(SwFieldTypesEnum nTypeId, bool bHtmlMode) if (nTypeId == SwFieldTypesEnum::Filename) nCount -= 2; // no range or template - const char** pStart = aSwFields[nPos].pFormatResIds; + const TranslateId* pStart = aSwFields[nPos].pFormatResIds; if (!pStart) return nCount; - if (strcmp(*pStart, FMT_GETVAR_ARY[0]) == 0 || strcmp(*pStart, FMT_SETVAR_ARY[0]) == 0) + if (*pStart == FMT_GETVAR_ARY[0] || *pStart == FMT_SETVAR_ARY[0]) return VF_COUNT; - else if (strcmp(*pStart, FMT_USERVAR_ARY[0]) == 0) + else if (*pStart == FMT_USERVAR_ARY[0]) return VF_USR_COUNT; - else if (strcmp(*pStart, FMT_DBFLD_ARY[0]) == 0) + else if (*pStart == FMT_DBFLD_ARY[0]) return VF_DB_COUNT; - else if (strcmp(*pStart, FMT_NUM_ARY[0]) == 0) + else if (*pStart == FMT_NUM_ARY[0]) { GetNumberingInfo(); if(m_xNumberingInfo.is()) @@ -721,7 +721,7 @@ OUString SwFieldMgr::GetFormatStr(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatId if (nPos == USHRT_MAX) return OUString(); - const char** pStart = aSwFields[nPos].pFormatResIds; + const TranslateId* pStart = aSwFields[nPos].pFormatResIds; if (!pStart) return OUString(); @@ -774,7 +774,7 @@ sal_uInt16 SwFieldMgr::GetFormatId(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatI { case SwFieldTypesEnum::DocumentInfo: { - const OString sId(aSwFields[GetPos(nTypeId)].pFormatResIds[nFormatId]); + TranslateId sId = aSwFields[GetPos(nTypeId)].pFormatResIds[nFormatId]; if (sId == FMT_REG_AUTHOR) nId = DI_SUB_AUTHOR; else if (sId == FMT_REG_TIME) @@ -794,7 +794,7 @@ sal_uInt16 SwFieldMgr::GetFormatId(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatI sal_uInt16 nPos = GetPos(nTypeId); if (nFormatId < aSwFields[nPos].nFormatLength) { - const OString sId(aSwFields[nPos].pFormatResIds[nFormatId]); + const TranslateId sId = aSwFields[nPos].pFormatResIds[nFormatId]; if (sId == FMT_NUM_ABC) nId = SVX_NUM_CHARS_UPPER_LETTER; else if (sId == FMT_NUM_SABC) @@ -836,7 +836,7 @@ sal_uInt16 SwFieldMgr::GetFormatId(SwFieldTypesEnum nTypeId, sal_uInt32 nFormatI } case SwFieldTypesEnum::DDE: { - const OString sId(aSwFields[GetPos(nTypeId)].pFormatResIds[nFormatId]); + const TranslateId sId = aSwFields[GetPos(nTypeId)].pFormatResIds[nFormatId]; if (sId == FMT_DDE_NORMAL) nId = static_cast<sal_uInt16>(SfxLinkUpdateMode::ONCALL); else if (sId == FMT_DDE_HOT) @@ -1743,7 +1743,7 @@ LanguageType SwFieldMgr::GetCurrLanguage() const void SwFieldType::GetFieldName_() { - static const char* coFieldNms[] = + static const TranslateId coFieldNms[] = { FLD_DATE_STD, FLD_TIME_STD, @@ -1795,7 +1795,7 @@ void SwFieldType::GetFieldName_() // insert infos for fields SwFieldType::s_pFieldNames = new std::vector<OUString>; SwFieldType::s_pFieldNames->reserve(SAL_N_ELEMENTS(coFieldNms)); - for (const char* id : coFieldNms) + for (const TranslateId & id : coFieldNms) { const OUString aTmp(SwResId(id)); SwFieldType::s_pFieldNames->push_back(MnemonicGenerator::EraseAllMnemonicChars( aTmp )); diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index bc334e1303ac..bcfdf3ed4de6 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -1091,7 +1091,7 @@ IMPL_LINK(SwRedlineAcceptDlg, CommandHdl, const CommandEvent&, rCEvt, bool) pDlg->HideAuthor(); - const char* pResId = nullptr; + TranslateId pResId; switch( rRedline.GetType() ) { case RedlineType::Insert: diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx index b53987593c4f..e26e9aa41d5c 100644 --- a/sw/source/uibase/misc/swruler.cxx +++ b/sw/source/uibase/misc/swruler.cxx @@ -301,7 +301,7 @@ void SwCommentRuler::Update() void SwCommentRuler::UpdateCommentHelpText() { - const char* pTooltipResId; + TranslateId pTooltipResId; if (mpViewShell->GetPostItMgr()->ShowNotes()) pTooltipResId = STR_HIDE_COMMENTS; else diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 2c7e08c23a56..ed95ca1cdb1b 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -209,7 +209,7 @@ std::u16string_view const aNavigationImgIds[ NAVI_ENTRIES ] = u"" RID_BMP_RIBBAR_FIELD_BYTYPE }; -static const char* aNavigationStrIds[ NAVI_ENTRIES ] = +const TranslateId aNavigationStrIds[ NAVI_ENTRIES ] = { ST_TBL, ST_FRM, @@ -235,7 +235,7 @@ static const char* aNavigationStrIds[ NAVI_ENTRIES ] = }; // these are global strings -static const char* STR_IMGBTN_ARY[] = +const TranslateId STR_IMGBTN_ARY[] = { STR_IMGBTN_TBL_DOWN, STR_IMGBTN_FRM_DOWN, @@ -362,13 +362,13 @@ SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot) m_xWidget->connect_entry_activate(LINK(this, SwZoomBox_Impl, ActivateHdl)); m_xWidget->connect_focus_out(LINK(this, SwZoomBox_Impl, FocusOutHdl)); - const char* const aZoomValues[] = + const TranslateId aZoomValues[] = { RID_SVXSTR_ZOOM_25 , RID_SVXSTR_ZOOM_50 , RID_SVXSTR_ZOOM_75 , RID_SVXSTR_ZOOM_100 , RID_SVXSTR_ZOOM_150 , RID_SVXSTR_ZOOM_200 , RID_SVXSTR_ZOOM_WHOLE_PAGE, RID_SVXSTR_ZOOM_PAGE_WIDTH , RID_SVXSTR_ZOOM_OPTIMAL_VIEW }; - for(const char* pZoomValue : aZoomValues) + for(const TranslateId& pZoomValue : aZoomValues) { OUString sEntry = SvxResId(pZoomValue); m_xWidget->append_text(sEntry); @@ -761,7 +761,7 @@ void NavElementBox_Base::UpdateBox() { if ( nMoveType == aNavigationInsertIds[i] ) { - const char* id = aNavigationStrIds[i]; + TranslateId id = aNavigationStrIds[i]; OUString sText = SwResId( id ); m_xWidget->set_active_text(sText); break; diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 3c7fe4317632..184fe96e5d8f 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -70,7 +70,7 @@ static OUString lcl_BuildTitleWithRedline( const SwRangeRedline *pRedline ) { const OUString sTitle(SwResId(STR_REDLINE_COMMENT)); - const char* pResId = nullptr; + TranslateId pResId; switch( pRedline->GetType() ) { case RedlineType::Insert: diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index a59143ba8d48..bd7274bde397 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -80,7 +80,7 @@ WriterInspectorTextPanel::~WriterInspectorTextPanel() { m_pShell->SetChgLnk(m_ol static OUString PropertyNametoRID(const OUString& rName) { - static const std::map<OUString, const char*> aNameToRID = { + static const std::map<OUString, TranslateId> aNameToRID = { { "BorderDistance", RID_BORDER_DISTANCE }, { "BottomBorder", RID_BOTTOM_BORDER }, { "BottomBorderDistance", RID_BOTTOM_BORDER_DISTANCE }, diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index a6953b7c1e59..ca1751702b71 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -492,7 +492,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) rSh.SetFrameFormat( pFormat ); } - const char* pResId(nullptr); + TranslateId pResId; if( nError == ERRCODE_GRFILTER_OPENERROR ) pResId = STR_GRFILTER_OPENERROR; else if( nError == ERRCODE_GRFILTER_IOERROR ) @@ -1522,9 +1522,9 @@ void SwView::StateStatusLine(SfxItemSet &rSet) sal_uLong nWord = selectionStats.nWord ? selectionStats.nWord : documentStats.nWord; sal_uLong nChar = selectionStats.nChar ? selectionStats.nChar : documentStats.nChar; - const char* pResId = selectionStats.nWord ? STR_WORDCOUNT : STR_WORDCOUNT_NO_SELECTION; - const char* pWordResId = selectionStats.nWord ? STR_WORDCOUNT_WORDARG : STR_WORDCOUNT_WORDARG_NO_SELECTION; - const char* pCharResId = selectionStats.nWord ? STR_WORDCOUNT_CHARARG : STR_WORDCOUNT_CHARARG_NO_SELECTION; + TranslateId pResId = selectionStats.nWord ? STR_WORDCOUNT : STR_WORDCOUNT_NO_SELECTION; + TranslateNId pWordResId = selectionStats.nWord ? STR_WORDCOUNT_WORDARG : STR_WORDCOUNT_WORDARG_NO_SELECTION; + TranslateNId pCharResId = selectionStats.nWord ? STR_WORDCOUNT_CHARARG : STR_WORDCOUNT_CHARARG_NO_SELECTION; const LocaleDataWrapper& rLocaleData = Application::GetSettings().GetUILocaleDataWrapper(); OUString aWordArg = SwResId(pWordResId, nWord).replaceAll("$1", rLocaleData.getNum(nWord, 0)); diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 98ca19acd8b8..1921c30d045a 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -189,7 +189,7 @@ void SwView::ExecutePrint(SfxRequest& rReq) std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetEditWin().GetFrameWeld(), VclMessageType::Info, VclButtonsType::Ok, SwResId(STR_ERR_NO_FAX))); - const char* pResId = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS; + TranslateId pResId = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS; xInfoBox->set_primary_text(xInfoBox->get_primary_text().replaceFirst("%1", SwResId(pResId))); xInfoBox->run(); SfxUInt16Item aDefPage(SID_SW_EDITOPTIONS, TP_OPTPRINT_PAGE); diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx index e20b38787f97..71fdd4ab5436 100644 --- a/sw/source/uibase/utlui/attrdesc.cxx +++ b/sw/source/uibase/utlui/attrdesc.cxx @@ -175,7 +175,7 @@ bool SwRegisterItem::GetPresentation const IntlWrapper& /*rIntl*/ ) const { - const char* pId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF; + TranslateId pId = GetValue() ? STR_REGISTER_ON : STR_REGISTER_OFF; rText = SwResId(pId); return true; } @@ -205,7 +205,7 @@ bool SwParaConnectBorderItem::GetPresentation const IntlWrapper& /*rIntl*/ ) const { - const char* pId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF; + TranslateId pId = GetValue() ? STR_CONNECT_BORDER_ON : STR_CONNECT_BORDER_OFF; rText = SwResId(pId); return true; } @@ -234,7 +234,7 @@ bool SwFormatFrameSize::GetPresentation } if ( SwFrameSize::Variable != GetHeightSizeType() ) { - const char* pId = SwFrameSize::Fixed == m_eFrameHeightType ? + TranslateId pId = SwFrameSize::Fixed == m_eFrameHeightType ? STR_FRM_FIXEDHEIGHT : STR_FRM_MINHEIGHT; rText += ", " + SwResId(pId) + " "; if ( GetHeightPercent() ) @@ -263,7 +263,7 @@ bool SwFormatHeader::GetPresentation const IntlWrapper& /*rIntl*/ ) const { - const char* pId = GetHeaderFormat() ? STR_HEADER : STR_NO_HEADER; + TranslateId pId = GetHeaderFormat() ? STR_HEADER : STR_NO_HEADER; rText = SwResId(pId); return true; } @@ -280,7 +280,7 @@ bool SwFormatFooter::GetPresentation const IntlWrapper& /*rIntl*/ ) const { - const char* pId = GetFooterFormat() ? STR_FOOTER : STR_NO_FOOTER; + TranslateId pId = GetFooterFormat() ? STR_FOOTER : STR_NO_FOOTER; rText = SwResId(pId); return true; } @@ -294,7 +294,7 @@ bool SwFormatSurround::GetPresentation const IntlWrapper& /*rIntl*/ ) const { - const char* pId = nullptr; + TranslateId pId; switch ( GetValue() ) { case css::text::WrapTextMode_NONE: @@ -338,7 +338,7 @@ bool SwFormatVertOrient::GetPresentation const IntlWrapper& rIntl ) const { - const char* pId = nullptr; + TranslateId pId; switch ( GetVertOrient() ) { case text::VertOrientation::NONE: @@ -384,7 +384,7 @@ bool SwFormatHoriOrient::GetPresentation const IntlWrapper& rIntl ) const { - const char* pId = nullptr; + TranslateId pId; switch ( GetHoriOrient() ) { case text::HoriOrientation::NONE: @@ -430,7 +430,7 @@ bool SwFormatAnchor::GetPresentation const IntlWrapper& /*rIntl*/ ) const { - const char* pId = nullptr; + TranslateId pId; switch ( GetAnchorId() ) { case RndStdIds::FLY_AT_PARA: @@ -641,7 +641,7 @@ bool SwTextGridItem::GetPresentation const IntlWrapper& /*rIntl*/ ) const { - const char* pId = nullptr; + TranslateId pId; switch ( GetGridType() ) { @@ -678,14 +678,14 @@ bool SwMirrorGrf::GetPresentation( SfxItemPresentation /*ePres*/, MapUnit /*eCoreUnit*/, MapUnit /*ePresUnit*/, OUString& rText, const IntlWrapper& /*rIntl*/ ) const { - const char* pId; + TranslateId pId; switch( GetValue() ) { case MirrorGraph::Dont: pId = STR_NO_MIRROR; break; case MirrorGraph::Vertical: pId = STR_VERT_MIRROR; break; case MirrorGraph::Horizontal: pId = STR_HORI_MIRROR; break; case MirrorGraph::Both: pId = STR_BOTH_MIRROR; break; - default: pId = nullptr; break; + default: break; } if (pId) { @@ -740,13 +740,13 @@ bool SwChannelGrf::GetPresentation( { if( SfxItemPresentation::Complete == ePres ) { - const char* pId; + TranslateId pId; switch ( Which() ) { case RES_GRFATR_CHANNELR: pId = STR_CHANNELR; break; case RES_GRFATR_CHANNELG: pId = STR_CHANNELG; break; case RES_GRFATR_CHANNELB: pId = STR_CHANNELB; break; - default: pId = nullptr; break; + default: break; } if (pId) rText = SwResId(pId); @@ -780,7 +780,7 @@ bool SwInvertGrf::GetPresentation( rText.clear(); if( SfxItemPresentation::Complete == ePres ) { - const char* pId = GetValue() ? STR_INVERT : STR_INVERT_NOT; + TranslateId pId = GetValue() ? STR_INVERT : STR_INVERT_NOT; rText = SwResId(pId); } return true; @@ -806,7 +806,7 @@ bool SwDrawModeGrf::GetPresentation( rText.clear(); if( SfxItemPresentation::Complete == ePres ) { - const char* pId; + TranslateId pId; switch ( GetValue() ) { @@ -829,7 +829,7 @@ bool SwFormatFollowTextFlow::GetPresentation( SfxItemPresentation ePres, rText.clear(); if( SfxItemPresentation::Complete == ePres ) { - const char* pId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW; + TranslateId pId = GetValue() ? STR_FOLLOW_TEXT_FLOW : STR_DONT_FOLLOW_TEXT_FLOW; rText = SwResId(pId); } return true; diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 08c8b8764dc0..0a14d3d12abb 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -238,7 +238,7 @@ SwTOXBaseContent::~SwTOXBaseContent() { } -static const char* STR_CONTENT_TYPE_ARY[] = +const TranslateId STR_CONTENT_TYPE_ARY[] = { STR_CONTENT_TYPE_OUTLINE, STR_CONTENT_TYPE_TABLE, @@ -255,7 +255,7 @@ static const char* STR_CONTENT_TYPE_ARY[] = STR_CONTENT_TYPE_TEXTFIELD }; -static const char* STR_CONTENT_TYPE_SINGLE_ARY[] = +const TranslateId STR_CONTENT_TYPE_SINGLE_ARY[] = { STR_CONTENT_TYPE_SINGLE_OUTLINE, STR_CONTENT_TYPE_SINGLE_TABLE, @@ -1038,7 +1038,7 @@ enum STR_CONTEXT_IDX } -static const char* STR_CONTEXT_ARY[] = +const TranslateId STR_CONTEXT_ARY[] = { STR_OUTLINE_LEVEL, STR_DRAGMODE, diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 516e0789fe4a..ab8beedabc41 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -105,7 +105,7 @@ enum GLOBAL_CONTEXT_IDX } -static const char* GLOBAL_CONTEXT_ARY[] = +const TranslateId GLOBAL_CONTEXT_ARY[] = { STR_UPDATE, STR_EDIT_CONTENT, diff --git a/sw/source/uibase/utlui/initui.cxx b/sw/source/uibase/utlui/initui.cxx index 4a07f75678e2..740152dd89ad 100644 --- a/sw/source/uibase/utlui/initui.cxx +++ b/sw/source/uibase/utlui/initui.cxx @@ -91,7 +91,7 @@ void InitUI() SwEditWin::InitStaticData(); } -static const char* FLD_DOCINFO_ARY[] = +const TranslateId FLD_DOCINFO_ARY[] = { FLD_DOCINFO_TITLE, FLD_DOCINFO_SUBJECT, @@ -202,7 +202,7 @@ void ShellResource::GetAutoFormatNameLst_() const namespace { - const char* STR_AUTH_FIELD_ARY[] = + const TranslateId STR_AUTH_FIELD_ARY[] = { STR_AUTH_FIELD_IDENTIFIER, STR_AUTH_FIELD_AUTHORITY_TYPE, @@ -251,7 +251,7 @@ OUString const & SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType) return (*pAuthFieldNameList)[static_cast< sal_uInt16 >(eType)]; } -static const char* STR_AUTH_TYPE_ARY[] = +const TranslateId STR_AUTH_TYPE_ARY[] = { STR_AUTH_TYPE_ARTICLE, STR_AUTH_TYPE_BOOK, diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 1567f7605d7e..186934f0fc75 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -542,14 +542,14 @@ SwNavigationPI::SwNavigationPI(weld::Widget* pParent, m_xContent1ToolBox->set_item_visible("contenttoggle", false); } - const char* REGIONNAME_ARY[] = + const TranslateId REGIONNAME_ARY[] = { STR_HYPERLINK, STR_LINK_REGION, STR_COPY_REGION }; - const char* REGIONMODE_ARY[] = + const TranslateId REGIONMODE_ARY[] = { STR_HIDDEN, STR_ACTIVE, diff --git a/sw/source/uibase/wrtsh/wrtundo.cxx b/sw/source/uibase/wrtsh/wrtundo.cxx index 6b087fad7b6d..82bb28109c60 100644 --- a/sw/source/uibase/wrtsh/wrtundo.cxx +++ b/sw/source/uibase/wrtsh/wrtundo.cxx @@ -95,7 +95,7 @@ void SwWrtShell::Do( DoType eDoType, sal_uInt16 nCnt ) OUString SwWrtShell::GetDoString( DoType eDoType ) const { OUString aUndoStr; - const char* pResStr = STR_UNDO; + TranslateId pResStr = STR_UNDO; switch( eDoType ) { case UNDO: |