summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-01-04 22:13:17 -0500
committerJustin Luth <jluth@mail.com>2023-01-06 00:34:31 +0000
commita9b666b6b839735919923d8911f7e1efe0eb87b0 (patch)
tree7b80a5b8048497809dde28b951a7545eadaf039b /svx/source/tbxctrls
parentc0eb37dfd00311518926bd602ccc8776f89b397c (diff)
tdf#56258 svx SetOutline: convert to toggle
The "Outline Format" toolbar button is normally hidden. It didn't check state like the bullet and toggle numbering do. This patch adds that - so it lights up when the text contains a numbering list that matches a valid outline choice. I also added a toggle aspect to the button. Toggling ON is not great. It works fine if there is no numbering yet, but if you are in an outline and toggle off, it won't toggle back on to the same list - it starts a new one. I don't think there is much that can be done about that, since the removal delete the level information too, and outlines are all about multiple levels of numbering. The proper response to an errant toggle off is (multiple) undo(s), not toggle back on. (In the ideal world, it would popup the dropdown choices). Toggling ON does nothing when there are already bullets or numbering. The proper response is to use the dropdown if the desire is to change to an outline format. Toggling OFF is only possible when we are on a valid outline. This is extremely important because otherwise it isn't clear how to remove Outline Numbering's mix of bullets and numbers. (When the selection contains one list with both bullet and number levels, the number and bullet buttons do nothing.) Although not perfect, this is not a bad user experience, so I'm going to push the full patch to gerrit. There is one known obscure case that troubles all methods. If the selection spans multiple list definitions and ends on an un-numbered paragraph, then the toggle-on will happen. It is possible to just not do any toggling and ALWAYS show the dropdown action, but that isn't very consistent with the other related buttons. Change-Id: I6d927604e49711f1da8549be9f3dbf8b8133a06b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145061 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx5
1 files changed, 1 insertions, 4 deletions
diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx
index 8bf8327612ba..413cbc183025 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -215,10 +215,7 @@ void SAL_CALL NumberingToolBoxControl::initialize( const css::uno::Sequence< css
ToolBox* pToolBox = nullptr;
ToolBoxItemId nId;
if (getToolboxId(nId, &pToolBox))
- {
- ToolBoxItemBits nBits = ( mePageType == NumberingPageType::OUTLINE ) ? ToolBoxItemBits::DROPDOWNONLY : ToolBoxItemBits::DROPDOWN;
- pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | nBits );
- }
+ pToolBox->SetItemBits(nId, pToolBox->GetItemBits(nId) | ToolBoxItemBits::DROPDOWN);
}
OUString SAL_CALL NumberingToolBoxControl::getImplementationName()