diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-06 12:32:20 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-12-18 17:55:28 +0100 |
commit | 63dba5203e8bc7fc390943cb8208ae904f18e3bb (patch) | |
tree | c7bb17457f2b7ec0b4f09adc3defbd7fb16e46bd /sw/source/core/layout/wsfrm.cxx | |
parent | 6364180490d350b95410693c170d3031a8aebede (diff) |
sw_redlinehide_4b: fix some problems with pathological table redlines
As seen in ooo95711-1.odt, the ODF import may create a redline that
starts on a SwTableNode - though i haven't been able to figure out how
such an odd creature might arise from UI actions.
Try to fix the obvious places so we don't crash easily; there might be
more trouble elsewhere though with code that assumes that a redline
starts on a SwTextNode.
Change-Id: I8431c1416ac4503ff0209a946398656f1c28366d
Diffstat (limited to 'sw/source/core/layout/wsfrm.cxx')
-rw-r--r-- | sw/source/core/layout/wsfrm.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index a123f055e36c..73387e4741ca 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -4349,6 +4349,24 @@ static void UnHideRedlines(SwRootFrame & rLayout, rTextNode.NumRuleChgd(); } } + else if (rNode.IsTableNode() && rLayout.IsHideRedlines()) + { + SwPosition const tmp(rNode); + SwRangeRedline const*const pRedline( + rLayout.GetFormat()->GetDoc()->getIDocumentRedlineAccess().GetRedline(tmp, nullptr)); + // pathology: redline that starts on a TableNode; cannot + // be created in UI but by import filters... + if (pRedline + && pRedline->GetType() == nsRedlineType_t::REDLINE_DELETE + && &pRedline->Start()->nNode.GetNode() == &rNode) + { + for (sal_uLong j = rNode.GetIndex(); j <= rNode.EndOfSectionIndex(); ++j) + { + rNode.GetNodes()[j]->SetRedlineMergeFlag(SwNode::Merge::Hidden); + } + rNode.GetTableNode()->DelFrames(&rLayout); + } + } if (!rNode.IsCreateFrameWhenHidingRedlines()) { if (rLayout.IsHideRedlines()) |