diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-09-26 23:31:58 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-09-29 13:02:32 +0300 |
commit | 1450a8cb113f81a19b2b07a4ec7f2d436dabb9dc (patch) | |
tree | eb6d65e3e56ad75a4ce9ea7f98ed2a8d23c2223e /vcl | |
parent | b61e1c7351d2003fd7cf2f5aaad4b936c2a9bb6b (diff) |
Make sure GetText() is called at the right stage
And document why (similar to DockingWindow::SetFloatingMode).
Change-Id: Iefd7d756dfcdfc385344161862d7cc1e492e3711
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 67569f773ee4..ef290c642ced 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -942,8 +942,13 @@ void ImplDockingWindowWrapper::ImplPreparePopupMode( FloatWinPopupFlags nFlags ) else pWin = VclPtr<ImplPopupFloatWin>::Create( mpParent, bAllowTearOff ); pWin->SetPopupModeEndHdl( LINK( this, ImplDockingWindowWrapper, PopupModeEnd ) ); - pWin->SetText( GetWindow()->GetText() ); + // At least for DockingWindow, GetText() has a side effect of setting deferred + // properties. This must be done before setting the border window (see below), + // so that the border width will end up in mpWindowImpl->mnBorderWidth, not in + // the border window (See DockingWindow::setPosSizeOnContainee() and + // DockingWindow::GetOptimalSize()). + pWin->SetText( GetWindow()->GetText() ); pWin->SetOutputSizePixel( GetWindow()->GetSizePixel() ); GetWindow()->mpWindowImpl->mpBorderWindow = nullptr; @@ -1073,6 +1078,13 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) : mnFloatBits, this ); + // At least for DockingWindow, GetText() has a side effect of setting deferred + // properties. This must be done before setting the border window (see below), + // so that the border width will end up in mpWindowImpl->mnBorderWidth, not in + // the border window (See DockingWindow::setPosSizeOnContainee() and + // DockingWindow::GetOptimalSize()). + pWin->SetText( GetWindow()->GetText() ); + GetWindow()->mpWindowImpl->mpBorderWindow = nullptr; GetWindow()->mpWindowImpl->mnLeftBorder = 0; GetWindow()->mpWindowImpl->mnTopBorder = 0; @@ -1089,7 +1101,6 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode ) pWin->mpWindowImpl->mpClientWindow = mpDockingWindow; GetWindow()->mpWindowImpl->mpRealParent = pRealParent; - pWin->SetText( GetWindow()->GetText() ); pWin->SetOutputSizePixel( GetWindow()->GetSizePixel() ); pWin->SetPosPixel( maFloatPos ); // pass on DockingData to FloatingWindow |