diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-21 09:59:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-21 11:55:29 +0000 |
commit | 9c978e4c75e342b2345ff4fcbd1b5751627d8baf (patch) | |
tree | 480bba56f1628596f6f6a1d81d02b5b3893924d3 /svtools/source/uno/wizard | |
parent | 9dd29fce292fbcfee9c5cc93d9b1de5b14aa85db (diff) |
Related: tdf#132110 use the container child size as default size
if the container size wasn't changed
Change-Id: I0bd4843768b727b8b75cbcb7ec92bd2b501b550d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147382
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/uno/wizard')
-rw-r--r-- | svtools/source/uno/wizard/wizardpagecontroller.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx index 850d9b102c7a..57ed08c6f164 100644 --- a/svtools/source/uno/wizard/wizardpagecontroller.cxx +++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx @@ -51,18 +51,27 @@ namespace svt::uno { // Plug a toplevel SalFrame into the native page which can host our awt widgetry css::uno::Reference<css::awt::XWindow> xChildFrame = pParent->CreateChildFrame(); - // If size of page is changed by createPage, then the requested size of the container - // should also be set to this size, to avoid annoying resizings. com::sun::star::awt::Rectangle r0 = xChildFrame->getPosSize(); m_xWizardPage.set(m_xController->createPage(xChildFrame, i_nPageId), UNO_SET_THROW); + + css::uno::Reference<css::awt::XWindow> xPageWindow(m_xWizardPage->getWindow(), UNO_SET_THROW); + + // If size of page is changed by createPage, then the requested size of the container + // should also be set to this size, to avoid annoying resizings. com::sun::star::awt::Rectangle r1 = xChildFrame->getPosSize(); + if (r0.Width != r1.Width || r0.Height != r1.Height) - { pParent->set_size_request(r1.Width, r1.Height); + else + { + // tdf#132110 If the parent size wasn't overridden, then use + // the size of the child if that was set + com::sun::star::awt::Rectangle aChildRect = xPageWindow->getPosSize(); + if (aChildRect.Width && aChildRect.Height) + pParent->set_size_request(aChildRect.Width, aChildRect.Height); } - Reference< XWindow > xPageWindow(m_xWizardPage->getWindow(), UNO_SET_THROW); - xPageWindow->setVisible( true ); + xPageWindow->setVisible(true); } catch( const Exception& ) { |