summaryrefslogtreecommitdiff
path: root/sw
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-03 07:39:41 +0200
commitdc96863cc541937123058b13269ef234ee40edd2 (patch)
tree6751dc8be219b5ceebb1edeb7760b16c2490224e /sw
parent263c3b56fc36cd9435b57bfde8ff9b38a7d894b7 (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> (cherry picked from commit 54a241c41f05d882490741b49864bcdd363110d6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95314
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx16
1 files changed, 11 insertions, 5 deletions
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);
}