diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-07 12:35:54 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-19 10:18:31 +0200 |
commit | 0e7dfa11153de18b16bb6ab36575e5bc6e380c19 (patch) | |
tree | dac325a6d98c1f192c542247548c7b2f3974ca5a /sw/inc/redline.hxx | |
parent | 3223f3eed63f9f4774c5f5115f5e4052ebba790a (diff) |
sw_redlinehide_2: fix frame updates for SwUndoRedlineDelete
There is a special case where the redline that is inserted doesn't have
a valid range and then it's split up inside AppendRedline(), in
SwRedlineTable::InsertWithValidRanges(). This happens for example
with a selection that includes a section start node but not its end node
(or vice versa).
This breaks the UpdateFramesForRemoveDeleteRedline() /
UpdateFramesForAddDeleteRedline() because they assume that the given
range is one SwRangeRedline; the result is duplicate text frames.
This could be worked around by iterating the SwRangeRedline in the given
PaM, but for the Remove case there is the additional complication that
the redlines are actually removed by the time the function is called.
So rework the implementation of DeleteAndJoinWithRedlineImpl()
to call the part of InsertWithValidRanges() that does the splitting
into multiple redlines (extracted into new sw::GetAllValidRanges())
and create multiple SwUndoRedlineDelete actions, each of which now
updates the frames properly.
Also clean up the horrible group-undo code to group before inserting,
instead of after-the-fact cleanup.
Change-Id: Ia279910e0c74edabe56b0c4cf87dbbad688179da
Diffstat (limited to 'sw/inc/redline.hxx')
-rw-r--r-- | sw/inc/redline.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx index 8b6e2a27a0c3..4afc978cd743 100644 --- a/sw/inc/redline.hxx +++ b/sw/inc/redline.hxx @@ -340,6 +340,13 @@ class SW_DLLPUBLIC SwRedlineHint : public SfxHint { }; + +namespace sw { + +std::vector<SwRangeRedline*> GetAllValidRanges(std::unique_ptr<SwRangeRedline> p); + +} // namespace sw + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |