[Libreoffice-commits] core.git: vcl/source
Caolán McNamara
caolanm at redhat.com
Sat Mar 10 21:30:44 UTC 2018
vcl/source/window/window2.cxx | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
New commits:
commit 5b4952ca85ffec852b2361e45f987c3c5be19dc9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Mar 9 16:04:38 2018 +0000
margin change should trigger relayout
Change-Id: Idfcca3c6c37244ff073b9fc2fdc40955c39d01d1
Reviewed-on: https://gerrit.libreoffice.org/51012
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
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
More information about the Libreoffice-commits
mailing list