[Libreoffice-commits] core.git: 4 commits - dbaccess/source extensions/source offapi/com offapi/UnoApi_offapi.mk
Noel Grandin
noel at peralex.com
Mon Mar 25 01:35:31 PDT 2013
dbaccess/source/core/dataaccess/commandcontainer.cxx | 5 -
dbaccess/source/core/dataaccess/commanddefinition.cxx | 2
dbaccess/source/core/misc/sdbcoretools.cxx | 22 ++---
dbaccess/source/filter/xml/xmlQuery.cxx | 2
dbaccess/source/inc/stringconstants.hrc | 1
dbaccess/source/inc/stringconstants.inc | 1
dbaccess/source/ui/app/AppController.cxx | 16 ----
extensions/source/propctrlr/taborder.cxx | 9 --
offapi/UnoApi_offapi.mk | 2
offapi/com/sun/star/sdb/CommandDefinition.idl | 38 +++++++++
offapi/com/sun/star/sdb/application/MacroMigrationWizard.idl | 43 +++++++++++
11 files changed, 101 insertions(+), 40 deletions(-)
New commits:
commit 905501b635db939874b3c8787b7c0677afcbd9ab
Author: Noel Grandin <noel at peralex.com>
Date: Mon Mar 11 18:13:51 2013 +0200
fdo#46808, convert sdb::CommandDefinition to new-style
the service already existed, it just needed an IDL file
Change-Id: I99c08b4e3a3ee0131b6fd904803efe7273cd1694
diff --git a/dbaccess/source/core/dataaccess/commandcontainer.cxx b/dbaccess/source/core/dataaccess/commandcontainer.cxx
index f665df2..5052af6 100644
--- a/dbaccess/source/core/dataaccess/commandcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/commandcontainer.cxx
@@ -24,6 +24,7 @@
#include <tools/debug.hxx>
#include "dbastrings.hrc"
#include <com/sun/star/sdb/TableDefinition.hpp>
+#include <com/sun/star/sdb/CommandDefinition.hpp>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -80,9 +81,9 @@ Reference< XInterface > SAL_CALL OCommandContainer::createInstanceWithArguments(
Reference< XInterface > SAL_CALL OCommandContainer::createInstance( ) throw (Exception, RuntimeException)
{
if(m_bTables)
- return com::sun::star::sdb::TableDefinition::createDefault( m_aContext );
+ return css::sdb::TableDefinition::createDefault( m_aContext );
else
- return m_aContext->getServiceManager()->createInstanceWithContext(SERVICE_SDB_COMMAND_DEFINITION, m_aContext);
+ return css::sdb::CommandDefinition::create( m_aContext );
}
OUString OCommandContainer::determineContentType() const
diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx
index 560b977..8278bff 100644
--- a/dbaccess/source/core/dataaccess/commanddefinition.cxx
+++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx
@@ -115,7 +115,7 @@ Sequence< OUString > OCommandDefinition::getSupportedServiceNames_static( ) thr
{
Sequence< OUString > aServices(3);
aServices.getArray()[0] = SERVICE_SDB_QUERYDEFINITION;
- aServices.getArray()[1] = SERVICE_SDB_COMMAND_DEFINITION;
+ aServices.getArray()[1] = "com.sun.star.sdb.CommandDefinition";
aServices.getArray()[2] = "com.sun.star.ucb.Content";
return aServices;
}
diff --git a/dbaccess/source/filter/xml/xmlQuery.cxx b/dbaccess/source/filter/xml/xmlQuery.cxx
index dc2a403..cddb57a 100644
--- a/dbaccess/source/filter/xml/xmlQuery.cxx
+++ b/dbaccess/source/filter/xml/xmlQuery.cxx
@@ -44,7 +44,7 @@ OXMLQuery::OXMLQuery( ODBFilter& rImport
,const Reference< XAttributeList > & _xAttrList
,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xParentContainer
) :
- OXMLTable( rImport, nPrfx, _sLocalName,_xAttrList,_xParentContainer,SERVICE_SDB_COMMAND_DEFINITION )
+ OXMLTable( rImport, nPrfx, _sLocalName,_xAttrList,_xParentContainer, "com.sun.star.sdb.CommandDefinition" )
,m_bEscapeProcessing(sal_True)
{
DBG_CTOR(OXMLQuery,NULL);
diff --git a/dbaccess/source/inc/stringconstants.hrc b/dbaccess/source/inc/stringconstants.hrc
index 0da2d6e..8c60d05 100644
--- a/dbaccess/source/inc/stringconstants.hrc
+++ b/dbaccess/source/inc/stringconstants.hrc
@@ -373,7 +373,6 @@ DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERIES);
DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_DRIVERMANAGER);
DECLARE_CONSTASCII_USTRING(SERVICE_FRAME_DESKTOP);
DECLARE_CONSTASCII_USTRING(SERVICE_UI_FOLDERPICKER);
-DECLARE_CONSTASCII_USTRING(SERVICE_SDB_COMMAND_DEFINITION);
DECLARE_CONSTASCII_USTRING(SERVICE_NAME_FORM);
DECLARE_CONSTASCII_USTRING(SERVICE_NAME_FORM_COLLECTION);
DECLARE_CONSTASCII_USTRING(SERVICE_NAME_REPORT);
diff --git a/dbaccess/source/inc/stringconstants.inc b/dbaccess/source/inc/stringconstants.inc
index 066cc20..3ce49a0 100644
--- a/dbaccess/source/inc/stringconstants.inc
+++ b/dbaccess/source/inc/stringconstants.inc
@@ -208,7 +208,6 @@ IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_TABLES, "com.sun.star.sdbcx.Tables");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERIES, "com.sun.star.sdb.Queries");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_INDEXCOLUMN, "com.sun.star.sdbcx.IndexColumn");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_KEYCOLUMN, "com.sun.star.sdbcx.KeyColumn");
-IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_COMMAND_DEFINITION, "com.sun.star.sdb.CommandDefinition");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DOCUMENTDEFINITION, "com.sun.star.sdb.DocumentDefinition");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_NAME_FORM, "com.sun.star.sdb.Form");
IMPLEMENT_CONSTASCII_USTRING(SERVICE_NAME_FORM_COLLECTION, "com.sun.star.sdb.Forms");
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index a6f8997..2c18bf8 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -284,6 +284,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/script/
VBAMacroResolver \
))
$(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb,\
+ CommandDefinition \
DataAccessDescriptorFactory \
DatabaseContext \
DatabaseInteractionHandler \
diff --git a/offapi/com/sun/star/sdb/CommandDefinition.idl b/offapi/com/sun/star/sdb/CommandDefinition.idl
new file mode 100644
index 0000000..0a27a04
--- /dev/null
+++ b/offapi/com/sun/star/sdb/CommandDefinition.idl
@@ -0,0 +1,38 @@
+/* -*- 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_sdb_CommandDefinition_idl__
+#define __com_sun_star_sdb_CommandDefinition_idl__
+
+#include <com/sun/star/sdbcx/XRename.idl>
+
+ module com { module sun { module star { module sdb {
+
+/**
+ @since LibreOffice 4.1
+ */
+service CommandDefinition : com::sun::star::sdbcx::XRename;
+
+
+}; }; }; };
+
+/*===========================================================================
+===========================================================================*/
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 8172eaf8dcd2da6827f0a0445e98b947d0eac9be
Author: Noel Grandin <noel at peralex.com>
Date: Mon Mar 11 17:54:52 2013 +0200
fdo#46808, use service constructor
Change-Id: I349557ae5897ad668abab30b34b186e746b94c75
diff --git a/dbaccess/source/core/misc/sdbcoretools.cxx b/dbaccess/source/core/misc/sdbcoretools.cxx
index edee7a5..490f1bb 100644
--- a/dbaccess/source/core/misc/sdbcoretools.cxx
+++ b/dbaccess/source/core/misc/sdbcoretools.cxx
@@ -26,7 +26,7 @@
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/sdb/XDocumentDataSource.hpp>
-#include <com/sun/star/task/XInteractionRequestStringResolver.hpp>
+#include <com/sun/star/task/InteractionRequestStringResolver.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
@@ -86,18 +86,14 @@ namespace dbaccess
try
{
- Reference< XInteractionRequestStringResolver > xStringResolver(
- _rContext->getServiceManager()->createInstanceWithContext("com.sun.star.task.InteractionRequestStringResolver", _rContext),
- UNO_QUERY );
- if ( xStringResolver.is() )
- {
- ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( _rError ) );
- ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove );
- pRequest->addContinuation( pApprove.get() );
- Optional< ::rtl::OUString > aMessage = xStringResolver->getStringFromInformationalRequest( pRequest.get() );
- if ( aMessage.IsPresent )
- sDisplayMessage = aMessage.Value;
- }
+ Reference< XInteractionRequestStringResolver > xStringResolver = InteractionRequestStringResolver::create(_rContext);
+
+ ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest( new ::comphelper::OInteractionRequest( _rError ) );
+ ::rtl::Reference< ::comphelper::OInteractionApprove > pApprove( new ::comphelper::OInteractionApprove );
+ pRequest->addContinuation( pApprove.get() );
+ Optional< ::rtl::OUString > aMessage = xStringResolver->getStringFromInformationalRequest( pRequest.get() );
+ if ( aMessage.IsPresent )
+ sDisplayMessage = aMessage.Value;
}
catch( const Exception& )
{
commit 5b982b69363f0f067fe4a0f679528ce1c5a2eafc
Author: Noel Grandin <noel at peralex.com>
Date: Mon Mar 11 17:51:56 2013 +0200
fdo#46808, Convert sdb::application::MacroMigrationWizard to new style
The service already existed, it just needed an IDL file
Change-Id: I8299b12ba8f5f0c00b0ff44dab641a6f19826b01
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 2a41aa0..0c9ca0e 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -44,6 +44,7 @@
#include <com/sun/star/sdbcx/XRename.hpp>
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
+#include <com/sun/star/sdb/application/MacroMigrationWizard.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/uno/XNamingService.hpp>
#include <com/sun/star/util/XFlushable.hpp>
@@ -3008,20 +3009,7 @@ void OApplicationController::impl_migrateScripts_nothrow()
{
try
{
- OUString sDialogService("com.sun.star.sdb.application.MacroMigrationWizard");
- Reference<XComponentContext> aContext( getORB() );
- Sequence< Any > aDialogArgs(1);
- aDialogArgs[0] <<= Reference< XOfficeDatabaseDocument >( m_xModel, UNO_QUERY_THROW );
- Reference< XExecutableDialog > xDialog(
- aContext->getServiceManager()->createInstanceWithArgumentsAndContext(sDialogService, aDialogArgs, aContext),
- UNO_QUERY );
-
- if ( !xDialog.is() )
- {
- ShowServiceNotAvailableError( getView(), sDialogService, true );
- return;
- }
-
+ Reference< XExecutableDialog > xDialog = css::sdb::application::MacroMigrationWizard::createWithDocument( getORB(), Reference< XOfficeDatabaseDocument >( m_xModel, UNO_QUERY_THROW ) );
xDialog->execute();
}
catch( const Exception& )
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 45e2766..a6f8997 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -297,6 +297,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb,\
))
$(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb/application,\
CopyTableWizard \
+ MacroMigrationWizard \
))
$(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdbc,\
ConnectionPool \
diff --git a/offapi/com/sun/star/sdb/application/MacroMigrationWizard.idl b/offapi/com/sun/star/sdb/application/MacroMigrationWizard.idl
new file mode 100644
index 0000000..015afe4
--- /dev/null
+++ b/offapi/com/sun/star/sdb/application/MacroMigrationWizard.idl
@@ -0,0 +1,43 @@
+/* -*- 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_sdb_application_MacroMigrationWizard_idl__
+#define __com_sun_star_sdb_application_MacroMigrationWizard_idl__
+
+#include <com/sun/star/ui/dialogs/XExecutableDialog.idl>
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.idl>
+
+module com { module sun { module star { module sdb { module application {
+
+
+/**
+ @since LibreOffice 4.1
+ */
+service MacroMigrationWizard : com::sun::star::ui::dialogs::XExecutableDialog
+{
+ createWithDocument([in] com::sun::star::sdb::XOfficeDatabaseDocument Document);
+};
+
+
+}; }; }; }; };
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit d08f360e6debc38868e84030a8ec3ed401803754
Author: Noel Grandin <noel at peralex.com>
Date: Wed Mar 20 09:09:50 2013 +0200
fdo#46808, convert extension from deprecated interface
Change-Id: I2404637c7f1dc0a89882540581ae34a706ff86ee
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index eb353bd..6fe43eb 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -27,7 +27,7 @@
#include <comphelper/property.hxx>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/form/FormComponentType.hpp>
-#include <com/sun/star/awt/XTabController.hpp>
+#include <com/sun/star/form/runtime/FormController.hpp>
#include <vcl/scrbar.hxx>
#include "svtools/treelistentry.hxx"
@@ -241,12 +241,7 @@ namespace pcr
{
try
{
- Reference< XTabController > xTabController;
- if ( m_xORB.is() )
- xTabController.set( m_xORB->getServiceManager()->createInstanceWithContext("com.sun.star.form.FormController", m_xORB), UNO_QUERY_THROW );
- DBG_ASSERT( xTabController.is(), "TabOrderDialog::AutoOrderClickHdl: could not instantiate a tab controller!" );
- if ( !xTabController.is() )
- return 0;
+ Reference< css::form::runtime::XFormController > xTabController = css::form::runtime::FormController::create( m_xORB );
xTabController->setModel( m_xTempModel );
xTabController->setContainer( m_xControlContainer );
More information about the Libreoffice-commits
mailing list