diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-25 17:48:50 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-26 09:44:15 +0200 |
commit | 189ad9186cb905ff9830319fd86be4e183a30be4 (patch) | |
tree | af75f44f2a3dc69e4a449f3d4a08261409e97741 /starmath | |
parent | cc22622f379a5dc59a00625cdace561e4ba14c14 (diff) |
export RTF_MRAD
Change-Id: I1b5802dfba24b45358842189d8ae05c3f9de319f
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/rtfexport.cxx | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx index 32b62ff1712e..32c441a70d30 100644 --- a/starmath/source/rtfexport.cxx +++ b/starmath/source/rtfexport.cxx @@ -80,6 +80,9 @@ void SmRtfExport::HandleNode(const SmNode* pNode, int nLevel) case NBINVER: HandleFractions(pNode, nLevel); break; + case NROOT: + HandleRoot(static_cast<const SmRootNode*>(pNode), nLevel); + break; case NMATH: HandleMath(pNode, nLevel); break; @@ -96,6 +99,9 @@ void SmRtfExport::HandleNode(const SmNode* pNode, int nLevel) case NLINE: HandleAllSubNodes(pNode, nLevel); break; + case NPLACE: + // explicitly do nothing, MSOffice treats that as a placeholder if item is missing + break; default: SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC << " unhandled node type"); break; @@ -267,9 +273,26 @@ void SmRtfExport::HandleMath(const SmNode* pNode, int nLevel) } } -void SmRtfExport::HandleRoot(const SmRootNode* /*pNode*/, int /*nLevel*/) +void SmRtfExport::HandleRoot(const SmRootNode* pNode, int nLevel) { - SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC); + m_pBuffer->append("{\\mrad "); + if (const SmNode* argument = pNode->Argument()) + { + m_pBuffer->append("{\\mdeg "); + HandleNode(argument, nLevel + 1); + m_pBuffer->append("}"); // mdeg + } + else + { + m_pBuffer->append("{\\mradPr "); + m_pBuffer->append("{\\mdegHide 1}"); + m_pBuffer->append("}"); // mradPr + m_pBuffer->append("{\\mdeg }"); // empty but present + } + m_pBuffer->append("{\\me "); + HandleNode(pNode->Body(), nLevel + 1); + m_pBuffer->append("}"); // me + m_pBuffer->append("}"); // mrad } namespace { |