diff options
author | Pierre-Eric Pelloux-Prayer <pelloux@gmail.com> | 2016-01-27 19:51:30 +0100 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-03-03 07:37:11 +0000 |
commit | 9fdd671fb276a419089f26e47739c4a783d15e93 (patch) | |
tree | 2073020c2ee2b5d0e7759673e9dedb12cc094fec /vcl | |
parent | be326abdd5371e9f8715a064289bcff64af47bdb (diff) |
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@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/syswin.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 19ec2f944357..080d72a33b99 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)) { |