diff options
-rw-r--r-- | sw/source/core/inc/txtfrm.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 25 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 21 |
3 files changed, 25 insertions, 22 deletions
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index d73c2efa499f..aa2246727fc2 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -809,6 +809,7 @@ public: static SwView* GetView(); void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override; + void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override; }; //use this to protect a SwTextFrame for a given scope from getting merged with diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 470ce8b528fd..f043530de702 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -793,10 +793,33 @@ SwTextFrame::SwTextFrame(SwTextNode * const pNode, SwFrame* pSib, m_pMergedPara = CheckParaRedlineMerge(*this, *pNode, eMode); } +void SwTextFrame::dumpAsXmlAttributes(xmlTextWriterPtr writer) const +{ + SwContentFrame::dumpAsXmlAttributes(writer); + + const SwTextNode *pTextNode = GetTextNodeFirst(); + (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), "%" SAL_PRIdINT32, sal_Int32(pTextNode->GetIndex()) ); + + OString aMode = "Horizontal"; + if (IsVertLRBT()) + { + aMode = "VertBTLR"; + } + else if (IsVertLR()) + { + aMode = "VertLR"; + } + else if (IsVertical()) + { + aMode = "Vertical"; + } + (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("WritingMode"), BAD_CAST(aMode.getStr())); +} + void SwTextFrame::dumpAsXml(xmlTextWriterPtr writer) const { (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("txt")); - SwFrame::dumpAsXmlAttributes( writer ); + dumpAsXmlAttributes( writer ); if ( HasFollow() ) (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%" SAL_PRIuUINT32, GetFollow()->GetFrameId() ); diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index 445a0e306336..b5cde782775f 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -213,27 +213,6 @@ void SwFrame::dumpAsXmlAttributes( xmlTextWriterPtr writer ) const SwSectionNode const*const pNode(pFrame->GetSection() ? pFrame->GetSection()->GetFormat()->GetSectionNode() : nullptr); (void)xmlTextWriterWriteFormatAttribute(writer, BAD_CAST("sectionNodeIndex"), "%" SAL_PRIdINT32, pNode ? sal_Int32(pNode->GetIndex()) : -1); } - if ( IsTextFrame( ) ) - { - const SwTextFrame *pTextFrame = static_cast<const SwTextFrame *>(this); - const SwTextNode *pTextNode = pTextFrame->GetTextNodeFirst(); - (void)xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "txtNodeIndex" ), "%" SAL_PRIdINT32, sal_Int32(pTextNode->GetIndex()) ); - - OString aMode = "Horizontal"; - if (IsVertLRBT()) - { - aMode = "VertBTLR"; - } - else if (IsVertLR()) - { - aMode = "VertLR"; - } - else if (IsVertical()) - { - aMode = "Vertical"; - } - (void)xmlTextWriterWriteAttribute(writer, BAD_CAST("WritingMode"), BAD_CAST(aMode.getStr())); - } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |