diff options
author | László Németh <nemeth@numbertext.org> | 2019-07-18 19:44:05 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2019-07-19 15:32:50 +0200 |
commit | a5abe0fc4d435d3a7a7de8bf55ec74087fdd299a (patch) | |
tree | 4ce57993997a99bc29033cfa8e42f12a04277e13 /writerfilter/source | |
parent | 2ec1c7a69917ce39850addc49ea3eb8618869aac (diff) |
tdf#125546 DOCX import: fix overgrowth of change tracking entries
The same text portion could get double redlines including
ParagraphFormat. This broke redline compression, sometimes
resulting huge amount of redundant change tracking entries
based on rsId, or losing paragraph styles after deletion.
Change-Id: I5930eab2ef0bc7eb9c93a10cdd30b96cd41c9098
Reviewed-on: https://gerrit.libreoffice.org/75926
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 21beb6965bf9..62eab11b16cc 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -2146,11 +2146,16 @@ void DomainMapper_Impl::CheckRedline( uno::Reference< text::XTextRange > const& // (and so if that happens, it may be better to fix Writer). // Create the redlines here from lowest (formats) to highest (inserts/removals) priority, since the last one is // what Writer presents graphically, so this will show deletes as deleted text and not as just formatted text being there. - if( GetTopContextOfType(CONTEXT_PARAGRAPH) ) + bool bUsedRange = m_aRedlines.top().size() > 0 || (GetTopContextOfType(CONTEXT_CHARACTER) && + GetTopContextOfType(CONTEXT_CHARACTER)->Redlines().size() > 0); + + // only export ParagraphFormat, when there is no other redline in the same text portion to avoid missing redline compression + if( !bUsedRange && GetTopContextOfType(CONTEXT_PARAGRAPH) ) { std::vector<RedlineParamsPtr>& avRedLines = GetTopContextOfType(CONTEXT_PARAGRAPH)->Redlines(); for( const auto& rRedline : avRedLines ) CreateRedline( xRange, rRedline ); + return; } if( GetTopContextOfType(CONTEXT_CHARACTER) ) { |