[Libreoffice-commits] .: 3 commits - writerfilter/inc writerfilter/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Mar 29 12:49:41 PDT 2011


 writerfilter/inc/writerfilter.mk                      |    3 +
 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |    4 +-
 writerfilter/source/resourcemodel/TagLogger.cxx       |   29 ++++++------------
 3 files changed, 15 insertions(+), 21 deletions(-)

New commits:
commit f384e3f739528c901ad8aedb16eb55545a42d4e9
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Mar 29 21:48:26 2011 +0200

    writerfilter: Fixed TagLogger to actually reuse previously created instances

diff --git a/writerfilter/source/resourcemodel/TagLogger.cxx b/writerfilter/source/resourcemodel/TagLogger.cxx
index 9159898..3efb9d0 100644
--- a/writerfilter/source/resourcemodel/TagLogger.cxx
+++ b/writerfilter/source/resourcemodel/TagLogger.cxx
@@ -35,27 +35,19 @@
 
 namespace writerfilter
 {
-struct eqstr
-{
-    bool operator()(const char* s1, const char* s2) const
+    typedef boost::unordered_map<string, TagLogger::Pointer_t> TagLoggerHashMap_t;
+    static TagLoggerHashMap_t * tagLoggers = NULL;
+
+        TagLogger::TagLogger(const char* name)
+        : pWriter( NULL ), pName( name )
     {
-        return strcmp(s1, s2) == 0;
     }
-};
-
-typedef boost::unordered_map<const char *, TagLogger::Pointer_t> TagLoggerHashMap_t;
-static TagLoggerHashMap_t * tagLoggers = NULL;
-
-    TagLogger::TagLogger(const char* name)
-    : pWriter( NULL ), pName( name )
-{
-}
 
-TagLogger::~TagLogger()
-{
+    TagLogger::~TagLogger()
+    {
         pWriter = NULL;
         pName = NULL;
-}
+    }
 
     void TagLogger::setFileName( const string & filename )
     {
@@ -96,13 +88,14 @@ TagLogger::~TagLogger()
 
         TagLoggerHashMap_t::iterator aIt = tagLoggers->end();
 
+        string sName = name;
         if (! tagLoggers->empty())
-            aIt = tagLoggers->find(name);
+            aIt = tagLoggers->find(sName);
 
         if (aIt == tagLoggers->end())
         {
             TagLogger::Pointer_t pTagLogger(new TagLogger(name));
-            pair<const char *, TagLogger::Pointer_t> entry(name, pTagLogger);
+            pair<string, TagLogger::Pointer_t> entry(sName, pTagLogger);
             aIt = tagLoggers->insert(entry).first;
         }
 
commit e2188416326bcaf7f8231e07f696132d2574efe7
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Mar 29 21:47:39 2011 +0200

    writerfilter: merge fixes, TagLogger::endElement doesn't have string param

diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index d41acfa..1196854 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -260,7 +260,7 @@ void SAL_CALL OOXMLFastContextHandler::endUnknownElement
 throw (uno::RuntimeException, xml::sax::SAXException)
 {
 #ifdef DEBUG_CONTEXT_HANDLER
-    debug_logger->endElement("contexthandler.unknown-element");
+    debug_logger->endElement();
     mpParserState->getXPathLogger().endElement();
 #endif
 }
@@ -1482,7 +1482,7 @@ void OOXMLFastContextHandlerValue::setValue(OOXMLValue::Pointer_t pValue)
     mpValue = pValue;
 
 #ifdef DEBUG_CONTEXT_HANDLER
-    debug_logger->endElement("contexthandler.setValue");
+    debug_logger->endElement();
 #endif
 }
 
commit 9413a64b06aa21f410dba01c6a6060b94e1498a5
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Mar 29 21:46:42 2011 +0200

    writerfilter: added some more debug output to debug level >1

diff --git a/writerfilter/inc/writerfilter.mk b/writerfilter/inc/writerfilter.mk
index 0b0c5ca..b53e58c 100644
--- a/writerfilter/inc/writerfilter.mk
+++ b/writerfilter/inc/writerfilter.mk
@@ -28,7 +28,8 @@
 CDEFS+=-DWRITERFILTER_DLLIMPLEMENTATION
 .IF "$(DBG_LEVEL)">="2"
 CDEFS+=-DDEBUG_DOMAINMAPPER -DDEBUG_ELEMENT -DDEBUG_RESOLVE \
-       -DDEBUG_CONTEXT_STACK -DDEBUG_ATTRIBUTES -DDEBUG_PROPERTIES
+       -DDEBUG_CONTEXT_STACK -DDEBUG_ATTRIBUTES -DDEBUG_PROPERTIES \
+       -DDEBUG_CONTEXT_HANDLER -DDEBUG_IMPORT
 CFLAGS += $(LIBXML_CFLAGS)
 .ENDIF
 .IF "$(SYSTEM_LIBXML)" == "YES"


More information about the Libreoffice-commits mailing list