summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-09-19 21:18:52 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2023-09-20 09:59:59 +0200
commitb20ca8d951e8205c8b963c6b7407f984053b4094 (patch)
tree79662757d10388d5f268b7e131f27e24e3228807
parentc2d7c8e5c616980d5fa77ac48babbf27342b2f0a (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>
-rw-r--r--sw/source/core/crsr/crsrsh.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 4d69e2a6d705..84f0ba59072a 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -1785,8 +1785,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()
@@ -1798,7 +1798,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 );