diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-07 13:11:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-07 15:38:57 +0000 |
commit | 66849453041de0369dc8abe8f172dce2bf4cdaab (patch) | |
tree | 7b7a3de4af9f43aeecb2507378b363d8f6caab7e /sw | |
parent | 6efdd843c831527b2880959746c302fca87c40db (diff) |
convert resources containing strings to stringarray resources
Change-Id: I61e815a9545f55a3b886322e7d2c0d50040584bd
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/utlui/utlui.src | 114 | ||||
-rw-r--r-- | sw/source/uibase/utlui/initui.cxx | 22 |
2 files changed, 31 insertions, 105 deletions
diff --git a/sw/source/ui/utlui/utlui.src b/sw/source/ui/utlui/utlui.src index 61f465374245..574f52e04777 100644 --- a/sw/source/ui/utlui/utlui.src +++ b/sw/source/ui/utlui/utlui.src @@ -22,99 +22,33 @@ #include "helpid.h" #include "comcore.hrc" -Resource RID_SHELLRES_AUTOFMTSTRS +StringArray RID_SHELLRES_AUTOFMTSTRS { - String STR_AUTOFMTREDL_DEL_EMPTY_PARA+1 + ItemList [ en-US ] = { - Text [ en-US ] = "Remove empty paragraphs" ; + < "Remove empty paragraphs" ; > ; + < "Use replacement table" ; > ; + < "Correct TWo INitial CApitals" ; > ; + < "Capitalize first letter of sentences" ; > ; + < "Replace \"standard\" quotes with %1 \bcustom%2 quotes" ; > ; + < "Replace Custom Styles" ; > ; + < "Bullets replaced"; > ; + < "Automatic _underline_"; > ; + < "Automatic *bold*"; > ; + < "Replace 1/2 ... with ½ ..." ; > ; + < "URL recognition" ; > ; + < "Replace dashes" ; > ; + < "Replace 1st... with 1^st..." ; > ; + < "Combine single line paragraphs"; > ; + < "Set \"Text body\" Style"; > ; + < "Set \"Text body indent\" Style"; > ; + < "Set \"Hanging indent\" Style"; > ; + < "Set \"Text body indent\" Style"; > ; + < "Set \"Heading $(ARG1)\" Style"; > ; + < "Set \"Bullet\" or \"Numbering\" Style"; > ; + < "Combine paragraphs"; > ; + < "Add non breaking space"; > ; }; - String STR_AUTOFMTREDL_USE_REPLACE+1 - { - Text [ en-US ] = "Use replacement table" ; - }; - String STR_AUTOFMTREDL_CPTL_STT_WORD+1 - { - Text [ en-US ] = "Correct TWo INitial CApitals" ; - }; - String STR_AUTOFMTREDL_CPTL_STT_SENT+1 - { - Text [ en-US ] = "Capitalize first letter of sentences" ; - }; - String STR_AUTOFMTREDL_TYPO+1 - { - Text [ en-US ] = "Replace \"standard\" quotes with %1 \bcustom%2 quotes" ; - }; - String STR_AUTOFMTREDL_USER_STYLE+1 - { - Text [ en-US ] = "Replace Custom Styles" ; - }; - String STR_AUTOFMTREDL_BULLET+1 - { - Text [ en-US ] = "Bullets replaced"; - }; - String STR_AUTOFMTREDL_UNDER+1 - { - Text [ en-US ] = "Automatic _underline_"; - }; - String STR_AUTOFMTREDL_BOLD+1 - { - Text [ en-US ] = "Automatic *bold*"; - }; - String STR_AUTOFMTREDL_FRACTION+1 - { - Text [ en-US ] = "Replace 1/2 ... with ½ ..." ; - }; - String STR_AUTOFMTREDL_DETECT_URL+1 - { - Text [ en-US ] = "URL recognition" ; - }; - String STR_AUTOFMTREDL_DASH+1 - { - Text [ en-US ] = "Replace dashes" ; - }; - String STR_AUTOFMTREDL_ORDINAL+1 - { - Text [ en-US ] = "Replace 1st... with 1^st..." ; - }; - String STR_AUTOFMTREDL_RIGHT_MARGIN+1 - { - Text [ en-US ] = "Combine single line paragraphs"; - }; - - String STR_AUTOFMTREDL_SET_TMPL_TEXT +1 - { - Text [ en-US ] = "Set \"Text body\" Style"; - }; - String STR_AUTOFMTREDL_SET_TMPL_INDENT +1 - { - Text [ en-US ] = "Set \"Text body indent\" Style"; - }; - String STR_AUTOFMTREDL_SET_TMPL_NEG_INDENT +1 - { - Text [ en-US ] = "Set \"Hanging indent\" Style"; - }; - String STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT +1 - { - Text [ en-US ] = "Set \"Text body indent\" Style"; - }; - String STR_AUTOFMTREDL_SET_TMPL_HEADLINE +1 - { - Text [ en-US ] = "Set \"Heading $(ARG1)\" Style"; - }; - String STR_AUTOFMTREDL_SET_NUMBULET +1 - { - Text [ en-US ] = "Set \"Bullet\" or \"Numbering\" Style"; - }; - - String STR_AUTOFMTREDL_DEL_MORELINES +1 - { - Text [ en-US ] = "Combine paragraphs"; - }; - String STR_AUTOFMTREDL_NON_BREAK_SPACE +1 - { - Text [ en-US ] = "Add non breaking space"; - }; - }; // Miscellaneous diff --git a/sw/source/uibase/utlui/initui.cxx b/sw/source/uibase/utlui/initui.cxx index ab67b03b5c5d..017254284fac 100644 --- a/sw/source/uibase/utlui/initui.cxx +++ b/sw/source/uibase/utlui/initui.cxx @@ -19,6 +19,7 @@ #include <config_features.h> +#include <tools/resary.hxx> #include <unotools/localedatawrapper.hxx> #include <viewsh.hxx> #include <initui.hxx> @@ -269,35 +270,26 @@ SwGlossaryList* GetGlossaryList() return pGlossaryList; } -struct ImpAutoFormatNameListLoader : public Resource -{ - explicit ImpAutoFormatNameListLoader( std::vector<OUString>& rLst ); -}; - void ShellResource::GetAutoFormatNameLst_() const { assert(!pAutoFormatNameLst); pAutoFormatNameLst.reset( new std::vector<OUString> ); pAutoFormatNameLst->reserve(STR_AUTOFMTREDL_END); - ImpAutoFormatNameListLoader aTmp(*pAutoFormatNameLst); -} -ImpAutoFormatNameListLoader::ImpAutoFormatNameListLoader( std::vector<OUString>& rLst ) - : Resource( ResId(RID_SHELLRES_AUTOFMTSTRS, *pSwResMgr) ) -{ - for( sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n ) + ResStringArray aStringArray(ResId(RID_SHELLRES_AUTOFMTSTRS, *pSwResMgr)); + assert(aStringArray.Count() == STR_AUTOFMTREDL_END); + for (sal_uInt16 n = 0; n < STR_AUTOFMTREDL_END; ++n) { - OUString p(ResId(n + 1, *pSwResMgr)); - if(STR_AUTOFMTREDL_TYPO == n) + OUString p(aStringArray.GetString(n)); + if (STR_AUTOFMTREDL_TYPO == n) { const SvtSysLocale aSysLocale; const LocaleDataWrapper& rLclD = aSysLocale.GetLocaleData(); p = p.replaceFirst("%1", rLclD.getDoubleQuotationMarkStart()); p = p.replaceFirst("%2", rLclD.getDoubleQuotationMarkEnd()); } - rLst.insert(rLst.begin() + n, p); + pAutoFormatNameLst->push_back(p); } - FreeResource(); } OUString SwAuthorityFieldType::GetAuthFieldName(ToxAuthorityField eType) |