diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-20 15:02:51 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-12-20 15:29:18 +0100 |
commit | b810e510f15b95ea64c52ae1eec2212280aef678 (patch) | |
tree | 249bf3dfaa332bd4c355d5057327d2cfd09e1ac5 | |
parent | c56c2e28ff4252aa858826416a8a57cb8c2bf100 (diff) |
sw: drawingml export of text frame btLr text direction
CppunitTest_sw_ooxmlexport's testFdo69636 is a reproducer for this problem.
Change-Id: Ibfd2f9388c22436d5677380a22184a2970b8e7be
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index f16d047391c4..c8aa7a0d1250 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -311,8 +311,11 @@ public: }; // Undo the text direction mangling done by the frame btLr handler in writerfilter::dmapper::DomainMapper::lcl_startCharacterGroup() -bool lcl_checkFrameBtlr(SwNode* pStartNode, sax_fastparser::FastAttributeList* pTextboxAttrList) +bool lcl_checkFrameBtlr(SwNode* pStartNode, sax_fastparser::FastAttributeList* pTextboxAttrList = 0, sax_fastparser::FastAttributeList* pBodyPrAttrList = 0) { + // The intended usage is to pass either a valid VML or DML attribute list. + assert(pTextboxAttrList || pBodyPrAttrList); + if (!pStartNode->IsTxtNode()) return false; @@ -345,7 +348,10 @@ bool lcl_checkFrameBtlr(SwNode* pStartNode, sax_fastparser::FastAttributeList* p const SvxCharRotateItem& rCharRotate = static_cast<const SvxCharRotateItem&>(*pItem); if (rCharRotate.GetValue() == 900) { - pTextboxAttrList->add(XML_style, "mso-layout-flow-alt:bottom-to-top"); + if (pTextboxAttrList) + pTextboxAttrList->add(XML_style, "mso-layout-flow-alt:bottom-to-top"); + else + pBodyPrAttrList->add(XML_vert, "vert270"); return true; } } @@ -471,7 +477,11 @@ void DocxAttributeOutput::WriteDMLTextFrame(sw::Frame* pParentFrame) m_rExport.mpParentFrame = NULL; m_pSerializer->startElementNS( XML_wps, XML_txbx, FSEND ); m_pSerializer->startElementNS( XML_w, XML_txbxContent, FSEND ); + + m_bFrameBtLr = lcl_checkFrameBtlr(m_rExport.pDoc->GetNodes()[nStt], 0, m_pBodyPrAttrList); m_rExport.WriteText( ); + m_bFrameBtLr = false; + m_pSerializer->endElementNS( XML_w, XML_txbxContent ); m_pSerializer->endElementNS( XML_wps, XML_txbx ); XFastAttributeListRef xBodyPrAttrList(m_pBodyPrAttrList); |