Kaydet (Commit) 4d23fcf0 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Adapt cui::ColorPicker UNO service to new style

The service already existed, it just did not have an IDL file

Change-Id: I7a43b3f8c1299afde3a613dc7ec1c522c4b7a057
üst 36d0933b
...@@ -71,6 +71,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/configurat ...@@ -71,6 +71,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/configurat
Update \ Update \
theDefaultProvider \ theDefaultProvider \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/cui,\
ColorPicker \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/datatransfer,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/datatransfer,\
DataFormatTranslator \ DataFormatTranslator \
MimeContentTypeFactory \ MimeContentTypeFactory \
......
/* -*- 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 .
*/
#ifndef __com_sun_star_cui_ColorPicker_idl__
#define __com_sun_star_cui_ColorPicker_idl__
#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
#include <com/sun/star/awt/XWindow.idl>
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);
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/XPropertyAccess.hpp> #include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/cui/ColorPicker.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
...@@ -76,14 +77,11 @@ short SvColorDialog::Execute() ...@@ -76,14 +77,11 @@ short SvColorDialog::Execute()
try try
{ {
const OUString sColor( RTL_CONSTASCII_USTRINGPARAM( "Color" ) ); const OUString sColor( RTL_CONSTASCII_USTRINGPARAM( "Color" ) );
Reference< XMultiServiceFactory > xSMGR( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW ); Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< com::sun::star::awt::XWindow > xParent( VCLUnoHelper::GetInterface( mpParent ) ); Reference< com::sun::star::awt::XWindow > xParent( VCLUnoHelper::GetInterface( mpParent ) );
Sequence< Any > args(1); Reference< XExecutableDialog > xDialog = com::sun::star::cui::ColorPicker::createWithParent(xContext, xParent);
args[0] = Any( xParent );
Reference< XExecutableDialog > xDialog( xSMGR->createInstanceWithArguments(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.cui.ColorPicker")), args), UNO_QUERY_THROW );
Reference< XPropertyAccess > xPropertyAccess( xDialog, UNO_QUERY_THROW ); Reference< XPropertyAccess > xPropertyAccess( xDialog, UNO_QUERY_THROW );
Sequence< PropertyValue > props( 2 ); Sequence< PropertyValue > props( 2 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment