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

Miklos Vajna vmiklos at collabora.co.uk
Tue Apr 29 13:00:24 PDT 2014


 sw/inc/docary.hxx                                     |    1 
 sw/source/core/docnode/nodedump.cxx                   |   33 ++++++++------
 writerfilter/source/rtftok/rtfreferenceproperties.cxx |   10 ++--
 writerfilter/source/rtftok/rtfreferenceproperties.hxx |   40 +++++++++---------
 4 files changed, 47 insertions(+), 37 deletions(-)

New commits:
commit 4f29ea316b6849e3ed9b0a94025e449c9ef46f47
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Apr 29 21:49:19 2014 +0200

    writerfilter: fix indentation in rtfreferenceproperties
    
    Change-Id: Ide3292d976d38648c2208d456715c1a8eaa49479

diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.cxx b/writerfilter/source/rtftok/rtfreferenceproperties.cxx
index bd7aa98..c731986 100644
--- a/writerfilter/source/rtftok/rtfreferenceproperties.cxx
+++ b/writerfilter/source/rtftok/rtfreferenceproperties.cxx
@@ -9,18 +9,20 @@
 
 #include <rtfreferenceproperties.hxx>
 
-namespace writerfilter {
-namespace rtftok {
+namespace writerfilter
+{
+namespace rtftok
+{
 
 RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes, RTFSprms aSprms)
     : m_aAttributes(aAttributes),
-    m_aSprms(aSprms)
+      m_aSprms(aSprms)
 {
 }
 
 RTFReferenceProperties::RTFReferenceProperties(RTFSprms aAttributes)
     : m_aAttributes(aAttributes),
-    m_aSprms()
+      m_aSprms()
 {
 }
 
diff --git a/writerfilter/source/rtftok/rtfreferenceproperties.hxx b/writerfilter/source/rtftok/rtfreferenceproperties.hxx
index 9ab4884..527ad01 100644
--- a/writerfilter/source/rtftok/rtfreferenceproperties.hxx
+++ b/writerfilter/source/rtftok/rtfreferenceproperties.hxx
@@ -12,25 +12,27 @@
 
 #include <rtfsprm.hxx>
 
-namespace writerfilter {
-    namespace rtftok {
-        /// Sends RTFSprm instances to DomainMapper.
-        class RTFReferenceProperties
-            : public writerfilter::Reference<Properties>
-        {
-            public:
-                RTFReferenceProperties(RTFSprms rAttributes, RTFSprms rSprms);
-                RTFReferenceProperties(RTFSprms rAttributes);
-                virtual ~RTFReferenceProperties();
-                virtual void resolve(Properties & rHandler) SAL_OVERRIDE;
-                virtual std::string getType() const SAL_OVERRIDE;
-                RTFSprms& getAttributes();
-                RTFSprms& getSprms();
-            private:
-                RTFSprms m_aAttributes;
-                RTFSprms m_aSprms;
-        };
-    } // namespace rtftok
+namespace writerfilter
+{
+namespace rtftok
+{
+/// Sends RTFSprm instances to DomainMapper.
+class RTFReferenceProperties
+    : public writerfilter::Reference<Properties>
+{
+public:
+    RTFReferenceProperties(RTFSprms rAttributes, RTFSprms rSprms);
+    RTFReferenceProperties(RTFSprms rAttributes);
+    virtual ~RTFReferenceProperties();
+    virtual void resolve(Properties& rHandler) SAL_OVERRIDE;
+    virtual std::string getType() const SAL_OVERRIDE;
+    RTFSprms& getAttributes();
+    RTFSprms& getSprms();
+private:
+    RTFSprms m_aAttributes;
+    RTFSprms m_aSprms;
+};
+} // namespace rtftok
 } // namespace writerfilter
 
 #endif // INCLUDED_WRITERFILTER_SOURCE_RTFTOK_RTFREFERENCEPROPERTIES_HXX
commit b3fe4039767f60aa43a5e3e2d1a9259fd337d871
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Apr 29 21:47:18 2014 +0200

    sw doc model dump: improve section format dump
    
    Instead of looking up the relevant entry from mpSectionFmtTbl in each
    section using the layout, dump mpSectionFmtTbl directly. This makes the
    dump of the section format table consistent with the other format table
    dumps.
    
    Change-Id: I988c8f4fdfd52b64359eb4acf9c61383f33fb8ad

diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 120606a..f3615a6 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -116,6 +116,7 @@ public:
     virtual SwFmt* GetFmt(size_t idx) const SAL_OVERRIDE { return (SwFmt*)operator[](idx); }
     sal_uInt16 GetPos(const SwSectionFmt* pFmt) const;
     bool Contains(const SwSectionFmt* pFmt) const;
+    void dumpAsXml(xmlTextWriterPtr w);
     /// free's any remaining child objects
     virtual ~SwSectionFmts();
 };
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index d4d70af..a2ffd3c 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -182,6 +182,7 @@ void SwDoc::dumpAsXml( xmlTextWriterPtr w )
     mpTxtFmtCollTbl->dumpAsXml( writer );
     mpCharFmtTbl->dumpAsXml( writer );
     mpSpzFrmFmtTbl->dumpAsXml( writer );
+    mpSectionFmtTbl->dumpAsXml( writer );
     mpNumRuleTbl->dumpAsXml( writer );
     mpRedlineTbl->dumpAsXml( writer );
     mpExtraRedlineTbl->dumpAsXml( writer );
@@ -320,7 +321,7 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
             name = "table";
             break;
         case ND_SECTIONNODE:
-            name = "sectionNode";
+            name = "section";
             break;
         default:
             switch( GetStartNodeType())
@@ -350,19 +351,6 @@ void SwStartNode::dumpAsXml( xmlTextWriterPtr w )
     writer.writeFormatAttribute( "ptr", "%p", this );
     writer.writeFormatAttribute( "index", TMP_FORMAT, GetIndex() );
 
-    if (GetNodeType() == ND_SECTIONNODE)
-    {
-        SwSection& rSection = GetSectionNode()->GetSection();
-        writer.startElement("section");
-
-        SwSectionFmt* pFmt = rSection.GetFmt();
-        writer.startElement("swsectionfmt");
-        lcl_dumpSfxItemSet(writer, &pFmt->GetAttrSet());
-        writer.endElement();
-
-        writer.endElement();
-    }
-
     // writer.endElement(); - it is a start node, so don't end, will make xml better nested
 }
 
@@ -566,6 +554,23 @@ void SwCharFmts::dumpAsXml(xmlTextWriterPtr w)
     }
 }
 
+void SwSectionFmts::dumpAsXml(xmlTextWriterPtr w)
+{
+    WriterHelper writer(w);
+    if (size())
+    {
+        writer.startElement("swsectionfmts");
+        for (size_t i = 0; i < size(); ++i)
+        {
+            SwSectionFmt* pFmt = static_cast<SwSectionFmt*>(GetFmt(i));
+            writer.startElement("swsectionfmt");
+            lcl_dumpSfxItemSet(writer, &pFmt->GetAttrSet());
+            writer.endElement();
+        }
+        writer.endElement();
+    }
+}
+
 void SwTxtFmtColls::dumpAsXml(xmlTextWriterPtr w)
 {
     WriterHelper writer(w);


More information about the Libreoffice-commits mailing list