diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/strings.hrc | 5 | ||||
-rw-r--r-- | sw/inc/swtypes.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/undo/undel.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/app/swmodule.cxx | 5 |
4 files changed, 15 insertions, 8 deletions
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 7a35d1ebe1d2..7bb76458a3b6 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -21,6 +21,7 @@ #define INCLUDED_SW_INC_STRINGS_HRC #define NC_(Context, String) (Context "\004" u8##String) +#define NNC_(Context, StringSingular, StringPlural) (Context "\004" u8##StringSingular "\004" u8##StringPlural) // Format names #define STR_POOLCHR_FOOTNOTE NC_("STR_POOLCHR_FOOTNOTE", "Footnote Characters") @@ -464,8 +465,8 @@ #define STR_PASTE_CLIPBOARD_UNDO NC_("STR_PASTE_CLIPBOARD_UNDO", "Paste clipboard") #define STR_YIELDS NC_("STR_YIELDS", "→") #define STR_OCCURRENCES_OF NC_("STR_OCCURRENCES_OF", "occurrences of") -#define STR_UNDO_TABS NC_("STR_UNDO_TABS", "$1 tab(s)") -#define STR_UNDO_NLS NC_("STR_UNDO_NLS", "$1 line break(s)") +#define STR_UNDO_TABS NNC_("STR_UNDO_TABS", "One tab", "$1 tabs") +#define STR_UNDO_NLS NNC_("STR_UNDO_NLS", "One line break","$1 line breaks") #define STR_UNDO_PAGEBREAKS NC_("STR_UNDO_PAGEBREAKS", "page break") #define STR_UNDO_COLBRKS NC_("STR_UNDO_COLBRKS", "column break") #define STR_UNDO_REDLINE_INSERT NC_("STR_UNDO_REDLINE_INSERT", "Insert $1") diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index d2ce6af47540..1b1c88d28523 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -124,6 +124,7 @@ const short lOutlineMinTextDistance = 216; // 0.15 inch = 0.38 cm // defined in sw/source/uibase/app/swmodule.cxx SW_DLLPUBLIC OUString SwResId(const char* pId); +SW_DLLPUBLIC OUString SwResId(const char* pId, int nCardinality); css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker(); css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator(); diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 3f27ada19883..950349c54fda 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -658,7 +658,8 @@ static OUString lcl_DenotedPortion(const OUString& rStr, sal_Int32 nStart, sal_I { OUString aResult; - if (nEnd - nStart > 0) + auto nCount = nEnd - nStart; + if (nCount > 0) { sal_Unicode cLast = rStr[nEnd - 1]; if (lcl_IsSpecialCharacter(cLast)) @@ -666,11 +667,11 @@ static OUString lcl_DenotedPortion(const OUString& rStr, sal_Int32 nStart, sal_I switch(cLast) { case CH_TXTATR_TAB: - aResult = SwResId(STR_UNDO_TABS); + aResult = SwResId(STR_UNDO_TABS, nCount); break; case CH_TXTATR_NEWLINE: - aResult = SwResId(STR_UNDO_NLS); + aResult = SwResId(STR_UNDO_NLS, nCount); break; @@ -691,14 +692,13 @@ static OUString lcl_DenotedPortion(const OUString& rStr, sal_Int32 nStart, sal_I break; } SwRewriter aRewriter; - aRewriter.AddRule(UndoArg1, - OUString::number(nEnd - nStart)); + aRewriter.AddRule(UndoArg1, OUString::number(nCount)); aResult = aRewriter.Apply(aResult); } else { aResult = SwResId(STR_START_QUOTE); - aResult += rStr.copy(nStart, nEnd - nStart); + aResult += rStr.copy(nStart, nCount); aResult += SwResId(STR_END_QUOTE); } } diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx index c186f1999fca..481750bf433c 100644 --- a/sw/source/uibase/app/swmodule.cxx +++ b/sw/source/uibase/app/swmodule.cxx @@ -201,6 +201,11 @@ OUString SwResId(const char* pId) return Translate::get(pId, SW_MOD()->GetResLocale()); } +OUString SwResId(const char* pId, int nCardinality) +{ + return Translate::nget(pId, nCardinality, SW_MOD()->GetResLocale()); +} + uno::Reference< scanner::XScannerManager2 > const & SwModule::GetScannerManager() { |