cui/source/inc/cuitabarea.hxx  |    1 +
 cui/source/tabpages/tparea.cxx |   20 +++++++++-----------
 2 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 6cd6bc88a59928e83483d6904961717a2fae43d9
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Aug 11 16:49:36 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Aug 12 06:37:39 2025 +0200

    cui: Make lcl_CreateFillStyleTabPage a SvxAreaTabPage method
    
    ... which drops the need to pass class members as parameters.
    
    Also move the call to SfxTabPage::SetDialogController
    to the method.
    
    Change-Id: Idf9be49921b52c1a4374e2b90d82943cb910e63a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189378
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 2cb4bc763658..a427fb6e92d7 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -270,6 +270,7 @@ private:
     template< typename TabPage >
     DeactivateRC DeactivatePage_Impl( SfxItemSet* pSet );
 
+    std::unique_ptr<SfxTabPage> CreateFillStyleTabPage(FillType eFillType);
     std::unique_ptr<SfxTabPage> CreatePage(FillType eFillType);
 
 public:
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 91208b1b12de..8723eb362d77 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -386,12 +386,9 @@ std::unique_ptr<SfxTabPage> 
SvxAreaTabPage::CreateWithSlideBackground(
     return xRet;
 }
 
-namespace {
-
-std::unique_ptr<SfxTabPage> lcl_CreateFillStyleTabPage(FillType eFillType, 
weld::Container* pPage,
-                                                       weld::DialogController* 
pController,
-                                                       const SfxItemSet& rSet)
+std::unique_ptr<SfxTabPage> SvxAreaTabPage::CreateFillStyleTabPage(FillType 
eFillType)
 {
+    SfxOkDialogController* pController = GetDialogController();
     CreateTabPage fnCreate = nullptr;
     switch (eFillType)
     {
@@ -404,9 +401,13 @@ std::unique_ptr<SfxTabPage> 
lcl_CreateFillStyleTabPage(FillType eFillType, weld:
         case FillType::USE_BACKGROUND_FILL: fnCreate = nullptr; break;
         default: break;
     }
-    return fnCreate ? (*fnCreate)( pPage, pController, &rSet ) : nullptr;
-}
 
+    if (!fnCreate)
+        return nullptr;
+
+    std::unique_ptr<SfxTabPage> pTabPage = (*fnCreate)(m_xFillTab.get(), 
pController, &m_rXFSet);
+    pTabPage->SetDialogController(pController);
+    return pTabPage;
 }
 
 IMPL_LINK(SvxAreaTabPage, SelectFillTypeHdl_Impl, weld::Toggleable&, rButton, 
void)
@@ -454,13 +455,10 @@ void SvxAreaTabPage::PageCreated(const SfxAllItemSet& 
aSet)
 
 std::unique_ptr<SfxTabPage> SvxAreaTabPage::CreatePage(FillType eFillType)
 {
-    std::unique_ptr<SfxTabPage> pTabPage
-        = lcl_CreateFillStyleTabPage(eFillType, m_xFillTab.get(), 
GetDialogController(), m_rXFSet);
+    std::unique_ptr<SfxTabPage> pTabPage = CreateFillStyleTabPage(eFillType);
     if (!pTabPage)
         return nullptr;
 
-    pTabPage->SetDialogController(GetDialogController());
-
     if (eFillType == FillType::SOLID)
     {
         auto& rColorTab = static_cast<SvxColorTabPage&>(*pTabPage);

Reply via email to