vcl/source/components/ColorPicker.cxx |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 86a04e193376b732bd8827103e1507046efff07b
Author:     Michael Weghorn <[email protected]>
AuthorDate: Fri Dec 5 15:46:56 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Sat Dec 6 08:41:27 2025 +0100

    tdf#169505 Use ColorDialog in ColorPicker
    
    Use the ColorDialog wrapper/abstraction instead
    of using weld::ColorChooserDialog directly.
    
    No change in behavior intended yet or seen for the
    sample macro mentioned in
    
        commit 9d6ade1f3b8e4ee59ae7bbe7fda440152af60221
        Author: Michael Weghorn <[email protected]>
        Date:   Tue Nov 18 17:06:04 2025 +0100
    
            [API CHANGE] Reintroduce com.sun.star.ui.dialogs.ColorPicker
    
    , but this way, a non-native dialog will be used here as well
    if use of native dialogs gets disabled, once an upcoming
    commit introduces that possibility for tdf#169505.
    
    Change-Id: I5ec37966fb2e68f39d5ae78cc829d47d897523a3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195101
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/source/components/ColorPicker.cxx 
b/vcl/source/components/ColorPicker.cxx
index 3308001d1776..4ddba4fed433 100644
--- a/vcl/source/components/ColorPicker.cxx
+++ b/vcl/source/components/ColorPicker.cxx
@@ -7,9 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <salinst.hxx>
-#include <svdata.hxx>
-
 #include <com/sun/star/awt/XWindow.hpp>
 #include <com/sun/star/beans/XPropertyAccess.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
@@ -20,6 +17,7 @@
 #include <comphelper/propertyvalue.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <tools/color.hxx>
+#include <vcl/ColorDialog.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/weld.hxx>
 
@@ -105,12 +103,10 @@ void SAL_CALL ColorPicker::setTitle(const OUString&) {}
 
 sal_Int16 SAL_CALL ColorPicker::execute()
 {
-    std::unique_ptr<weld::ColorChooserDialog> pColorChooserDialog
-        = 
ImplGetSVData()->mpDefInst->CreateColorChooserDialog(Application::GetFrameWeld(m_xParent),
-                                                               
vcl::ColorPickerMode::Select);
-    const int nRet = pColorChooserDialog->run();
+    ColorDialog aColorDialog(Application::GetFrameWeld(m_xParent));
+    const int nRet = aColorDialog.Execute();
     if (nRet == RET_OK)
-        m_aColor = pColorChooserDialog->get_color();
+        m_aColor = aColorDialog.GetColor();
     return nRet;
 }
 

Reply via email to