Kaydet (Commit) 5020ed93 authored tarafından Miklos Vajna's avatar Miklos Vajna

Move SwExtraRedlineTbl::dumpAsXml() out of docnode

Change-Id: Ic9762d9392493a84fe124349e7616ac21f7e8586
üst e80d1cfc
...@@ -204,7 +204,7 @@ public: ...@@ -204,7 +204,7 @@ public:
void DeleteAndDestroy( sal_uInt16 nPos, sal_uInt16 nLen = 1 ); void DeleteAndDestroy( sal_uInt16 nPos, sal_uInt16 nLen = 1 );
void DeleteAndDestroyAll(); void DeleteAndDestroyAll();
void dumpAsXml(xmlTextWriterPtr w) const; void dumpAsXml(struct _xmlTextWriter* pWriter) const;
/** Search next or previous Redline with the same Seq. No. /** Search next or previous Redline with the same Seq. No.
Search can be restricted via Lookahaed. Search can be restricted via Lookahaed.
......
...@@ -182,9 +182,12 @@ namespace sw { namespace mark ...@@ -182,9 +182,12 @@ namespace sw { namespace mark
xmlTextWriterStartElement(pWriter, BAD_CAST("markPos")); xmlTextWriterStartElement(pWriter, BAD_CAST("markPos"));
GetMarkPos().dumpAsXml(pWriter); GetMarkPos().dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter); xmlTextWriterEndElement(pWriter);
xmlTextWriterStartElement(pWriter, BAD_CAST("otherMarkPos")); if (IsExpanded())
GetOtherMarkPos().dumpAsXml(pWriter); {
xmlTextWriterEndElement(pWriter); xmlTextWriterStartElement(pWriter, BAD_CAST("otherMarkPos"));
GetOtherMarkPos().dumpAsXml(pWriter);
xmlTextWriterEndElement(pWriter);
}
xmlTextWriterEndElement(pWriter); xmlTextWriterEndElement(pWriter);
} }
......
...@@ -76,6 +76,22 @@ SwExtraRedlineTbl::~SwExtraRedlineTbl() ...@@ -76,6 +76,22 @@ SwExtraRedlineTbl::~SwExtraRedlineTbl()
DeleteAndDestroyAll(); 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 #if OSL_DEBUG_LEVEL > 0
bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd ) bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd )
{ {
......
...@@ -292,34 +292,4 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w ) const ...@@ -292,34 +292,4 @@ void SwTxtNode::dumpAsXml( xmlTextWriterPtr w ) const
writer.endElement(); 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment