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

New commits:
commit e0b373227e135230bd9e678cbf9a6a56d4f3248a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Mar 7 11:30:40 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Mar 7 13:53:16 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/+/131104
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 44b13a9c8db4..6c2d324b63d8 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -277,7 +277,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()
@@ -409,7 +409,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())
     {
@@ -449,7 +449,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 ddf6769fe353..2433c0faa307 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