From 5b4952ca85ffec852b2361e45f987c3c5be19dc9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 9 Mar 2018 16:04:38 +0000 Subject: margin change should trigger relayout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idfcca3c6c37244ff073b9fc2fdc40955c39d01d1 Reviewed-on: https://gerrit.libreoffice.org/51012 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/source/window/window2.cxx | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index b46fae5c3f09..af41df0d4a15 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1853,7 +1853,11 @@ sal_Int32 Window::get_border_width() const void Window::set_margin_left(sal_Int32 nWidth) { WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get(); - pWindowImpl->mnMarginLeft = nWidth; + if (pWindowImpl->mnMarginLeft != nWidth) + { + pWindowImpl->mnMarginLeft = nWidth; + queue_resize(); + } } sal_Int32 Window::get_margin_left() const @@ -1865,7 +1869,11 @@ sal_Int32 Window::get_margin_left() const void Window::set_margin_right(sal_Int32 nWidth) { WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get(); - pWindowImpl->mnMarginRight = nWidth; + if (pWindowImpl->mnMarginRight != nWidth) + { + pWindowImpl->mnMarginRight = nWidth; + queue_resize(); + } } sal_Int32 Window::get_margin_right() const @@ -1877,7 +1885,11 @@ sal_Int32 Window::get_margin_right() const void Window::set_margin_top(sal_Int32 nWidth) { WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get(); - pWindowImpl->mnMarginTop = nWidth; + if (pWindowImpl->mnMarginTop != nWidth) + { + pWindowImpl->mnMarginTop = nWidth; + queue_resize(); + } } sal_Int32 Window::get_margin_top() const @@ -1889,7 +1901,11 @@ sal_Int32 Window::get_margin_top() const void Window::set_margin_bottom(sal_Int32 nWidth) { WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get(); - pWindowImpl->mnMarginBottom = nWidth; + if (pWindowImpl->mnMarginBottom != nWidth) + { + pWindowImpl->mnMarginBottom = nWidth; + queue_resize(); + } } sal_Int32 Window::get_margin_bottom() const -- cgit