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>
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 850d9b1..57ed08c 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& )
{