summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-05-03 14:18:44 +0200
committerEike Rathke <erack@redhat.com>2018-05-04 00:30:08 +0200
commit3f8fa788a28abdbf58b0e7577e6a5632001f6181 (patch)
tree6753a267ba65ae02847523a32908577c9b07ab00 /svl
parenta5e0fda3c1375f312ba8d3f0f5ce80d16649c4f5 (diff)
Avoid number scanner overhead for the 0 General format
Change-Id: Iec25db8caaccacfef760f269dd1a349f51455052 Reviewed-on: https://gerrit.libreoffice.org/53791 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforlist.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index c22807fc9cd4..178c3e853d71 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1079,7 +1079,9 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString,
::osl::MutexGuard aGuard( GetInstanceMutex() );
SvNumFormatType FType;
- const SvNumberformat* pFormat = ImpSubstituteEntry( GetFormatEntry(F_Index));
+ // For the 0 General format directly use the init/system locale and avoid
+ // all overhead that is associated with a format passed to the scanner.
+ const SvNumberformat* pFormat = (F_Index == 0 ? nullptr : ImpSubstituteEntry( GetFormatEntry(F_Index)));
if (!pFormat)
{
ChangeIntl(IniLnge);