Kaydet (Commit) 76531b80 authored tarafından Eike Rathke's avatar Eike Rathke

take a shortcut on common separating ASCII characters

Change-Id: I991801b9a0b7be6024612c8f29262f2ebd8e6a64
üst 43624d93
...@@ -459,14 +459,28 @@ bool ImpSvNumberInputScan::StringContainsWord( const OUString& rWhat, ...@@ -459,14 +459,28 @@ bool ImpSvNumberInputScan::StringContainsWord( const OUString& rWhat,
* form? */ * form? */
// Check simple ASCII first before invoking i18n or anything else. // 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. return false; // Alpha or numeric is not word gap.
sal_Int32 nIndex = nPos; sal_Int32 nIndex = nPos;
const sal_uInt32 c = rString.iterateCodePoints( &nIndex); const sal_uInt32 uc = rString.iterateCodePoints( &nIndex);
if (nPos+1 < nIndex) if (nPos+1 < nIndex)
return true; // Surrogate, assume these to be new words. return true; // Surrogate, assume these to be new words.
(void)c; (void)uc;
const sal_Int32 nType = pFormatter->GetCharClass()->getCharacterType( rString, nPos); const sal_Int32 nType = pFormatter->GetCharClass()->getCharacterType( rString, nPos);
using namespace ::com::sun::star::i18n; using namespace ::com::sun::star::i18n;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment