summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-10 16:21:29 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-10 17:01:56 +0200
commite34906d20c9febc420b115fa2a8b171826dea0be (patch)
treeacce1476c870326c21105d4d6345b3131e5a4464 /writerfilter
parent2862dcf7dd8a6f9cde9df2cc2b785df65e814f0c (diff)
fdo#84679 RTF import: fix paragraph spacing handling in tables
Regression from commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), we failed to do the proper deduplication in buffered content, like tables. Fix this by adapting RTFDocumentImpl::replayBuffer() to RTFDocumentImpl::checkNeedPap(), which already did the proper deduplication. To be fair, the inconsistency was there earlier since 9f5263c477b82fef5aa9c3e79fb6af92aa049e24 (fdo#44736 RTF import: ignore direct formatting which equals to style, 2012-11-25), but it caused no real harm earlier. Change-Id: I0673408088d9d83768f0780ea92ece87913d03f3
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 2fbf983bdbb2..83084d3a0265 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -440,7 +440,9 @@ void RTFDocumentImpl::setNeedSect(bool bNeedSect)
writerfilter::Reference<Properties>::Pointer_t RTFDocumentImpl::getProperties(RTFSprms& rAttributes, RTFSprms& rSprms)
{
- int nStyle = m_aStates.top().nCurrentStyleIndex;
+ int nStyle = 0;
+ if (!m_aStates.empty())
+ nStyle = m_aStates.top().nCurrentStyleIndex;
RTFReferenceTable::Entries_t::iterator it = m_aStyleTableEntries.find(nStyle);
if (it != m_aStyleTableEntries.end())
{
@@ -1434,10 +1436,9 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer,
rBuffer.pop_front();
if (boost::get<0>(aTuple) == BUFFER_PROPS)
{
+ // Construct properties via getProperties() and not directly, to take care of deduplication.
writerfilter::Reference<Properties>::Pointer_t const pProp(
- new RTFReferenceProperties(
- boost::get<1>(aTuple)->getAttributes(),
- boost::get<1>(aTuple)->getSprms())
+ getProperties(boost::get<1>(aTuple)->getAttributes(), boost::get<1>(aTuple)->getSprms())
);
Mapper().props(pProp);
}