summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlhan Yesil <ilhanyesil@gmx.de>2022-12-16 07:30:13 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2023-03-09 12:41:57 +0000
commitf933248c042e6fa8ed29daf19fd8bba47a5cc3d6 (patch)
tree0c54286a0b434c62b3ed94248bb3aa6489ed0e79
parent76d95da3d253dca847f78037275c1a29b5516885 (diff)
Related: tdf#132110 use the container child size as default size
if the container size wasn't changed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147382 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 9c978e4c75e342b2345ff4fcbd1b5751627d8baf) also includes: 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. 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> (cherry picked from commit aef2ee893c7b76794bc9db869f08bbbea60606a8) Change-Id: I0bd4843768b727b8b75cbcb7ec92bd2b501b550d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147412 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--svtools/source/uno/wizard/wizardpagecontroller.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 333d7ce27351..57ed08c6f164 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -50,10 +50,28 @@ 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);
-
- Reference< XWindow > xPageWindow(m_xWizardPage->getWindow(), UNO_SET_THROW);
- xPageWindow->setVisible( true );
+ css::uno::Reference<css::awt::XWindow> xChildFrame = pParent->CreateChildFrame();
+ 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);
+ }
+
+ xPageWindow->setVisible(true);
}
catch( const Exception& )
{