diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-23 17:00:10 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-23 17:18:36 +0200 |
commit | 2a7e3836733c0af54b9d337e55cc32cdf58cdd6d (patch) | |
tree | 18a5e60e6b1073b7367b0b31bc566c86298bc057 /writerfilter | |
parent | 4a62512086fe71d98f3de95706ab1350625a7616 (diff) |
implement import of RTF_{MACC,MACCPR,MCHR,ME}
Change-Id: I5521bc3dc58b096dd80746a0af9c9d5e24ffe4a3
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 43 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 6 |
2 files changed, 47 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 187ae91cc721..13385423ab73 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -950,6 +950,7 @@ void RTFDocumentImpl::text(OUString& rString) case DESTINATION_DOCCOMM: case DESTINATION_ATNID: case DESTINATION_MR: + case DESTINATION_MCHR: m_aStates.top().aDestinationText.append(rString); break; case DESTINATION_EQINSTRUCTION: @@ -1445,6 +1446,30 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) m_aStates.top().nDestinationState = DESTINATION_MDEN; } break; + case RTF_MACC: + { + uno::Reference<xml::sax::XFastAttributeList> aAttribs; + m_aMathBuffer.appendOpeningTag(oox::NMSP_officeMath | oox::XML_acc, aAttribs); + m_aStates.top().nDestinationState = DESTINATION_MACC; + } + break; + case RTF_MACCPR: + { + uno::Reference<xml::sax::XFastAttributeList> aAttribs; + m_aMathBuffer.appendOpeningTag(oox::NMSP_officeMath | oox::XML_accPr, aAttribs); + m_aStates.top().nDestinationState = DESTINATION_MACCPR; + } + break; + case RTF_MCHR: + m_aStates.top().nDestinationState = DESTINATION_MCHR; + break; + case RTF_ME: + { + uno::Reference<xml::sax::XFastAttributeList> aAttribs; + m_aMathBuffer.appendOpeningTag(oox::NMSP_officeMath | oox::XML_e, aAttribs); + m_aStates.top().nDestinationState = DESTINATION_ME; + } + break; default: SAL_INFO("writerfilter", OSL_THIS_FUNC << ": TODO handle destination '" << lcl_RtfToString(nKeyword) << "'"); // Make sure we skip destinations (even without \*) till we don't handle them @@ -3097,7 +3122,10 @@ int RTFDocumentImpl::pushState() else if (m_aStates.top().nDestinationState == DESTINATION_FIELDRESULT || m_aStates.top().nDestinationState == DESTINATION_SHAPETEXT || m_aStates.top().nDestinationState == DESTINATION_FORMFIELD || - (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && !m_bEq)) + (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && !m_bEq) || + m_aStates.top().nDestinationState == DESTINATION_MOMATH || + m_aStates.top().nDestinationState == DESTINATION_MNUM || + m_aStates.top().nDestinationState == DESTINATION_MDEN) m_aStates.top().nDestinationState = DESTINATION_NORMAL; else if (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && m_bEq) m_aStates.top().nDestinationState = DESTINATION_EQINSTRUCTION; @@ -3536,6 +3564,19 @@ int RTFDocumentImpl::popState() m_aMathBuffer.appendClosingTag(oox::NMSP_officeMath | oox::XML_num); else if (m_aStates.top().nDestinationState == DESTINATION_MDEN) m_aMathBuffer.appendClosingTag(oox::NMSP_officeMath | oox::XML_den); + else if (m_aStates.top().nDestinationState == DESTINATION_MACC) + m_aMathBuffer.appendClosingTag(oox::NMSP_officeMath | oox::XML_acc); + else if (m_aStates.top().nDestinationState == DESTINATION_MACCPR) + m_aMathBuffer.appendClosingTag(oox::NMSP_officeMath | oox::XML_accPr); + else if (m_aStates.top().nDestinationState == DESTINATION_MCHR) + { + oox::formulaimport::XmlStream::AttributeList aAttribs; + aAttribs[oox::NMSP_officeMath | oox::XML_val] = m_aStates.top().aDestinationText.makeStringAndClear(); + m_aMathBuffer.appendOpeningTag(oox::NMSP_officeMath | oox::XML_chr, aAttribs); + m_aMathBuffer.appendClosingTag(oox::NMSP_officeMath | oox::XML_chr); + } + else if (m_aStates.top().nDestinationState == DESTINATION_ME) + m_aMathBuffer.appendClosingTag(oox::NMSP_officeMath | oox::XML_e); // See if we need to end a track change RTFValue::Pointer_t pTrackchange = m_aStates.top().aCharacterSprms.find(NS_ooxml::LN_trackchange); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 3483e0dbd814..dd98a28e0386 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -126,7 +126,11 @@ namespace writerfilter { DESTINATION_MFPR, DESTINATION_MCTRLPR, DESTINATION_MNUM, - DESTINATION_MDEN + DESTINATION_MDEN, + DESTINATION_MACC, + DESTINATION_MACCPR, + DESTINATION_MCHR, + DESTINATION_ME }; enum RTFBorderState |