diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-25 14:51:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-25 17:07:36 +0200 |
commit | 0e15567d5100df21b541cb908138cb10aa57a501 (patch) | |
tree | 82ae0223a2d81988273a87dbfeab948dfdfb81c9 | |
parent | 041961e18b16c64d1395b1ed6fcb460d82b9939a (diff) |
export RTF_MACC and related keywords
Change-Id: I862f008f2a8b4972be1b33ec45128bbfeeb9fb99
-rw-r--r-- | starmath/source/rtfexport.cxx | 69 |
1 files changed, 67 insertions, 2 deletions
diff --git a/starmath/source/rtfexport.cxx b/starmath/source/rtfexport.cxx index f4e560f12539..fa8b8168401e 100644 --- a/starmath/source/rtfexport.cxx +++ b/starmath/source/rtfexport.cxx @@ -31,6 +31,7 @@ #include <rtl/oustringostreaminserter.hxx> #include <svtools/rtfkeywd.hxx> +#include <filter/msfilter/rtfutil.hxx> SmRtfExport::SmRtfExport(const SmNode* pIn) : m_pTree(pIn) @@ -58,6 +59,9 @@ void SmRtfExport::HandleNode(const SmNode* pNode, int nLevel) switch(pNode->GetType()) { + case NATTRIBUT: + HandleAttribute( static_cast< const SmAttributNode* >( pNode ), nLevel ); + break; case NTEXT: HandleText(pNode,nLevel); break; @@ -170,9 +174,70 @@ void SmRtfExport::HandleBinaryOperation(const SmBinHorNode* pNode, int nLevel) } } -void SmRtfExport::HandleAttribute(const SmAttributNode* /*pNode*/, int /*nLevel*/) +void SmRtfExport::HandleAttribute(const SmAttributNode* pNode, int nLevel) { - SAL_INFO("starmath.rtf", "TODO: " << OSL_THIS_FUNC); + switch (pNode->Attribute()->GetToken().eType) + { + case TCHECK: + case TACUTE: + case TGRAVE: + case TBREVE: + case TCIRCLE: + case TVEC: + case TTILDE: + case THAT: + case TDOT: + case TDDOT: + case TDDDOT: + case TWIDETILDE: + case TWIDEHAT: + case TWIDEVEC: + case TBAR: + { + m_pBuffer->append("{\\macc "); + m_pBuffer->append("{\\maccPr "); + m_pBuffer->append("{\\mchr "); + OUString aValue(pNode->Attribute()->GetToken().cMathChar); + m_pBuffer->append(msfilter::rtfutil::OutString(aValue, RTL_TEXTENCODING_MS_1252)); + m_pBuffer->append("}"); // mchr + m_pBuffer->append("}"); // maccPr + m_pBuffer->append("{\\me "); + HandleNode( pNode->Body(), nLevel + 1 ); + m_pBuffer->append("}"); // me + m_pBuffer->append("}"); // macc + break; + } + case TOVERLINE: + case TUNDERLINE: + m_pBuffer->append("{\\mbar "); + m_pBuffer->append("{\\mbarPr "); + m_pBuffer->append("{\\mpos "); + m_pBuffer->append((pNode->Attribute()->GetToken().eType == TUNDERLINE ) ? "bot" : "top"); + m_pBuffer->append("}"); // mpos + m_pBuffer->append("}"); // mbarPr + m_pBuffer->append("{\\me "); + HandleNode( pNode->Body(), nLevel + 1 ); + m_pBuffer->append("}"); // me + m_pBuffer->append("}"); // mbar + break; + case TOVERSTRIKE: + m_pBuffer->append("{\\mborderBox "); + m_pBuffer->append("{\\mborderBoxPr "); + m_pBuffer->append("{\\mhideTop 1}"); + m_pBuffer->append("{\\mhideBot 1}"); + m_pBuffer->append("{\\mhideLeft 1}"); + m_pBuffer->append("{\\mhideRight 1}"); + m_pBuffer->append("{\\mstrikeH 1}"); + m_pBuffer->append("}"); // mborderBoxPr + m_pBuffer->append("{\\me "); + HandleNode( pNode->Body(), nLevel + 1 ); + m_pBuffer->append("}"); // me + m_pBuffer->append("}"); // mborderBox + break; + default: + HandleAllSubNodes( pNode, nLevel ); + break; + } } void SmRtfExport::HandleMath(const SmNode* pNode, int nLevel) |