Update caret if needed when changing depth

Fixes bug #12856.
This commit is contained in:
Jean-Marc Lasgouttes 2023-08-30 13:45:00 +02:00
parent d27f309905
commit 0912f7c356
2 changed files with 3 additions and 2 deletions

View File

@ -2648,7 +2648,7 @@ bool Text::changeDepthAllowed(Cursor const & cur, DEPTH_CHANGE type) const
}
void Text::changeDepth(Cursor const & cur, DEPTH_CHANGE type)
void Text::changeDepth(Cursor & cur, DEPTH_CHANGE type)
{
LBUFERR(this == cur.text());
pit_type const beg = cur.selBegin().pit();
@ -2667,6 +2667,7 @@ void Text::changeDepth(Cursor const & cur, DEPTH_CHANGE type)
}
max_depth = par.getMaxDepthAfter();
}
cur.setCurrentFont();
// this handles the counter labels, and also fixes up
// depth values for follow-on (child) paragraphs
cur.forceBufferUpdate();

View File

@ -94,7 +94,7 @@ public:
};
/// Increase or decrease the nesting depth of the selected paragraph(s)
/// FIXME: replace Cursor with DocIterator.
void changeDepth(Cursor const & cur, DEPTH_CHANGE type);
void changeDepth(Cursor & cur, DEPTH_CHANGE type);
/// Returns whether something would be changed by changeDepth
/// FIXME: replace Cursor with DocIterator.