[Libreoffice-commits] core.git: vcl/source
Pierre-Eric Pelloux-Prayer
pelloux at gmail.com
Thu Mar 3 07:37:33 UTC 2016
vcl/source/window/syswin.cxx | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
New commits:
commit 9fdd671fb276a419089f26e47739c4a783d15e93
Author: Pierre-Eric Pelloux-Prayer <pelloux at gmail.com>
Date: Wed Jan 27 19:51:30 2016 +0100
tdf#96393: reuse layout if available
If position and size were loaded from the WindowStateData
structure there's no need to recompute the layout.
As an added benefit if the user previously resized/move the
dialog, the new one will open using the same geometry.
Change-Id: I306504080357f9be8f3e628ba13ca5dc2957dd52
Reviewed-on: https://gerrit.libreoffice.org/21850
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
Tested-by: jan iversen <jani at documentfoundation.org>
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 19ec2f9..080d72a 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -641,6 +641,13 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
aState.mnWidth = rData.GetWidth();
aState.mnHeight = rData.GetHeight();
+ if ( (aState.mnMask & SAL_FRAME_POSSIZE_X) &&
+ (aState.mnMask & SAL_FRAME_POSSIZE_Y) &&
+ (aState.mnMask & SAL_FRAME_POSSIZE_WIDTH) &&
+ (aState.mnMask & SAL_FRAME_POSSIZE_HEIGHT) ) {
+ mbInitialLayoutDone = true;
+ }
+
if( rData.GetMask() & (WINDOWSTATE_MASK_WIDTH|WINDOWSTATE_MASK_HEIGHT) )
{
// #i43799# adjust window state sizes if a minimal output size was set
@@ -1100,11 +1107,13 @@ void SystemWindow::DoInitialLayout()
if (isLayoutEnabled())
{
- mbIsCalculatingInitialLayoutSize = true;
- setDeferredProperties();
- setOptimalLayoutSize();
- mbIsCalculatingInitialLayoutSize = false;
- mbInitialLayoutDone = true;
+ if (!mbInitialLayoutDone) {
+ mbIsCalculatingInitialLayoutSize = true;
+ setDeferredProperties();
+ setOptimalLayoutSize();
+ mbIsCalculatingInitialLayoutSize = false;
+ mbInitialLayoutDone = true;
+ }
}
else if (IsDialog() && !(GetStyle() & WB_SIZEABLE))
{
More information about the Libreoffice-commits
mailing list