summaryrefslogtreecommitdiff
path: root/svl/source/numbers/zforscan.hxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-06-04 20:06:49 +0200
committerEike Rathke <erack@redhat.com>2018-06-04 22:30:48 +0200
commitbfe6e9ecb18e8a3d9da368a1eb48e807ab9041cf (patch)
treeda1cdc4268093349f81ca0a145dfb89607fc852d /svl/source/numbers/zforscan.hxx
parent39e2c1f2a3de68f1a971d14bec31e88a83056924 (diff)
Handle English vs locale's General keyword, tdf#33689 follow-up, tdf#107867
Caller of ImpSvNumberformatScan::GetKeyWord() needs to know if English or locale's keyword was found and act on it. Pointed out by an assert when attempting to copy "STANDARD" length characters (8) from "General" (7), which doesn't harm because when not in debug it copied the terminating 0-character. However, the keyword name also needs to be replaced for the locale's resulting format code. Change-Id: Ia5211b307ea44c1ba9c2b86786368355c570d4a2 Reviewed-on: https://gerrit.libreoffice.org/55293 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svl/source/numbers/zforscan.hxx')
-rw-r--r--svl/source/numbers/zforscan.hxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index e2246f574dd5..b7ee25d2ce52 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -247,8 +247,15 @@ private: // Private section
short PreviousType( sal_uInt16 i ) const; // Returns type before position skips EMPTY
bool IsLastBlankBeforeFrac(sal_uInt16 i) const; // True <=> there won't be a ' ' until the '/'
void Reset(); // Reset all variables before starting the analysis
- short GetKeyWord( const OUString& sSymbol, // Determine keyword at nPos
- sal_Int32 nPos ) const; // Return 0 <=> not found
+
+ /** Determine keyword at nPos.
+ @param rbFoundEnglish set if English instead of locale's keyword
+ found, never cleared, thus init with false.
+ @return 0 if not found, else keyword enumeration.
+ */
+ short GetKeyWord( const OUString& sSymbol,
+ sal_Int32 nPos,
+ bool& rbFoundEnglish ) const;
bool IsAmbiguousE( short nKey ) const // whether nKey is ambiguous E of NF_KEY_E/NF_KEY_EC
{