summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfdocumentimpl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index cc01274a68e8..bb1991d95d98 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -156,7 +156,7 @@ static OString lcl_DTTM22OString(long lDTTM)
return DateTimeToOString(msfilter::util::DTTM2DateTime(lDTTM));
}
-static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties(int nPos, OUString& rString)
+static RTFSprms lcl_getBookmarkProperties(int nPos, OUString& rString)
{
RTFSprms aAttributes;
auto pPos = std::make_shared<RTFValue>(nPos);
@@ -167,7 +167,7 @@ static writerfilter::Reference<Properties>::Pointer_t lcl_getBookmarkProperties(
aAttributes.set(NS_ooxml::LN_CT_Bookmark_name, pString);
}
aAttributes.set(NS_ooxml::LN_CT_MarkupRangeBookmark_id, pPos);
- return std::make_shared<RTFReferenceProperties>(aAttributes);
+ return aAttributes;
}
static const char* lcl_RtfToString(RTFKeyword nKeyword)
@@ -5313,7 +5313,10 @@ RTFError RTFDocumentImpl::popState()
OUString aStr = m_aStates.top().pDestinationText->makeStringAndClear();
int nPos = m_aBookmarks.size();
m_aBookmarks[aStr] = nPos;
- Mapper().props(lcl_getBookmarkProperties(nPos, aStr));
+ if (!m_aStates.top().pCurrentBuffer)
+ Mapper().props(std::make_shared<RTFReferenceProperties>(lcl_getBookmarkProperties(nPos, aStr)));
+ else
+ m_aStates.top().pCurrentBuffer->push_back(Buf_t(BUFFER_PROPS, std::make_shared<RTFValue>(lcl_getBookmarkProperties(nPos, aStr)), nullptr));
}
break;
case Destination::BOOKMARKEND:
@@ -5321,7 +5324,10 @@ RTFError RTFDocumentImpl::popState()
if (&m_aStates.top().aDestinationText != m_aStates.top().pDestinationText)
break; // not for nested group
OUString aStr = m_aStates.top().pDestinationText->makeStringAndClear();
- Mapper().props(lcl_getBookmarkProperties(m_aBookmarks[aStr], aStr));
+ if (!m_aStates.top().pCurrentBuffer)
+ Mapper().props(std::make_shared<RTFReferenceProperties>(lcl_getBookmarkProperties(m_aBookmarks[aStr], aStr)));
+ else
+ m_aStates.top().pCurrentBuffer->push_back(Buf_t(BUFFER_PROPS, std::make_shared<RTFValue>(lcl_getBookmarkProperties(m_aBookmarks[aStr], aStr)), nullptr));
}
break;
case Destination::INDEXENTRY: