diff options
author | Eike Rathke <erack@redhat.com> | 2014-05-20 10:49:02 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-05-20 10:53:17 +0200 |
commit | 76531b80ea49e9665c628a2e5f8b82280ef80704 (patch) | |
tree | 8f04ff8be2fa8bb7e3fdbd0fe32430d01301ff71 /svl | |
parent | 43624d9370c4384f71c6b13fed900eaec222cf64 (diff) |
take a shortcut on common separating ASCII characters
Change-Id: I991801b9a0b7be6024612c8f29262f2ebd8e6a64
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index fef69c5e2d8c..038597043f30 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -459,14 +459,28 @@ bool ImpSvNumberInputScan::StringContainsWord( const OUString& rWhat, * form? */ // Check simple ASCII first before invoking i18n or anything else. - if (rtl::isAsciiAlphanumeric( rString[nPos] )) + const sal_Unicode c = rString[nPos]; + + // Common separating ASCII characters in date context. + switch (c) + { + case ' ': + case '-': + case '.': + case '/': + return true; + default: + ; // nothing + } + + if (rtl::isAsciiAlphanumeric( c )) return false; // Alpha or numeric is not word gap. sal_Int32 nIndex = nPos; - const sal_uInt32 c = rString.iterateCodePoints( &nIndex); + const sal_uInt32 uc = rString.iterateCodePoints( &nIndex); if (nPos+1 < nIndex) return true; // Surrogate, assume these to be new words. - (void)c; + (void)uc; const sal_Int32 nType = pFormatter->GetCharClass()->getCharacterType( rString, nPos); using namespace ::com::sun::star::i18n; |