summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-01-09 14:18:15 -0500
committerJustin Luth <jluth@mail.com>2023-01-12 00:04:06 +0000
commitd07b1cc8148140bd3a78103da668d002b9d266ab (patch)
tree20ffd20651c7d6b0639603053052cae546ff8a25 /sw
parent613baf1573757f8af594eda2460076b4eaad7c64 (diff)
Revert "tdf#56258 svx SetOutline: convert to toggle"
This reverts 7.6 commit a9b666b6b839735919923d8911f7e1efe0eb87b0. This causes too many unexpected things for the user. The biggest problem is that it does not join the previous list like the other numbering does. I suppose I could fix that by first calling a UNO command that joins/turns on numbering. However, that is a bit more dangerous with outline, since it modifies spacing / numbering on all levels, and joining can unexpected skip empty paragraphs etc. So best to just always treat the button as a dropdown to indicate to the user that they are applying an outline change. For the present I decided to leave the lighted-up aspect in place, so show that the outline is in effect. In terms of removing the list, which was the main reason for the change in the first place, there are several workarounds. The user has the option to go to "more choices" and remove, or select an all-1s choice and then remove that. Using the bullets button also is an easy option since it seems less restricted than numbering. The overall risk is no different from before, except that it is easier to make those kinds of levels now that the outline button is always available on the toolbar. Change-Id: I64e13f203ae65b2d2b28560ba747ca99d1456578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145240 Tested-by: Justin Luth <jluth@mail.com> Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/txtnum.cxx33
1 files changed, 0 insertions, 33 deletions
diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx
index 3410d962ff79..34a95d13ee8e 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -17,8 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <comphelper/dispatchcommand.hxx>
-#include <comphelper/propertysequence.hxx>
#include <sfx2/request.hxx>
#include <svl/eitem.hxx>
#include <svl/stritem.hxx>
@@ -312,37 +310,6 @@ void SwTextShell::ExecSetNumber(SfxRequest const &rReq)
GetShell().SetCurNumRule( aNewNumRule, bCreateNewList );
}
}
- else if (nSlot == FN_SVX_SET_OUTLINE)
- {
- // FN_SVX_SET_NUMBER and FN_SVX_SET_BULLET are only dropdown actions,
- // but FN_SVX_SET_OUTLINE is different. It is also the button action,
- // which is what is being handled here..
-
- // Only toggle off if the current selection is a valid outline choice,
- // otherwise do nothing if other bullets/numbering are part of the selection.
- const SwNumRule* pNumRule = GetShell().GetNumRuleAtCurrentSelection();
- if (pNumRule)
- {
- SvxNumRule aSvxRule = pNumRule->MakeSvxNumRule();
-
- svx::sidebar::NBOTypeMgrBase* pOutline
- = svx::sidebar::NBOutlineTypeMgrFact::CreateInstance(
- svx::sidebar::NBOType::Outline);
- if (pOutline)
- {
- const sal_uInt16 nIndex = pOutline->GetNBOIndexForNumRule(aSvxRule, 0);
- if (nIndex < USHRT_MAX)
- comphelper::dispatchCommand(".uno:RemoveBullets", {});
- }
- }
- else if (!GetShell().GetNumRuleAtCurrCursorPos())
- {
- // No numbering yet. Just use the first locale-defined choice.
- auto aArgs(comphelper::InitPropertySequence(
- { { "SetOutline", uno::Any(sal_uInt16(1)) } }));
- comphelper::dispatchCommand(".uno:SetOutline", aArgs);
- }
- }
}
break;