[Libreoffice-commits] core.git: xmloff/source

Matúš Kukan matus.kukan at collabora.com
Fri May 30 05:06:02 PDT 2014


 xmloff/source/style/xmlnumi.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d2e0465d406b33139f3a97e1738020d6a7a6f6c3
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Fri May 30 10:44:51 2014 +0200

    fdo#76324: Use one static SvXMLTokenMap object, it's faster.
    
    For me it saves ~10% of load time for calc document with 2000 comments.
    Thanks to Michael for noticing this oddity.
    
    Change-Id: Id44f44c02df2ae9360d02c28081601f5f7a8ea27

diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 6649b29..917b6f4 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -291,7 +291,7 @@ SvxXMLListLevelStyleContext_Impl::SvxXMLListLevelStyleContext_Impl(
     else if( IsXMLToken( rLName, XML_LIST_LEVEL_STYLE_IMAGE ) )
         bImage = true;
 
-    SvXMLTokenMap aTokenMap( lcl_getLevelAttrTokenMap() );
+    static const SvXMLTokenMap aTokenMap( lcl_getLevelAttrTokenMap() );
     sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
     for( sal_Int16 i=0; i < nAttrCount; i++ )
     {
@@ -666,7 +666,7 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl(
     SvXMLImportContext( rImport, nPrfx, rLName ),
     rListLevel( rLLevel )
 {
-    SvXMLTokenMap aTokenMap( lcl_getStyleAttributesAttrTokenMap() );
+    static const SvXMLTokenMap aTokenMap( lcl_getStyleAttributesAttrTokenMap() );
     SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
 
     OUString sFontName, sFontFamily, sFontStyleName, sFontFamilyGeneric,
@@ -960,7 +960,7 @@ SvxXMLListLevelStyleLabelAlignmentAttrContext_Impl::SvxXMLListLevelStyleLabelAli
     SvXMLImportContext( rImport, nPrfx, rLName ),
     rListLevel( rLLevel )
 {
-    SvXMLTokenMap aTokenMap( lcl_getStyleAlignmentAttributesAttrTokenMap() );
+    static const SvXMLTokenMap aTokenMap( lcl_getStyleAlignmentAttributesAttrTokenMap() );
     SvXMLUnitConverter& rUnitConv = GetImport().GetMM100UnitConverter();
 
     sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;


More information about the Libreoffice-commits mailing list