summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-27 09:01:06 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-27 09:01:46 +0100
commit5020ed93a40ea24d259b316a02a30eb868c41c2d (patch)
treec6922de00c557f22cd8f155b46dbad4b2c80c608
parente80d1cfcb75659eddfd7a29e45d9e6ee935668ac (diff)
Move SwExtraRedlineTbl::dumpAsXml() out of docnode
Change-Id: Ic9762d9392493a84fe124349e7616ac21f7e8586
-rw-r--r--sw/inc/docary.hxx2
-rw-r--r--sw/source/core/crsr/bookmrk.cxx9
-rw-r--r--sw/source/core/doc/docredln.cxx16
-rw-r--r--sw/source/core/docnode/nodedump.cxx30
4 files changed, 23 insertions, 34 deletions
diff --git a/sw/inc/docary.hxx b/sw/inc/docary.hxx
index 8b36d6a9b090..abe14800a0ce 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 7eae97787740..6a6f5f6ef45d 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 21824512beb7..ec1e7f963dfb 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 43f628a9a7d3..ad37ca1058ba 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: */