tdf#152508 Initiate container request size after call of createPage

As the container's request size of wizard pages can't be changed
directly by the UNO call setPosSize, the UNO caller can set the size
in the callback function createPage, this size will then taken as
request size. This doesn't solve the problem entirely as descriped
in tdf#152508, but the most important is, that the wizard page can
be initialized with an appropriate size at startup.

Change-Id: I1899da9c018681291559eb7c0de25a3e2e8af14e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144287
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Ilhan Yesil 2022-12-16 07:30:13 +01:00 committed by Michael Weghorn
parent 3998ccfe14
commit aef2ee893c

View File

@ -50,7 +50,16 @@ namespace svt::uno
try
{
// Plug a toplevel SalFrame into the native page which can host our awt widgetry
m_xWizardPage.set(m_xController->createPage(pParent->CreateChildFrame(), i_nPageId), UNO_SET_THROW);
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);
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);
}
Reference< XWindow > xPageWindow(m_xWizardPage->getWindow(), UNO_SET_THROW);
xPageWindow->setVisible( true );