summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-26 10:07:10 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-26 13:21:30 +0200
commitc098c3e35ed22bc26841f4c3976b2fc02cdf4642 (patch)
tree52e554e6b8970093533f6b7ebe0d7d05314beb8f /starmath
parent947b3986d1f45c3e5432d57a48d8052db197f012 (diff)
export RTF_MEQARR
Change-Id: Ic2c1ca04c23b41ae36aa0a8866dc9b7776ccad64
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/rtfexport.cxx25
1 files changed, 19 insertions, 6 deletions
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<const SmOperNode*>(pNode), nLevel);
break;
+ case NUNHOR:
+ HandleUnaryOperation(static_cast<const SmUnHorNode*>(pNode), nLevel);
+ break;
case NBINHOR:
HandleBinaryOperation(static_cast<const SmBinHorNode*>(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<const SmTextNode*>(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);