summaryrefslogtreecommitdiff
path: root/svx/source/dialog/svxruler.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-02-04 15:38:46 +0200
committerTor Lillqvist <tml@collabora.com>2020-02-05 14:03:34 +0100
commitea63519d88fa111001fd2043e786b54d2f285de1 (patch)
tree0de107d523b6837dee729f46e44f2e0d75ee827e /svx/source/dialog/svxruler.cxx
parent80a85b950aa044ac77cdf6d0b9379c56ffb0b915 (diff)
tdf#128468: Add SvxRuler::MoveTabstop() and use it
Change-Id: If223bde1ae5161da821530d36e50a971c62f6944 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87977 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'svx/source/dialog/svxruler.cxx')
-rw-r--r--svx/source/dialog/svxruler.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 8fa6a67df992..ff3b7b6bbca7 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -1732,6 +1732,20 @@ void SvxRuler::UpdateParaContents_Impl(
SetIndents(INDENT_COUNT, &mpIndents[0] + INDENT_GAP);
}
+void SvxRuler::MoveTabstop(int nTabstop, int nAmount)
+{
+ SAL_INFO("svx", "MoveTabstop(" << nTabstop << "," << nAmount << ")");
+
+ if (nTabstop < 0 || nTabstop >= mxTabStopItem->Count())
+ return;
+
+ SvxTabStop aTabstop = mxTabStopItem->At(nTabstop);
+ mxTabStopItem->Remove(nTabstop);
+ aTabstop.GetTabPos() += nAmount;
+ mxTabStopItem->Insert(aTabstop);
+ pBindings->GetDispatcher()->ExecuteList(SID_ATTR_TABSTOP, SfxCallMode::RECORD, { mxTabStopItem.get() });
+}
+
void SvxRuler::DragBorders()
{
/* Dragging of Borders (Tables and other columns) */