sw/source/ui/index/cnttab.cxx       |    8 ++++++--
 sw/source/uibase/inc/swuicnttab.hxx |    1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit d9f852786aa3d54eb201fae674990bec8a10ed5e
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Mar 7 11:30:40 2022 +0000
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Mon Mar 7 15:00:28 2022 +0100

    tdf#146562 let toc default size and pos on first launch
    
    so only use resize_to_request when the user toggles the checkbutton
    
    Change-Id: Ib5fdac56da0441fae482bc9f2120d1d3ce173fe8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131023
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 80d3bb3d27ca..c57f47278f2f 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -276,7 +276,7 @@ SwMultiTOXTabDialog::SwMultiTOXTabDialog(weld::Widget* 
pParent, const SfxItemSet
     m_xShowExampleCB->connect_toggled(LINK(this, SwMultiTOXTabDialog, 
ShowPreviewHdl));
     
m_xShowExampleCB->set_active(SW_MOD()->GetModuleConfig()->IsShowIndexPreview());
 
-    ShowPreviewHdl(*m_xShowExampleCB);
+    ShowPreview();
 }
 
 SwMultiTOXTabDialog::~SwMultiTOXTabDialog()
@@ -408,7 +408,7 @@ std::unique_ptr<SwTOXDescription> 
SwMultiTOXTabDialog::CreateTOXDescFromTOXBase(
     return pDesc;
 }
 
-IMPL_LINK_NOARG(SwMultiTOXTabDialog, ShowPreviewHdl, weld::Toggleable&, void)
+void SwMultiTOXTabDialog::ShowPreview()
 {
     if (m_xShowExampleCB->get_active())
     {
@@ -448,7 +448,11 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, ShowPreviewHdl, 
weld::Toggleable&, void)
         else
             m_xExampleFrame->Hide();
     }
+}
 
+IMPL_LINK_NOARG(SwMultiTOXTabDialog, ShowPreviewHdl, weld::Toggleable&, void)
+{
+    ShowPreview();
     m_xDialog->resize_to_request();
 }
 
diff --git a/sw/source/uibase/inc/swuicnttab.hxx 
b/sw/source/uibase/inc/swuicnttab.hxx
index 8d3fc168da2f..11a34b91ff5e 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -82,6 +82,7 @@ class SwMultiTOXTabDialog final : public 
SfxTabDialogController
 
     virtual short       Ok() override;
     std::unique_ptr<SwTOXDescription> CreateTOXDescFromTOXBase(const 
SwTOXBase*pCurTOX);
+    void ShowPreview();
 
     DECL_LINK(CreateExample_Hdl, SwOneExampleFrame&, void);
     DECL_LINK(ShowPreviewHdl, weld::Toggleable&, void);

Reply via email to