summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-05-20 08:13:53 +0100
committerMichael Meeks <michael.meeks@collabora.com>2014-05-21 10:01:50 +0100
commit7732f806dfcc9375757e7ccbe1ca3c1d194af266 (patch)
tree8a47168cf3067697d845e2f291dbfc991ad3ea3d
parent85dc388993beca806b5a7ec91c9c49172b3a781b (diff)
ODS load perf: avoid excessive calls to uppercase to compare tab names.
Change-Id: I37b9e49607c8c51f10bc8ff8fc342b02fdb8b7e1
-rw-r--r--sc/source/core/data/document.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index d72e7db91ad2..97c10cae4cf7 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -237,7 +237,16 @@ bool ScDocument::GetCodeName( SCTAB nTab, OUString& rName ) const
bool ScDocument::GetTable( const OUString& rName, SCTAB& rTab ) const
{
- OUString aUpperName = ScGlobal::pCharClass->uppercase(rName);
+ OUString aUpperName;
+ static OUString aCacheName, aCacheUpperName;
+
+ if (aCacheName != rName)
+ {
+ aCacheName = rName;
+ // surprisingly slow ...
+ aCacheUpperName = ScGlobal::pCharClass->uppercase(rName);
+ }
+ aUpperName = aCacheUpperName;
for (SCTAB i=0; i< static_cast<SCTAB>(maTabs.size()); i++)
if (maTabs[i])