svtools/source/uno/wizard/wizardpagecontroller.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit aef2ee893c7b76794bc9db869f08bbbea60606a8
Author:     Ilhan Yesil <ilhanye...@gmx.de>
AuthorDate: Fri Dec 16 07:30:13 2022 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Thu Dec 29 13:46:04 2022 +0000

    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 <caol...@redhat.com>
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

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 );

Reply via email to