Resolves tdf#146762 - Consistency for list indent and level shortcuts
Previously:
* Shift + Tab on the first item decreases the indention
* Tab on first item increases the indention
* Shift + Tab on any item but the first does nothing
* Tab on any item but the first demotes the list level
* Ctrl + Tab on any item including the first inserts a literal tab
New:
* Tab on any item demotes the list item (move right)
* Shift + Tab on any item demotes the list item (move left)
* Ctrl + Tab on any item indents the whole list
* Ctrl + Shift + Tab on any item outdents the whole list
Change-Id: If64a5103a271d30c10fc903a306c9271e61cae49
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134856
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 69dc6f7..1c29953 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2051,20 +2051,13 @@ KEYINPUT_CHECKTABLE_INSDEL:
&& rSh.IsSttOfPara()
&& !rSh.HasReadonlySel() )
{
if ( !rSh.IsMultiSelection()
&& rSh.IsFirstOfNumRuleAtCursorPos()
&& numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
eKeyState = SwKeyState::NumIndentInc;
if (numfunc::NumDownChangesIndent(rSh))
{
eKeyState = SwKeyState::NumDown;
}
else
{
if (numfunc::NumDownChangesIndent(rSh))
{
eKeyState = SwKeyState::NumDown;
}
else
{
eKeyState = SwKeyState::InsTab;
}
eKeyState = SwKeyState::InsTab;
}
}
else if (rSh.GetSelectionType() &
@@ -2116,12 +2109,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
&& rSh.IsSttOfPara()
&& !rSh.HasReadonlySel() )
{
if ( !rSh.IsMultiSelection()
&& rSh.IsFirstOfNumRuleAtCursorPos()
&& numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
eKeyState = SwKeyState::NumIndentDec;
else
eKeyState = SwKeyState::NumUp;
eKeyState = SwKeyState::NumUp;
}
else if (rSh.GetSelectionType() &
(SelectionType::Graphic |
@@ -2176,7 +2164,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
eKeyState = SwKeyState::EnterDrawHandleMode;
else
{
eKeyState = SwKeyState::InsTab;
if ( !rSh.IsMultiSelection()
&& numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
eKeyState = SwKeyState::NumIndentInc;
}
}
break;
@@ -2197,6 +2187,12 @@ KEYINPUT_CHECKTABLE_INSDEL:
{
eKeyState = SwKeyState::EnterDrawHandleMode;
}
else
{
if ( !rSh.IsMultiSelection()
&& numfunc::ChangeIndentOnTabAtFirstPosOfFirstListItem() )
eKeyState = SwKeyState::NumIndentDec;
}
}
break;
case KEY_F2 :