From c098c3e35ed22bc26841f4c3976b2fc02cdf4642 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 26 Jul 2012 10:07:10 +0200 Subject: export RTF_MEQARR Change-Id: Ic2c1ca04c23b41ae36aa0a8866dc9b7776ccad64 --- starmath/source/rtfexport.cxx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'starmath') diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx index 2031fe05c876..b8cebd70d57e 100644 --- a/starmath/source/rtfexport.cxx +++ b/starmath/source/rtfexport.cxx @@ -46,7 +46,7 @@ bool SmRtfExport::ConvertFromStarMath(OStringBuffer& rBuffer) m_pBuffer = &rBuffer; m_pBuffer->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE "\\moMath"); HandleNode(m_pTree, 0); - m_pBuffer->append("}"); + m_pBuffer->append("}"); // moMath return true; } @@ -74,6 +74,9 @@ void SmRtfExport::HandleNode(const SmNode* pNode, int nLevel) case NOPER: HandleOperator(static_cast(pNode), nLevel); break; + case NUNHOR: + HandleUnaryOperation(static_cast(pNode), nLevel); + break; case NBINHOR: HandleBinaryOperation(static_cast(pNode), nLevel); break; @@ -134,9 +137,17 @@ void SmRtfExport::HandleAllSubNodes(const SmNode* pNode, int nLevel) } } -void SmRtfExport::HandleVerticalStack(const SmNode* /*pNode*/, int /*nLevel*/) +void SmRtfExport::HandleVerticalStack(const SmNode* pNode, int nLevel) { - SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC); + m_pBuffer->append("{\\meqArr "); + int size = pNode->GetNumSubNodes(); + for (int i = 0; i < size; ++i) + { + m_pBuffer->append("{\\me "); + HandleNode(pNode->GetSubNode( i ), nLevel + 1); + m_pBuffer->append("}"); // me + } + m_pBuffer->append("}"); // meqArr } void SmRtfExport::HandleText(const SmNode* pNode, int /*nLevel*/) @@ -152,7 +163,7 @@ void SmRtfExport::HandleText(const SmNode* pNode, int /*nLevel*/) m_pBuffer->append(msfilter::rtfutil::OutString(aValue, RTL_TEXTENCODING_MS_1252)); } - m_pBuffer->append("}"); + m_pBuffer->append("}"); // mr } void SmRtfExport::HandleFractions(const SmNode* pNode, int nLevel, const char* type) @@ -176,9 +187,9 @@ void SmRtfExport::HandleFractions(const SmNode* pNode, int nLevel, const char* t m_pBuffer->append("}"); // mf } -void SmRtfExport::HandleUnaryOperation(const SmUnHorNode* /*pNode*/, int /*nLevel*/) +void SmRtfExport::HandleUnaryOperation(const SmUnHorNode* pNode, int nLevel) { - SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC); + HandleAllSubNodes(pNode, nLevel); } void SmRtfExport::HandleBinaryOperation(const SmBinHorNode* pNode, int nLevel) @@ -303,6 +314,8 @@ OString mathSymbolToString(const SmNode* node) { assert(node->GetType() == NMATH); const SmTextNode* txtnode = static_cast(node); + if (txtnode->GetText().Len() == 0) + return OString(); assert(txtnode->GetText().Len() == 1); sal_Unicode chr = SmTextNode::ConvertSymbolToUnicode(txtnode->GetText().GetChar(0)); OUString aValue(chr); -- cgit