summaryrefslogtreecommitdiff
path: root/svx/source/dialog/dlgctrl.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-17 13:44:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-17 22:06:22 +0100
commit16bbfcd1902e63823f6f1a491442b82024def2bc (patch)
tree6b2663ee1394604b2c9f4d6b5694535e20d812b1 /svx/source/dialog/dlgctrl.cxx
parent00710aebdf339415f1fa2072ef6a76c8bb6a591a (diff)
limit table spinbuttons width for sidebar
to the same width as the paragraph sidebar spinbuttons Change-Id: I980545b4186b25cb5ada473095ece8c77f99420a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86992 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/dialog/dlgctrl.cxx')
-rw-r--r--svx/source/dialog/dlgctrl.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index d69a3cceb2f4..b23970a82b61 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -22,6 +22,7 @@
#include <vcl/virdev.hxx>
#include <vcl/event.hxx>
#include <sfx2/dialoghelper.hxx>
+#include <svx/relfld.hxx>
#include <svx/xlineit0.hxx>
#include <svx/xtable.hxx>
#include <svx/strings.hrc>
@@ -1451,4 +1452,17 @@ void SvxXRectPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
rRenderContext.Pop();
}
+void limitWidthForSidebar(weld::SpinButton& rSpinButton)
+{
+ // space is limited in the sidebar, so limit MetricSpinButtons to a width of 4 digits
+ const int nMaxDigits = 4;
+ rSpinButton.set_width_chars(std::min(rSpinButton.get_width_chars(), nMaxDigits));
+}
+
+void limitWidthForSidebar(RelativeField& rMetricSpinButton)
+{
+ weld::SpinButton& rSpinButton = rMetricSpinButton.get_widget();
+ limitWidthForSidebar(rSpinButton);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */