diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-04-15 17:59:55 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-04-16 11:12:04 +0200 |
commit | e49917352ed2a53cd9025a65560bc3ea2808f4e5 (patch) | |
tree | 2d528cf8d2447a252442eb9a9c80e2ec976e1b99 /sw | |
parent | 21cd910d144b14ead358bccd1146650806346eb5 (diff) |
sw: DOCX export: DocxAttributeOutput::EndField_Impl() omits bookmark end
(regression from f5c266695a4a88da7db971a21915e2bbf758d48e)
Change-Id: I00c871c096e8370e3ba4fccd1d02d350142d6b28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114166
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 18 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.hxx | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 7573ede5f0ff..d0fd48ffb15f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1681,16 +1681,10 @@ void DocxAttributeOutput::DoWriteBookmarkTagStart(const OUString & bookmarkName) FSNS(XML_w, XML_name), BookmarkToWord(bookmarkName)); } -void DocxAttributeOutput::DoWriteBookmarkTagEnd(const OUString & bookmarkName) +void DocxAttributeOutput::DoWriteBookmarkTagEnd(sal_Int32 const nId) { - const auto nameToIdIter = m_rOpenedBookmarksIds.find(bookmarkName); - if (nameToIdIter != m_rOpenedBookmarksIds.end()) - { - const sal_Int32 nId = nameToIdIter->second; - - m_pSerializer->singleElementNS(XML_w, XML_bookmarkEnd, - FSNS(XML_w, XML_id), OString::number(nId)); - } + m_pSerializer->singleElementNS(XML_w, XML_bookmarkEnd, + FSNS(XML_w, XML_id), OString::number(nId)); } void DocxAttributeOutput::DoWriteBookmarkStartIfExist(sal_Int32 nRunPos) @@ -1715,7 +1709,7 @@ void DocxAttributeOutput::DoWriteBookmarkEndIfExist(sal_Int32 nRunPos) if (pPos != m_rOpenedBookmarksIds.end()) { // Output the bookmark - DoWriteBookmarkTagEnd(aIter->second); + DoWriteBookmarkTagEnd(pPos->second); m_rOpenedBookmarksIds.erase(aIter->second); } } @@ -1746,7 +1740,7 @@ void DocxAttributeOutput::DoWriteBookmarksEnd(std::vector<OUString>& rEnds) if (pPos != m_rOpenedBookmarksIds.end()) { // Output the bookmark - DoWriteBookmarkTagEnd(bookmarkName); + DoWriteBookmarkTagEnd(pPos->second); m_rOpenedBookmarksIds.erase(bookmarkName); } @@ -2359,7 +2353,7 @@ void DocxAttributeOutput::EndField_Impl( const SwTextNode* pNode, sal_Int32 nPos // Write the bookmark end if any if ( !m_sFieldBkm.isEmpty() ) { - DoWriteBookmarkTagEnd(m_sFieldBkm); + DoWriteBookmarkTagEnd(m_nNextBookmarkId); m_nNextBookmarkId++; } diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 977c57f0d9f8..4b7e807c1927 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -694,7 +694,7 @@ protected: private: void DoWriteBookmarkTagStart(const OUString & bookmarkName); - void DoWriteBookmarkTagEnd(const OUString & bookmarkName); + void DoWriteBookmarkTagEnd(sal_Int32 nId); void DoWriteBookmarksStart(std::vector<OUString>& rStarts); void DoWriteBookmarksEnd(std::vector<OUString>& rEnds); void DoWriteBookmarkStartIfExist(sal_Int32 nRunPos); |