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

New commits:
commit 16be7b74fe3187333a6ff544ee90d3c1093b9177
Author:     Ilhan Yesil <ilhanye...@gmx.de>
AuthorDate: Fri Dec 16 07:30:13 2022 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Jan 2 09:01:15 2023 +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>
    (cherry picked from commit aef2ee893c7b76794bc9db869f08bbbea60606a8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144809
    Tested-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/svtools/source/uno/wizard/wizardpagecontroller.cxx 
b/svtools/source/uno/wizard/wizardpagecontroller.cxx
index 3faf68258b10..bbb081a01313 100644
--- a/svtools/source/uno/wizard/wizardpagecontroller.cxx
+++ b/svtools/source/uno/wizard/wizardpagecontroller.cxx
@@ -54,7 +54,16 @@ namespace svt { namespace 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