summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/atrftn.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-07-11 18:37:28 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2019-07-22 08:32:07 +0200
commit28b77c89dfcafae82cf2a6d85731b643ff9290e5 (patch)
tree4d26e493cebd1d83025094a3a97b9e878bc2b930 /sw/source/core/txtnode/atrftn.cxx
parent22f2ecbcabf3928d5486690ca6465b7b37bc8a10 (diff)
tdf#117185 tdf#110442 sw: bring harmony & peace to fly at-char selection
Use IsDestroyFrameAnchoredAtChar() to harmonize the at-char fly selection across all relevant operations: * CopyImpl: this is the most tricky one: - the code in CopyWithFlyInFly() and CopyFlyInFlyImpl() is quite con- voluted as it needs to do some things ignoring a partially selected start node, while including it in other cases - it had pre-existing bugs too that would lose a fly anchored to the 2nd (1st fully selected) node of a redline - now it needs to copy the flys in the selection if it is inside a single node - another complication is that flys that already existed at the insert position need to have their anchors corrected - SwUndoInsLayFormat need to be created for the appropriate flys - SwUndoInserts Undo/Redo needs to run the nested SwUndoInsLayFormat at the appropriate time - SwUndoInserts::UndoImpl() needs a special case to *never* delete flys at the start/end of the selection because those are handled by nested SwUndoInsLayFormat - Insert File (shellio.cxx) needs adapting to the SwUndoInserts change * DeleteRange: this just needs to delete the flys via DelFlyInRange() * MoveRange: - this is used by the old SwRangeRedline Show/Hide, i.e. on ODF export - the SaveFlyInRange()/RestFlyInRange() was rather inadequate and didn't even restore content indexes at all... * IsShown: the sw_redlinehide code needs to check visibility against the (inverted) extents The selection behavior is changed so that at-char flys in the start and end node of the selection are also selected, instead of having their anchor moved to a different content index by the operation. This appears more obvious and user-friendly, fixes tdf#110442, and is also more like what Word does. Selections exclude the start and end position except if it's a fully selected node or at the start or end of a section (i.e. Ctrl+A should also select every at-char fly). A special hack is needed to keep writerfilter happy for now; it likes to anchor flys at nodes which it then deletes in RemoveLastParagraph(), which likely could be improved there (disposing the SwXParagraph runs into the same problem...). Crashes fixed by this: tdf#117185 tdf#117215 except comment#12 tdf#124720 tdf#124721 tdf#124739 Previously fixed bugs tested: i#97570 plus the 2 bugs that already have UITests Change-Id: I4fec2a3c15ca0e64e5c4e99acfb04f59bb2bcf64 Reviewed-on: https://gerrit.libreoffice.org/75516 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source/core/txtnode/atrftn.cxx')
-rw-r--r--sw/source/core/txtnode/atrftn.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 81afed72030b..18bf9c5d05f4 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -398,7 +398,7 @@ void SwTextFootnote::CopyFootnote(
SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
sal_uLong nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
- m_pTextNode->GetDoc()->GetDocumentContentOperationsManager().CopyWithFlyInFly( aRg, 0, aEnd );
+ m_pTextNode->GetDoc()->GetDocumentContentOperationsManager().CopyWithFlyInFly(aRg, aEnd);
// in case the destination section was not empty, delete the old nodes
// before: Src: SxxxE, Dst: SnE