summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-06-01 16:03:34 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-06-02 09:21:59 +0200
commit8d0b7e5b2f6773f4b3feb75f1ac73ea1a26609f7 (patch)
tree93142b946f2bd391562c0e7e86b5f1eea3fc3c73
parent43a6def48f425361d79dff46dca41685d5ee03fa (diff)
lok: add "Remove" param to .uno:ChangeTabStop
Change-Id: Ic6b71c0bb6177eb10f5be4197d77c5db5f5884a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95330 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--include/svx/svxids.hrc7
-rw-r--r--svx/sdi/svx.sdi4
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx16
3 files changed, 17 insertions, 10 deletions
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 5b7c1f0a9b6b..8d0c608b6751 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -537,12 +537,13 @@ class SvxSetItem;
#define SID_TABSTOP_ADD_OR_CHANGE ( SID_SVX_START + 581 )
#define SID_TABSTOP_ATTR_INDEX ( SID_SVX_START + 582 )
#define SID_TABSTOP_ATTR_POSITION ( SID_SVX_START + 583 )
-#define SID_PARAGRAPH_FIRST_LINE_INDENT ( SID_SVX_START + 584 )
-#define SID_PARAGRAPH_LEFT_INDENT ( SID_SVX_START + 585 )
-#define SID_PARAGRAPH_RIGHT_INDENT ( SID_SVX_START + 586 )
+#define SID_TABSTOP_ATTR_REMOVE ( SID_SVX_START + 584 )
// CAUTION! Range <587 .. 587> used by EditEngine (!)
+#define SID_PARAGRAPH_FIRST_LINE_INDENT ( SID_SVX_START + 588 )
+#define SID_PARAGRAPH_LEFT_INDENT ( SID_SVX_START + 589 )
+#define SID_PARAGRAPH_RIGHT_INDENT ( SID_SVX_START + 590 )
// CAUTION! Range <591 .. 591> used by EditEngine (!)
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index c36e1771afd7..aedcfda602f4 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -7211,7 +7211,8 @@ SfxVoidItem RulerChangeState SID_RULER_CHANGE_STATE
SfxVoidItem ChangeTabStop SID_TABSTOP_ADD_OR_CHANGE
(SfxInt32Item Index SID_TABSTOP_ATTR_INDEX,
- SfxInt32Item Position SID_TABSTOP_ATTR_POSITION)
+ SfxInt32Item Position SID_TABSTOP_ATTR_POSITION,
+ SfxBoolItem Remove SID_TABSTOP_ATTR_REMOVE)
[
AutoUpdate = FALSE,
FastCall = TRUE,
@@ -7221,7 +7222,6 @@ SfxVoidItem ChangeTabStop SID_TABSTOP_ADD_OR_CHANGE
RecordAbsolute = FALSE,
RecordPerSet;
-
AccelConfig = FALSE,
MenuConfig = FALSE,
ToolBoxConfig = FALSE,
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 0c2995e0b56d..b7f6e02dcc09 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -655,8 +655,12 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
{
const auto aIndexItem = static_cast<const SfxInt32Item&>(pReqArgs->Get(SID_TABSTOP_ATTR_INDEX));
const auto aPositionItem = static_cast<const SfxInt32Item&>(pReqArgs->Get(SID_TABSTOP_ATTR_POSITION));
+ const auto aRemoveItem = static_cast<const SfxBoolItem&>(pReqArgs->Get(SID_TABSTOP_ATTR_REMOVE));
const sal_Int32 nIndex = aIndexItem.GetValue();
const sal_Int32 nPosition = aPositionItem.GetValue();
+ const bool bRemove = aRemoveItem.GetValue();
+
+
SfxItemSet aItemSet(GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>{});
rSh.GetCurAttr(aItemSet);
@@ -680,12 +684,14 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
{
SvxTabStop aTabStop = aTabStopItem.At(nIndex);
aTabStopItem.Remove(nIndex);
- aTabStop.GetTabPos() = nPosition;
- aTabStopItem.Insert(aTabStop);
-
- SvxTabStop aSwTabStop(0, SvxTabAdjust::Default);
- aTabStopItem.Insert(aSwTabStop);
+ if (!bRemove)
+ {
+ aTabStop.GetTabPos() = nPosition;
+ aTabStopItem.Insert(aTabStop);
+ SvxTabStop aSwTabStop(0, SvxTabAdjust::Default);
+ aTabStopItem.Insert(aSwTabStop);
+ }
const SvxTabStopItem& rDefaultTabs = rSh.GetDefault(RES_PARATR_TABSTOP);
MakeDefTabs(GetTabDist(rDefaultTabs), aTabStopItem);
}