summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2022-12-16 07:30:13 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2022-12-29 13:46:04 +0000
commitaef2ee893c7b76794bc9db869f08bbbea60606a8 (patch)
tree4c9a5c198699bfbf847500950ae86fa04853ad94 /svtools/source
parent3998ccfe14dab2e0a9b31cebe08534aa41177ce5 (diff)
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>
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/uno/wizard/wizardpagecontroller.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 333d7ce27351..850d9b102c7a 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -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 );