diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-12-16 23:17:28 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-12-16 23:55:33 +0100 |
commit | f14e6e06b9e3c82c267649d63512a3538e5ee2f5 (patch) | |
tree | 863a5610ebe2f8763647cbbc41ac2e508e82e5f9 /writerfilter | |
parent | fdo#39440 reduce scope of local variables (diff) | |
download | core-f14e6e06b9e3c82c267649d63512a3538e5ee2f5.tar.gz core-f14e6e06b9e3c82c267649d63512a3538e5ee2f5.zip |
fdo#84685: writerfilter: RTF import: support \xe index entry
Change-Id: Ia957541a5997961aa86b2eb8537ebd29d3092691
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfcontrolwords.hxx | 1 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfcontrolwords.hxx b/writerfilter/source/rtftok/rtfcontrolwords.hxx index b55c2f2f485d..ac45593ac7ef 100644 --- a/writerfilter/source/rtftok/rtfcontrolwords.hxx +++ b/writerfilter/source/rtftok/rtfcontrolwords.hxx @@ -149,6 +149,7 @@ enum RTFDestinationState DESTINATION_BACKGROUND, DESTINATION_SHAPEGROUP, DESTINATION_FOOTNOTESEPARATOR, + DESTINATION_INDEXENTRY, }; enum RTFKeyword diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index fd5d02bb6818..3d7922a43cc7 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1259,6 +1259,7 @@ void RTFDocumentImpl::text(OUString& rString) case DESTINATION_MSUPHIDE: case DESTINATION_MTYPE: case DESTINATION_MGROW: + case DESTINATION_INDEXENTRY: m_aStates.top().pDestinationText->append(rString); break; default: @@ -1729,6 +1730,9 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) case RTF_BKMKEND: m_aStates.top().nDestinationState = DESTINATION_BOOKMARKEND; break; + case RTF_XE: + m_aStates.top().nDestinationState = DESTINATION_INDEXENTRY; + break; case RTF_REVTBL: m_aStates.top().nDestinationState = DESTINATION_REVISIONTABLE; break; @@ -5186,6 +5190,20 @@ int RTFDocumentImpl::popState() Mapper().props(lcl_getBookmarkProperties(m_aBookmarks[aStr], aStr)); } break; + case DESTINATION_INDEXENTRY: + { + if (&m_aStates.top().aDestinationText != m_aStates.top().pDestinationText) + break; // not for nested group + OUString str(m_aStates.top().pDestinationText->makeStringAndClear()); + // dmapper expects this as a field, so let's fake something... + str = "XE \"" + str.replaceAll("\"", "\\\"") + "\""; + singleChar(0x13); + Mapper().utext(reinterpret_cast<sal_uInt8 const*>(str.getStr()), str.getLength()); + singleChar(0x14); + // no result + singleChar(0x15); + } + break; case DESTINATION_FORMFIELDNAME: { if (&m_aStates.top().aDestinationText != m_aStates.top().pDestinationText) |