summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/ruler.hxx2
-rw-r--r--svx/source/dialog/svxruler.cxx14
-rw-r--r--sw/source/uibase/shells/textsh1.cxx5
3 files changed, 19 insertions, 2 deletions
diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index f456d6a7ec2f..11909eb6e602 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -279,6 +279,8 @@ public:
void SetTabsRelativeToIndent( bool bRel );
void SetValues(RulerChangeType type, long value);
long GetPageWidth() const;
+
+ void MoveTabstop(int nTabstop, int nAmount);
};
#endif
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) */
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 2ce3d6c7bbb8..b3fc13963a99 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1571,8 +1571,9 @@ void SwTextShell::Execute(SfxRequest &rReq)
const SfxInt32Item* pAmount = rReq.GetArg<SfxInt32Item>(FN_PARAM_2);
if (!pIndex || !pAmount)
break;
- SAL_INFO("sw.ui", "MoveTabstop(" << pIndex->GetValue() << "," << pAmount->GetValue() << ")");
- // To be implemented
+ auto &rRuler = GetView().GetHRuler();
+ rRuler.MoveTabstop(pIndex->GetValue(), pAmount->GetValue());
+ rRuler.ForceUpdate();
}
break;
default: