include/vcl/weld/AssistantController.hxx |   32 +++++++++++++++++++++++++++++++
 include/vcl/weld/DialogController.hxx    |   14 -------------
 include/vcl/wizardmachine.hxx            |    1 
 vcl/Library_vcl.mk                       |    1 
 vcl/source/weld/AssistantController.cxx  |   27 ++++++++++++++++++++++++++
 vcl/source/weld/DialogController.cxx     |   11 ----------
 6 files changed, 61 insertions(+), 25 deletions(-)

New commits:
commit 70244231365ca057e03e2271795f89f175726760
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Jan 2 22:56:46 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Jan 3 08:12:27 2026 +0100

    weld: Return weld::Assistant from AssistantController::getDialog
    
    Return the more specific subclass instead of just weld::Dialog.
    
    Change-Id: Ib1a949a87e7d314cd020a9bc3072c6b7dbe94a03
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196437
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/weld/AssistantController.hxx 
b/include/vcl/weld/AssistantController.hxx
index c1f2862a973d..6fb2b800c84a 100644
--- a/include/vcl/weld/AssistantController.hxx
+++ b/include/vcl/weld/AssistantController.hxx
@@ -11,11 +11,10 @@
 
 #include <vcl/dllapi.h>
 #include <vcl/weld/DialogController.hxx>
+#include <vcl/weld/weld.hxx>
 
 namespace weld
 {
-class Assistant;
-
 class VCL_DLLPUBLIC AssistantController : public DialogController
 {
 protected:
@@ -25,7 +24,7 @@ protected:
 public:
     SAL_DLLPRIVATE AssistantController(weld::Widget* pParent, const OUString& 
rUIFile,
                                        const OUString& rDialogId);
-    virtual Dialog* getDialog() override;
+    virtual Assistant* getDialog() override;
     SAL_DLLPRIVATE virtual ~AssistantController() override;
 };
 }
diff --git a/vcl/source/weld/AssistantController.cxx 
b/vcl/source/weld/AssistantController.cxx
index 3752385cb02c..3e7472c53727 100644
--- a/vcl/source/weld/AssistantController.cxx
+++ b/vcl/source/weld/AssistantController.cxx
@@ -9,7 +9,6 @@
 
 #include <vcl/svapp.hxx>
 #include <vcl/weld/AssistantController.hxx>
-#include <vcl/weld/weld.hxx>
 
 namespace weld
 {
@@ -20,7 +19,7 @@ AssistantController::AssistantController(weld::Widget* 
pParent, const OUString&
 {
 }
 
-Dialog* AssistantController::getDialog() { return m_xAssistant.get(); }
+Assistant* AssistantController::getDialog() { return m_xAssistant.get(); }
 
 AssistantController::~AssistantController() {}
 }
commit 9362510a2b187a188da62500338a108d46300a29
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Jan 2 22:52:16 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Jan 3 08:12:19 2026 +0100

    weld: Move weld::AssistantController to own header/source
    
    Move the class to its own header and source file.
    
    This prepares for an upcoming commit to return a weld::Assistant*
    from weld::AssistantController::getDialog without having to
    include weld.hxx (or an upcoming Assistant.hxx) in DialogController.hxx.
    
    Change-Id: I4f9467cdf8d4e136fca7628cfd5e0975b4855d66
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196436
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/include/vcl/weld/AssistantController.hxx 
b/include/vcl/weld/AssistantController.hxx
new file mode 100644
index 000000000000..c1f2862a973d
--- /dev/null
+++ b/include/vcl/weld/AssistantController.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include <vcl/dllapi.h>
+#include <vcl/weld/DialogController.hxx>
+
+namespace weld
+{
+class Assistant;
+
+class VCL_DLLPUBLIC AssistantController : public DialogController
+{
+protected:
+    std::unique_ptr<weld::Builder> m_xBuilder;
+    std::unique_ptr<weld::Assistant> m_xAssistant;
+
+public:
+    SAL_DLLPRIVATE AssistantController(weld::Widget* pParent, const OUString& 
rUIFile,
+                                       const OUString& rDialogId);
+    virtual Dialog* getDialog() override;
+    SAL_DLLPRIVATE virtual ~AssistantController() override;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/vcl/weld/DialogController.hxx 
b/include/vcl/weld/DialogController.hxx
index f6e97a009ff7..5d16a3c30bd6 100644
--- a/include/vcl/weld/DialogController.hxx
+++ b/include/vcl/weld/DialogController.hxx
@@ -17,7 +17,6 @@
 
 namespace weld
 {
-class Assistant;
 class Container;
 class Dialog;
 class MessageDialog;
@@ -85,19 +84,6 @@ public:
     OUString get_secondary_text() const;
     void set_default_response(int nResponse);
 };
-
-class VCL_DLLPUBLIC AssistantController : public DialogController
-{
-protected:
-    std::unique_ptr<weld::Builder> m_xBuilder;
-    std::unique_ptr<weld::Assistant> m_xAssistant;
-
-public:
-    SAL_DLLPRIVATE AssistantController(weld::Widget* pParent, const OUString& 
rUIFile,
-                                       const OUString& rDialogId);
-    virtual Dialog* getDialog() override;
-    SAL_DLLPRIVATE virtual ~AssistantController() override;
-};
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/vcl/wizardmachine.hxx b/include/vcl/wizardmachine.hxx
index 9a54a4369037..064515b3b76e 100644
--- a/include/vcl/wizardmachine.hxx
+++ b/include/vcl/wizardmachine.hxx
@@ -21,6 +21,7 @@
 #include <memory>
 #include <vcl/dllapi.h>
 #include <vcl/builderpage.hxx>
+#include <vcl/weld/AssistantController.hxx>
 #include <vcl/weld/DialogController.hxx>
 
 struct WizPageData;
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ec8a7eddc66a..16f96ed22e22 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -582,6 +582,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/uitest/uitest \
     vcl/source/uitest/uno/uiobject_uno \
     vcl/source/uitest/uno/uitest_uno \
+    vcl/source/weld/AssistantController \
     vcl/source/weld/Builder \
     vcl/source/weld/ComboBox \
     vcl/source/weld/DialogController \
diff --git a/vcl/source/weld/AssistantController.cxx 
b/vcl/source/weld/AssistantController.cxx
new file mode 100644
index 000000000000..3752385cb02c
--- /dev/null
+++ b/vcl/source/weld/AssistantController.cxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <vcl/svapp.hxx>
+#include <vcl/weld/AssistantController.hxx>
+#include <vcl/weld/weld.hxx>
+
+namespace weld
+{
+AssistantController::AssistantController(weld::Widget* pParent, const 
OUString& rUIFile,
+                                         const OUString& rDialogId)
+    : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
+    , m_xAssistant(m_xBuilder->weld_assistant(rDialogId))
+{
+}
+
+Dialog* AssistantController::getDialog() { return m_xAssistant.get(); }
+
+AssistantController::~AssistantController() {}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/source/weld/DialogController.cxx 
b/vcl/source/weld/DialogController.cxx
index 08192d10cc09..ab0e27120fb1 100644
--- a/vcl/source/weld/DialogController.cxx
+++ b/vcl/source/weld/DialogController.cxx
@@ -92,17 +92,6 @@ MessageDialogController::~MessageDialogController()
         m_xContentArea->move(m_xRelocate.get(), m_xOrigParent.get());
     }
 }
-
-AssistantController::AssistantController(weld::Widget* pParent, const 
OUString& rUIFile,
-                                         const OUString& rDialogId)
-    : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
-    , m_xAssistant(m_xBuilder->weld_assistant(rDialogId))
-{
-}
-
-Dialog* AssistantController::getDialog() { return m_xAssistant.get(); }
-
-AssistantController::~AssistantController() {}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */

Reply via email to