summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-25 17:14:18 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-26 09:44:13 +0200
commit3a4026843835f9f73521d4e6cf150c17d86d6ed5 (patch)
tree6b75ff337221bf0fcdf63d5c89eba9fb2420f2d7 /starmath
parent66e4540041f09b4e779d27190f0925479f74103b (diff)
export RTF_MM
Change-Id: Ia3b2dd3de464d9be1fd496cc81ed903047f7542b
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/rtfexport.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx
index 493a483657b1..9a0a68c8946f 100644
--- a/starmath/source/rtfexport.cxx
+++ b/starmath/source/rtfexport.cxx
@@ -87,6 +87,9 @@ void SmRtfExport::HandleNode(const SmNode* pNode, int nLevel)
//Root Node, PILE equivalent, i.e. vertical stack
HandleTable(pNode,nLevel);
break;
+ case NMATRIX:
+ HandleMatrix(static_cast<const SmMatrixNode*>(pNode), nLevel);
+ break;
case NLINE:
HandleAllSubNodes(pNode, nLevel);
break;
@@ -362,9 +365,22 @@ void SmRtfExport::HandleSubSupScriptInternal(const SmSubSupNode* /*pNode*/, int
SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC);
}
-void SmRtfExport::HandleMatrix(const SmMatrixNode* /*pNode*/, int /*nLevel*/)
+void SmRtfExport::HandleMatrix(const SmMatrixNode* pNode, int nLevel)
{
- SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC);
+ m_pBuffer->append("{\\mm ");
+ for (int row = 0; row < pNode->GetNumRows(); ++row )
+ {
+ m_pBuffer->append("{\\mmr ");
+ for (int col = 0; col < pNode->GetNumCols(); ++col )
+ {
+ m_pBuffer->append("{\\me ");
+ if (const SmNode* node = pNode->GetSubNode(row * pNode->GetNumCols() + col))
+ HandleNode(node, nLevel + 1);
+ m_pBuffer->append("}"); // me
+ }
+ m_pBuffer->append("}"); // mmr
+ }
+ m_pBuffer->append("}"); // mm
}
void SmRtfExport::HandleBrace(const SmBraceNode* pNode, int nLevel)