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

Miklos Vajna vmiklos at collabora.co.uk
Fri Feb 27 00:02:18 PST 2015


 sw/inc/docary.hxx                   |    2 +-
 sw/source/core/crsr/bookmrk.cxx     |    9 ++++++---
 sw/source/core/doc/docredln.cxx     |   16 ++++++++++++++++
 sw/source/core/docnode/nodedump.cxx |   30 ------------------------------
 4 files changed, 23 insertions(+), 34 deletions(-)

New commits:
commit 5020ed93a40ea24d259b316a02a30eb868c41c2d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Feb 27 09:01:06 2015 +0100

    Move SwExtraRedlineTbl::dumpAsXml() out of docnode
    
    Change-Id: Ic9762d9392493a84fe124349e7616ac21f7e8586

diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 8b36d6a..abe1480 100644
--- a/sw/inc/docary.hxx
+++ b/sw/inc/docary.hxx
@@ -204,7 +204,7 @@ public:
     void DeleteAndDestroy( sal_uInt16 nPos, sal_uInt16 nLen = 1 );
     void DeleteAndDestroyAll();
 
-    void dumpAsXml(xmlTextWriterPtr w) const;
+    void dumpAsXml(struct _xmlTextWriter* pWriter) const;
 
     /** Search next or previous Redline with the same Seq. No.
        Search can be restricted via Lookahaed.
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 7eae977..6a6f5f6 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -182,9 +182,12 @@ namespace sw { namespace mark
         xmlTextWriterStartElement(pWriter, BAD_CAST("markPos"));
         GetMarkPos().dumpAsXml(pWriter);
         xmlTextWriterEndElement(pWriter);
-        xmlTextWriterStartElement(pWriter, BAD_CAST("otherMarkPos"));
-        GetOtherMarkPos().dumpAsXml(pWriter);
-        xmlTextWriterEndElement(pWriter);
+        if (IsExpanded())
+        {
+            xmlTextWriterStartElement(pWriter, BAD_CAST("otherMarkPos"));
+            GetOtherMarkPos().dumpAsXml(pWriter);
+            xmlTextWriterEndElement(pWriter);
+        }
         xmlTextWriterEndElement(pWriter);
     }
 
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 2182451..ec1e7f9 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -76,6 +76,22 @@ SwExtraRedlineTbl::~SwExtraRedlineTbl()
     DeleteAndDestroyAll();
 }
 
+void SwExtraRedlineTbl::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+    xmlTextWriterStartElement(pWriter, BAD_CAST("swExtraRedlineTbl"));
+    xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+
+    for (sal_uInt16 nCurExtraRedlinePos = 0; nCurExtraRedlinePos < GetSize(); ++nCurExtraRedlinePos)
+    {
+        const SwExtraRedline* pExtraRedline = GetRedline(nCurExtraRedlinePos);
+        xmlTextWriterStartElement(pWriter, BAD_CAST("swExtraRedline"));
+        xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
+        xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*pExtraRedline).name()));
+        xmlTextWriterEndElement(pWriter);
+    }
+    xmlTextWriterEndElement(pWriter);
+}
+
 #if OSL_DEBUG_LEVEL > 0
 bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd )
 {
diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx
index 43f628a..ad37ca1 100644
--- a/sw/source/core/docnode/nodedump.cxx
+++ b/sw/source/core/docnode/nodedump.cxx
@@ -292,34 +292,4 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w ) const
     writer.endElement();
 }
 
-void SwExtraRedlineTbl::dumpAsXml( xmlTextWriterPtr w ) const
-{
-    WriterHelper writer( w );
-
-    writer.startElement( "swextraredlinetbl" );
-    writer.writeFormatAttribute( "ptr", "%p", this );
-
-    const SwExtraRedlineTbl& extraRedlineTbl = (*this);
-
-    for( sal_uInt16 nCurExtraRedlinePos = 0; nCurExtraRedlinePos < GetSize(); ++nCurExtraRedlinePos )
-    {
-        const SwExtraRedline* pExtraRedline = extraRedlineTbl.GetRedline( nCurExtraRedlinePos );
-
-        writer.startElement( "swextraredline" );
-        {
-            const SwTableRowRedline*           pTableRowRedline           = dynamic_cast<const SwTableRowRedline*>(pExtraRedline);
-            const SwTableCellRedline*          pTableCellRedline          = dynamic_cast<const SwTableCellRedline*>(pExtraRedline);
-            if (pTableRowRedline)
-                writer.writeFormatAttribute( "extra_redline_type", "%s", BAD_CAST( "table row" ) );
-            else if (pTableCellRedline)
-                writer.writeFormatAttribute( "extra_redline_type", "%s", BAD_CAST( "table cell" ) );
-            else
-                writer.writeFormatAttribute( "extra_redline_type", "%s", BAD_CAST( "UNKNOWN" ) );
-        }
-        writer.endElement( );    // extra_redline_data
-    }
-
-    writer.endElement( );    // swextraredlinetbl
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list