diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-09-19 21:18:52 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-09-21 08:29:30 +0200 |
commit | 601dfe1cc547c4ae4a8e87da6d268e04ba445555 (patch) | |
tree | 42e8b62bb230aba40e951fe9ddb6fd82d1d2a615 | |
parent | 58b35faee869383974da0acfdf24577603634b7b (diff) |
tdf#157129 sw: fix wrong cursor position after paste
This asserts in SwUndoInserts::UndoImpl():
index.cxx:234: virtual SwContentIndexReg::~SwContentIndexReg(): Assertion `!m_pFirst && !m_pLast && "There are still indices registered"' failed.
Because there is a bookmark still registered, because the content was
inserted wrongly into a fly frame that contains a SwGrfNode, because
earlier the cursor was in a hidden text node and
SwCursorShell::UpdateCursorPos() moved it into an as-char anchored image.
UpdateCursorPos() should put the cursor only onto a text node.
(somehow regression from commit bb733957dd39e6f0b9d80bb59eb0177188794797)
Change-Id: If00d1e09a612849a44bb3e2d3bd7bac6fa9ac05f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157071
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
(cherry picked from commit b20ca8d951e8205c8b963c6b7407f984053b4094)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157111
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index f2b8ad05f738..49a6e7aaff4d 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -1764,8 +1764,8 @@ void SwCursorShell::VisPortChgd( const SwRect & rRect ) /** Set the cursor back into content. - This should only be called if the cursor was move somewhere else (e.g. when - deleting a border). The new position is calculated from its current position + This should only be called if the cursor was moved (e.g. when deleting a + text frame). The new position is calculated from its current position in the layout. */ void SwCursorShell::UpdateCursorPos() @@ -1777,7 +1777,7 @@ void SwCursorShell::UpdateCursorPos() if (isInHiddenTextFrame(pShellCursor) && !ExtendedSelectedAll()) { - SwCursorMoveState aTmpState( CursorMoveState::NONE ); + SwCursorMoveState aTmpState(CursorMoveState::SetOnlyText); aTmpState.m_bSetInReadOnly = IsReadOnlyAvailable(); GetLayout()->GetModelPositionForViewPoint( pShellCursor->GetPoint(), pShellCursor->GetPtPos(), &aTmpState ); |