diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-10 18:43:08 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@frugalware.org> | 2011-08-10 18:43:08 +0200 |
commit | 7c9156d9c5e6f4ea2af9131382c67810165da8fb (patch) | |
tree | f9714a010a65d12b41c5f743995bcbfb13945498 /writerfilter | |
parent | 6751324082ca472b9a34caabdd0a1032c27438b9 (diff) |
implement the RTF_FALT destination
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 16 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index eb841c9a2da0..95b9772f7ed9 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -748,6 +748,7 @@ void RTFDocumentImpl::text(OUString& rString) case DESTINATION_OBJDATA: case DESTINATION_ANNOTATIONDATE: case DESTINATION_ANNOTATIONAUTHOR: + case DESTINATION_FALT: m_aStates.top().aDestinationText.append(rString); break; case DESTINATION_EQINSTRUCTION: @@ -1132,6 +1133,9 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) case RTF_ATNAUTHOR: m_aStates.top().nDestinationState = DESTINATION_ANNOTATIONAUTHOR; break; + case RTF_FALT: + m_aStates.top().nDestinationState = DESTINATION_FALT; + break; case RTF_LISTTEXT: // Should be ignored by any reader that understands Word 97 through Word 2007 numbering. case RTF_NONESTTABLES: @@ -2341,6 +2345,7 @@ int RTFDocumentImpl::pushState() else aState = m_aStates.top(); m_aStates.push(aState); + m_aStates.top().aDestinationText.setLength(0); m_nGroup++; @@ -2420,6 +2425,7 @@ int RTFDocumentImpl::popState() RTFShape aShape; bool bPopShapeProperties = false; bool bPopPictureProperties = false; + bool bFaltEnd = false; if (m_aStates.top().nDestinationState == DESTINATION_FONTTABLE) { @@ -2725,6 +2731,14 @@ int RTFDocumentImpl::popState() } else if (m_aStates.top().nDestinationState == DESTINATION_ANNOTATIONAUTHOR) m_aAuthor = m_aStates.top().aDestinationText.makeStringAndClear(); + else if (m_aStates.top().nDestinationState == DESTINATION_FALT) + { + OUString aStr(m_aStates.top().aDestinationText.makeStringAndClear()); + RTFValue::Pointer_t pValue(new RTFValue(aStr)); + m_aStates.top().aTableSprms->push_back(make_pair(NS_ooxml::LN_CT_Font_altName, pValue)); + aSprms = m_aStates.top().aTableSprms; + bFaltEnd = true; + } // See if we need to end a track change RTFValue::Pointer_t pTrackchange = m_aStates.top().aCharacterSprms.find(NS_ooxml::LN_trackchange); @@ -2775,6 +2789,8 @@ int RTFDocumentImpl::popState() m_aStates.top().aShape = aShape; m_aStates.top().aCharacterAttributes = aAttributes; } + else if (bFaltEnd) + m_aStates.top().aTableSprms = aSprms; if (bPopPictureProperties) m_aStates.top().aCharacterAttributes = aAttributes; if (m_pCurrentBuffer == &m_aSuperBuffer) diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 411bfe27a544..958c8d5e661f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -111,7 +111,8 @@ namespace writerfilter { DESTINATION_OBJDATA, DESTINATION_RESULT, DESTINATION_ANNOTATIONDATE, - DESTINATION_ANNOTATIONAUTHOR + DESTINATION_ANNOTATIONAUTHOR, + DESTINATION_FALT }; enum RTFBorderState |