summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw/edtwin.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-09-03 14:55:38 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-09-03 16:14:43 +0200
commitbf72417c53cbb564d7f28718b244ce94541f740c (patch)
tree398d09cad54964c49242ebe2c73956e62bbbcda2 /sw/source/uibase/docvw/edtwin.cxx
parent18e4367c33f327cf09985105bde583cdcc7b2a46 (diff)
sw: insert plain tab char at a numbered para start if indent wouldn't change
Pressing the <tab> key at the start of a numbered paragraph typically is not interpreted literally, rather we increase the numbering level by one. This results in a similar increase of indentation, and results in a semantically better document. However, this automagic is annoying in case the numbering is a leftover, which is not even visible, so the user only sees that pressing tab is "ignored" (if they don't pay attention to the status bar). Fix the problem by guessing if "downing" the numbering will change the indent, and if not, fall back to inserting a plain tab character instead, which will increase the indentation. Change-Id: I260d3caab447c03a98655d8f5da310082ba0b46e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102003 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase/docvw/edtwin.cxx')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index b03419d744ba..279bf08127a6 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2060,7 +2060,16 @@ KEYINPUT_CHECKTABLE_INSDEL:
&& numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
eKeyState = SwKeyState::NumIndentInc;
else
- eKeyState = SwKeyState::NumDown;
+ {
+ if (numfunc::NumDownChangesIndent(rSh))
+ {
+ eKeyState = SwKeyState::NumDown;
+ }
+ else
+ {
+ eKeyState = SwKeyState::InsTab;
+ }
+ }
}
else if ( rSh.GetTableFormat() )
{