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

Jan Holesovsky kendy at collabora.com
Mon Apr 14 07:44:55 PDT 2014


 writerfilter/source/ooxml/qnametostr.xsl             |    2 ++
 writerfilter/source/resourcemodel/qnametostrcore.cxx |    6 ++----
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit fabea153cfe1ed109d2724b873655c254a152a38
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Apr 14 16:41:15 2014 +0200

    Compile the debugging strings in only if we are about to use them.
    
    Saves us tons of string literals.
    
    Change-Id: Ieb7ac52e7493d692e7ed56552350b8781ec6b500

diff --git a/writerfilter/source/ooxml/qnametostr.xsl b/writerfilter/source/ooxml/qnametostr.xsl
index 5d09c8b..cfcbad0 100644
--- a/writerfilter/source/ooxml/qnametostr.xsl
+++ b/writerfilter/source/ooxml/qnametostr.xsl
@@ -60,6 +60,7 @@
     <xsl:text>
 void QNameToString::init_ooxml()
 {
+#ifdef DEBUG_LOGGING
     /* ooxml */
     </xsl:text>
     <xsl:for-each select="//@tokenid">
@@ -75,6 +76,7 @@ void QNameToString::init_ooxml()
       </xsl:if>
     </xsl:for-each>
     <xsl:text>
+#endif
 }
     </xsl:text>
   </xsl:template>
diff --git a/writerfilter/source/resourcemodel/qnametostrcore.cxx b/writerfilter/source/resourcemodel/qnametostrcore.cxx
index 9f5d970..a473753 100644
--- a/writerfilter/source/resourcemodel/qnametostrcore.cxx
+++ b/writerfilter/source/resourcemodel/qnametostrcore.cxx
@@ -33,14 +33,12 @@ QNameToString::Pointer_t QNameToString::Instance()
 
 string QNameToString::operator()(Id qName)
 {
-    string sResult;
-
     Map::const_iterator aIt = mMap.find(qName);
 
     if (aIt != mMap.end())
-        sResult = aIt->second;
+        return aIt->second;
 
-    return mMap[qName];
+    return string();
 }
 
 QNameToString::QNameToString()


More information about the Libreoffice-commits mailing list