2010-10-12 15:59:03 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2004-08-02 15:22:26 +00:00
|
|
|
|
2017-10-23 22:42:52 +02:00
|
|
|
#include <dbu_reghelper.hxx>
|
|
|
|
#include <uiservices.hxx>
|
2004-08-02 15:22:26 +00:00
|
|
|
#include "admindlg.hxx"
|
2017-10-23 22:42:52 +02:00
|
|
|
#include <dbadmin.hxx>
|
2013-03-19 13:08:47 +02:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2018-10-06 15:54:11 +01:00
|
|
|
#include <toolkit/helper/vclunohelper.hxx>
|
2019-04-07 18:43:32 +02:00
|
|
|
#include <vcl/svapp.hxx>
|
2004-08-02 15:22:26 +00:00
|
|
|
|
|
|
|
using namespace dbaui;
|
|
|
|
|
2017-12-08 15:58:41 +02:00
|
|
|
extern "C" void createRegistryInfo_ODataSourcePropertyDialog()
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
|
|
|
static OMultiInstanceAutoRegistration< ODataSourcePropertyDialog > aAutoRegistration;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
|
2013-03-19 13:08:47 +02:00
|
|
|
ODataSourcePropertyDialog::ODataSourcePropertyDialog(const Reference< XComponentContext >& _rxORB)
|
2004-08-02 15:22:26 +00:00
|
|
|
:ODatabaseAdministrationDialog(_rxORB)
|
|
|
|
{
|
|
|
|
}
|
2013-08-17 23:43:14 +02:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
Sequence<sal_Int8> SAL_CALL ODataSourcePropertyDialog::getImplementationId( )
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
2014-03-10 13:08:29 +01:00
|
|
|
return css::uno::Sequence<sal_Int8>();
|
2004-08-02 15:22:26 +00:00
|
|
|
}
|
|
|
|
|
No need to keep these whitelisted functions decorated with SAL_CALL
The only effect SAL_CALL effectively has on LO-internal code is to change non-
static member functions from __thiscall to __cdecl in MSVC (where all other
functions are __cdecl by default, anyway). (For 3rd-party code, it could be
argued that SAL_CALL is useful on function declarations in the URE stable
interface other than non-static member functions, too, in case 3rd-party code
uses a compiler switch to change the default calling convention to something
other than __cdecl. But loplugin:salcall exempts the URE stable interface,
anyway.)
One could argue that SAL_CALL, even if today it effectively only affects non-
static member functions in MSVC, could be extended in the future to affect more
functions on more platforms. However, the current code would already not
support that. For example, 3af500580b1c82eabd60335c9ebc458a3f68850c
"loplugin:salcall fix functions" changed FrameControl_createInstance in
UnoControls/source/base/registercontrols.cxx to no longer be SAL_CALL, even
though its address (in ctl_component_getFacrory, in the same file) is passed to
cppuhelper::createSingleFactory as an argument of type
cppu::ComponentInstantiation, which is a pointer to SAL_CALL function.
Change-Id: I3acbf7314a3d7868ed70e35bb5c47bc11a0b7ff6
Reviewed-on: https://gerrit.libreoffice.org/46436
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-14 08:45:02 +01:00
|
|
|
Reference< XInterface > ODataSourcePropertyDialog::Create(const Reference< XMultiServiceFactory >& _rxFactory)
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
2013-03-19 13:08:47 +02:00
|
|
|
return *(new ODataSourcePropertyDialog( comphelper::getComponentContext(_rxFactory) ));
|
2004-08-02 15:22:26 +00:00
|
|
|
}
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString SAL_CALL ODataSourcePropertyDialog::getImplementationName()
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
|
|
|
return getImplementationName_Static();
|
|
|
|
}
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
OUString ODataSourcePropertyDialog::getImplementationName_Static()
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
2019-07-30 17:56:32 +02:00
|
|
|
return "org.openoffice.comp.dbu.ODatasourceAdministrationDialog";
|
2004-08-02 15:22:26 +00:00
|
|
|
}
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Sequence<OUString> SAL_CALL ODataSourcePropertyDialog::getSupportedServiceNames()
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
|
|
|
return getSupportedServiceNames_Static();
|
|
|
|
}
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
css::uno::Sequence<OUString> ODataSourcePropertyDialog::getSupportedServiceNames_Static()
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
2015-11-15 12:17:19 +02:00
|
|
|
css::uno::Sequence<OUString> aSupported { "com.sun.star.sdb.DatasourceAdministrationDialog" };
|
2004-08-02 15:22:26 +00:00
|
|
|
return aSupported;
|
|
|
|
}
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
Reference<XPropertySetInfo> SAL_CALL ODataSourcePropertyDialog::getPropertySetInfo()
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
|
|
|
Reference<XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
|
|
|
|
return xInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
::cppu::IPropertyArrayHelper& ODataSourcePropertyDialog::getInfoHelper()
|
|
|
|
{
|
2015-04-13 12:35:57 +02:00
|
|
|
return *getArrayHelper();
|
2004-08-02 15:22:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
::cppu::IPropertyArrayHelper* ODataSourcePropertyDialog::createArrayHelper( ) const
|
|
|
|
{
|
|
|
|
Sequence< Property > aProps;
|
|
|
|
describeProperties(aProps);
|
|
|
|
return new ::cppu::OPropertyArrayHelper(aProps);
|
|
|
|
}
|
2013-08-17 23:43:14 +02:00
|
|
|
|
2019-09-15 20:41:25 +01:00
|
|
|
std::unique_ptr<weld::DialogController> ODataSourcePropertyDialog::createDialog(const css::uno::Reference<css::awt::XWindow>& rParent)
|
2004-08-02 15:22:26 +00:00
|
|
|
{
|
2018-10-23 16:18:53 +01:00
|
|
|
std::unique_ptr<ODbAdminDialog> xDialog(new ODbAdminDialog(Application::GetFrameWeld(rParent), m_pDatasourceItems.get(), m_aContext));
|
2004-08-02 15:22:26 +00:00
|
|
|
|
|
|
|
// the initial selection
|
|
|
|
if ( m_aInitialSelection.hasValue() )
|
2018-10-23 16:18:53 +01:00
|
|
|
xDialog->selectDataSource(m_aInitialSelection);
|
2004-08-02 15:22:26 +00:00
|
|
|
|
2019-09-15 20:41:25 +01:00
|
|
|
return xDialog;
|
2004-08-02 15:22:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace dbaui
|
|
|
|
|
2010-10-12 15:59:03 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|