summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-24 15:04:54 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-07-24 17:21:23 +0200
commit0a5bd26f9d21506f71951a383d8d0d8e5abf3f77 (patch)
tree8cc3bce6a70c2ce07e491c441ffcdd64af0ecf31 /writerfilter
parent6cfe3c93dc55264e57f1057a2911d54232353d13 (diff)
implement import of RTF_{MMR,MNARY,MNARYPR,MSUB,MSUP,MSUBHIDE,MSUPHIDE}
Change-Id: Ic975c7c1653fd10ef0a22ecbbbd740adac0789e0
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx36
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx8
2 files changed, 42 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5957194e6669..b221f44b3d33 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -954,6 +954,8 @@ void RTFDocumentImpl::text(OUString& rString)
case DESTINATION_MCHR:
case DESTINATION_MBEGCHR:
case DESTINATION_MENDCHR:
+ case DESTINATION_MSUBHIDE:
+ case DESTINATION_MSUPHIDE:
m_aStates.top().aDestinationText.append(rString);
break;
case DESTINATION_EQINSTRUCTION:
@@ -1451,6 +1453,12 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
case RTF_MCHR:
m_aStates.top().nDestinationState = DESTINATION_MCHR;
break;
+ case RTF_MSUBHIDE:
+ m_aStates.top().nDestinationState = DESTINATION_MSUBHIDE;
+ break;
+ case RTF_MSUPHIDE:
+ m_aStates.top().nDestinationState = DESTINATION_MSUPHIDE;
+ break;
case RTF_MBEGCHR:
m_aStates.top().nDestinationState = DESTINATION_MBEGCHR;
break;
@@ -1505,6 +1513,22 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
m_aMathBuffer.appendOpeningTag(M_TOKEN(mr));
m_aStates.top().nDestinationState = DESTINATION_MMR;
break;
+ case RTF_MNARY:
+ m_aMathBuffer.appendOpeningTag(M_TOKEN(nary));
+ m_aStates.top().nDestinationState = DESTINATION_MNARY;
+ break;
+ case RTF_MNARYPR:
+ m_aMathBuffer.appendOpeningTag(M_TOKEN(naryPr));
+ m_aStates.top().nDestinationState = DESTINATION_MNARYPR;
+ break;
+ case RTF_MSUB:
+ m_aMathBuffer.appendOpeningTag(M_TOKEN(sub));
+ m_aStates.top().nDestinationState = DESTINATION_MSUB;
+ break;
+ case RTF_MSUP:
+ m_aMathBuffer.appendOpeningTag(M_TOKEN(sup));
+ m_aStates.top().nDestinationState = DESTINATION_MSUP;
+ 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
@@ -3169,7 +3193,9 @@ int RTFDocumentImpl::pushState()
m_aStates.top().nDestinationState == DESTINATION_MDEN ||
m_aStates.top().nDestinationState == DESTINATION_ME ||
m_aStates.top().nDestinationState == DESTINATION_MFNAME ||
- m_aStates.top().nDestinationState == DESTINATION_MLIM)
+ m_aStates.top().nDestinationState == DESTINATION_MLIM ||
+ m_aStates.top().nDestinationState == DESTINATION_MSUB ||
+ m_aStates.top().nDestinationState == DESTINATION_MSUP)
m_aStates.top().nDestinationState = DESTINATION_NORMAL;
else if (m_aStates.top().nDestinationState == DESTINATION_FIELDINSTRUCTION && m_bEq)
m_aStates.top().nDestinationState = DESTINATION_EQINSTRUCTION;
@@ -3647,6 +3673,8 @@ int RTFDocumentImpl::popState()
case DESTINATION_MCHR:
case DESTINATION_MBEGCHR:
case DESTINATION_MENDCHR:
+ case DESTINATION_MSUBHIDE:
+ case DESTINATION_MSUPHIDE:
{
oox::formulaimport::XmlStream::AttributeList aAttribs;
aAttribs[M_TOKEN(val)] = m_aStates.top().aDestinationText.makeStringAndClear();
@@ -3656,6 +3684,8 @@ int RTFDocumentImpl::popState()
case DESTINATION_MCHR: nToken = M_TOKEN(chr); break;
case DESTINATION_MBEGCHR: nToken = M_TOKEN(begChr); break;
case DESTINATION_MENDCHR: nToken = M_TOKEN(endChr); break;
+ case DESTINATION_MSUBHIDE: nToken = M_TOKEN(subHide); break;
+ case DESTINATION_MSUPHIDE: nToken = M_TOKEN(supHide); break;
default: break;
}
m_aMathBuffer.appendOpeningTag(nToken, aAttribs);
@@ -3676,6 +3706,10 @@ int RTFDocumentImpl::popState()
case DESTINATION_MM: m_aMathBuffer.appendClosingTag(M_TOKEN(m)); break;
case DESTINATION_MMPR: m_aMathBuffer.appendClosingTag(M_TOKEN(mPr)); break;
case DESTINATION_MMR: m_aMathBuffer.appendClosingTag(M_TOKEN(mr)); break;
+ case DESTINATION_MNARY: m_aMathBuffer.appendClosingTag(M_TOKEN(nary)); break;
+ case DESTINATION_MNARYPR: m_aMathBuffer.appendClosingTag(M_TOKEN(naryPr)); break;
+ case DESTINATION_MSUB: m_aMathBuffer.appendClosingTag(M_TOKEN(sub)); break;
+ case DESTINATION_MSUP: m_aMathBuffer.appendClosingTag(M_TOKEN(sup)); break;
default: break;
}
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 06f7f053aef5..2de0a0b5602c 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -145,7 +145,13 @@ namespace writerfilter {
DESTINATION_MLIM,
DESTINATION_MM,
DESTINATION_MMPR,
- DESTINATION_MMR
+ DESTINATION_MMR,
+ DESTINATION_MNARY,
+ DESTINATION_MNARYPR,
+ DESTINATION_MSUB,
+ DESTINATION_MSUP,
+ DESTINATION_MSUBHIDE,
+ DESTINATION_MSUPHIDE
};
enum RTFBorderState