diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-26 12:44:10 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-11-26 13:52:38 +0000 |
commit | c51c39ddf6d513afda83d4f15549c6277a0cc211 (patch) | |
tree | 9b760603df183299e8572474960a06ca45fca2e4 /writerfilter | |
parent | d9d1ce6a765cdf0846cc52633df28b9fb2d164c9 (diff) |
always pass bookmark name through to domainmapper
the rtf doc has three bookmark starts but only two matching
bookmark ends.
The tokenizer has three starts 0, 1, 2, but 0 is missing an end. Without the
end of 0, the mapper never inserts an entry for it, so later inserts the start
of rtftok index 1 as mapper index 0, and passing the end for a bare "1" cannot
be found by index. If we pass the name then it finds it by name as mapper index
0 and all is well.
Change-Id: I344db84e4f1c7d55fca59cdfe692080c7d0b8033
(cherry picked from commit 2b54caceab9d975bffa7e24bf732cb877b16632f)
Reviewed-on: https://gerrit.libreoffice.org/13133
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 859ca8242c88..5bab89b01b9b 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -170,12 +170,6 @@ static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties( return writerfilter::Reference<Properties>::Pointer_t(new RTFReferenceProperties(aAttributes)); } -static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties(int nPos) -{ - OUString aStr; - return lcl_getBookmarkProperties(nPos, aStr); -} - static const char* lcl_RtfToString(RTFKeyword nKeyword) { for (int i = 0; i < nRTFControlWords; i++) @@ -5191,10 +5185,13 @@ int RTFDocumentImpl::popState() } break; case DESTINATION_BOOKMARKEND: + { if (&m_aStates.top().aDestinationText != m_aStates.top().pDestinationText) break; // not for nested group - Mapper().props(lcl_getBookmarkProperties(m_aBookmarks[m_aStates.top().pDestinationText->makeStringAndClear()])); - break; + OUString aStr = m_aStates.top().pDestinationText->makeStringAndClear(); + Mapper().props(lcl_getBookmarkProperties(m_aBookmarks[aStr], aStr)); + } + break; case DESTINATION_FORMFIELDNAME: { if (&m_aStates.top().aDestinationText != m_aStates.top().pDestinationText) |