[API CHANGE] Drop ColorPicker, AsynchronousColorPicker

The unpublished com::sun::star::cui::ColorPicker and
com::sun::star::cui::AsynchronousColorPicker UNO services
were previously used to be able to use ColorPickerDialog
(implemented in cui) from svtools.

That's no longer the case since

    commit 0905c23676
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Fri Jun 13 18:27:09 2025 +0200

        Stop using UNO abstraction for color picker

, so drop the now unused services and the ColorPicker
class that implemented them.

Change-Id: I9264707df57e46192a393f6736257c413e5d9831
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186538
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
Michael Weghorn
2025-06-16 15:37:30 +02:00
parent a6c5e17177
commit 5ba0ccb296
6 changed files with 0 additions and 213 deletions
-135
View File
@@ -1009,139 +1009,4 @@ void ColorPickerDialog::setColorComponent( ColorComponent nComp, double dValue )
}
}
typedef ::comphelper::WeakComponentImplHelper< XServiceInfo, XExecutableDialog, XAsynchronousExecutableDialog, XInitialization, XPropertyAccess > ColorPickerBase;
namespace {
class ColorPicker : public ColorPickerBase
{
public:
explicit ColorPicker();
// XInitialization
virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) override;
// XInitialization
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
// XPropertyAccess
virtual Sequence< PropertyValue > SAL_CALL getPropertyValues( ) override;
virtual void SAL_CALL setPropertyValues( const Sequence< PropertyValue >& aProps ) override;
// XExecutableDialog
virtual void SAL_CALL setTitle( const OUString& aTitle ) override;
virtual sal_Int16 SAL_CALL execute( ) override;
// XAsynchronousExecutableDialog
virtual void SAL_CALL setDialogTitle( const OUString& aTitle ) override;
virtual void SAL_CALL startExecuteModal( const css::uno::Reference< css::ui::dialogs::XDialogClosedListener >& xListener ) override;
private:
Color mnColor;
sal_Int16 mnMode;
Reference<css::awt::XWindow> mxParent;
};
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_cui_ColorPicker_get_implementation(
css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const&)
{
return cppu::acquire( new ColorPicker );
}
constexpr OUString gsColorKey( u"Color"_ustr );
constexpr OUStringLiteral gsModeKey( u"Mode" );
ColorPicker::ColorPicker()
: mnColor( 0 )
, mnMode( 0 )
{
}
// XInitialization
void SAL_CALL ColorPicker::initialize( const Sequence< Any >& aArguments )
{
if( aArguments.getLength() == 1 )
{
aArguments[0] >>= mxParent;
}
}
// XInitialization
OUString SAL_CALL ColorPicker::getImplementationName( )
{
return u"com.sun.star.cui.ColorPicker"_ustr;
}
sal_Bool SAL_CALL ColorPicker::supportsService( const OUString& sServiceName )
{
return cppu::supportsService(this, sServiceName);
}
Sequence< OUString > SAL_CALL ColorPicker::getSupportedServiceNames( )
{
return { u"com.sun.star.ui.dialogs.ColorPicker"_ustr,
u"com.sun.star.ui.dialogs.AsynchronousColorPicker"_ustr };
}
// XPropertyAccess
Sequence< PropertyValue > SAL_CALL ColorPicker::getPropertyValues( )
{
Sequence< PropertyValue > props{ comphelper::makePropertyValue(gsColorKey, mnColor) };
return props;
}
void SAL_CALL ColorPicker::setPropertyValues( const Sequence< PropertyValue >& aProps )
{
for ( const PropertyValue& rProp : aProps )
{
if( rProp.Name == gsColorKey )
{
rProp.Value >>= mnColor;
}
else if( rProp.Name == gsModeKey )
{
rProp.Value >>= mnMode;
}
}
}
// XExecutableDialog
void SAL_CALL ColorPicker::setTitle( const OUString& )
{
}
sal_Int16 SAL_CALL ColorPicker::execute()
{
std::unique_ptr<ColorPickerDialog> xDlg(new ColorPickerDialog(Application::GetFrameWeld(mxParent), mnColor, mnMode));
sal_Int16 ret = xDlg->run();
if (ret)
mnColor = xDlg->GetColor();
return ret;
}
// XAsynchronousExecutableDialog
void SAL_CALL ColorPicker::setDialogTitle( const OUString& )
{
}
void SAL_CALL ColorPicker::startExecuteModal( const css::uno::Reference< css::ui::dialogs::XDialogClosedListener >& xListener )
{
std::shared_ptr<ColorPickerDialog> xDlg = std::make_shared<ColorPickerDialog>(Application::GetFrameWeld(mxParent), mnColor, mnMode);
rtl::Reference<ColorPicker> xThis(this);
weld::DialogController::runAsync(xDlg, [xThis=std::move(xThis), xDlg, xListener] (sal_Int32 nResult) {
if (nResult)
xThis->mnColor = xDlg->GetColor();
sal_Int16 nRet = static_cast<sal_Int16>(nResult);
css::ui::dialogs::DialogClosedEvent aEvent( *xThis, nRet );
xListener->dialogClosed( aEvent );
});
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-6
View File
@@ -19,12 +19,6 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.cui.ColorPicker"
constructor="com_sun_star_cui_ColorPicker_get_implementation">
<service name="com.sun.star.cui.AsynchronousColorPicker"/>
<service name="com.sun.star.ui.dialogs.ColorPicker"/>
<service name="com.sun.star.ui.dialogs.AsynchronousColorPicker"/>
</implementation>
<implementation name="com.sun.star.cui.GetCreateDialogFactoryService"
constructor="com_sun_star_cui_GetCreateDialogFactoryService">
<service name="com.sun.star.cui.GetCreateDialogFactoryService"/>
-2
View File
@@ -99,8 +99,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/configuration,\
theDefaultProvider \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/cui,\
AsynchronousColorPicker \
ColorPicker \
GetCreateDialogFactoryService \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,com/sun/star/datatransfer,\
@@ -1,34 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
module com { module sun { module star { module cui {
/**
@since LibreOffice 7.3
*/
service AsynchronousColorPicker : com::sun::star::ui::dialogs::XAsynchronousExecutableDialog
{
createWithParent([in] com::sun::star::awt::XWindow Parent);
};
}; }; }; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-35
View File
@@ -1,35 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
module com { module sun { module star { module cui {
/**
@since LibreOffice 4.1
*/
service ColorPicker : com::sun::star::ui::dialogs::XExecutableDialog
{
createWithParent([in] com::sun::star::awt::XWindow Parent);
};
}; }; }; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
-1
View File
@@ -116,7 +116,6 @@ core_constructor_list = [
# cppcanvas/source/uno/mtfrenderer.component
"com_sun_star_comp_rendering_MtfRenderer_get_implementation",
# cui/util/cui.component
("com_sun_star_cui_ColorPicker_get_implementation", "#if !ENABLE_FUZZERS"),
("com_sun_star_cui_GetCreateDialogFactoryService", "#if !ENABLE_FUZZERS"),
# dbaccess/util/dba.component
"com_sun_star_comp_dba_DataAccessDescriptorFactory",