connectivity/source/drivers/mozab/MDriver.cxx | 5 + dbaccess/source/core/api/query.cxx | 2 dbaccess/source/core/api/querycontainer.cxx | 10 +-- dbaccess/source/core/dataaccess/commandcontainer.cxx | 3 dbaccess/source/core/dataaccess/commanddefinition.cxx | 58 +++++++++++++++++ dbaccess/source/core/dataaccess/commanddefinition.hxx | 60 +++++++++++++++--- dbaccess/source/inc/stringconstants.hrc | 1 dbaccess/source/inc/stringconstants.inc | 1 offapi/UnoApi_offapi.mk | 3 offapi/com/sun/star/sdb/QueryDefinition.idl | 41 ------------ offapi/com/sun/star/sdb/XQueryDefinition.idl | 52 +++++++++++++++ offapi/type_reference/types.rdb |binary 12 files changed, 177 insertions(+), 59 deletions(-)
New commits: commit 3064d2214e16b2221e6297bc6c68d684aece96b6 Author: Fridrich Å trba <fridrich.st...@bluewin.ch> Date: Tue Apr 2 12:38:45 2013 +0200 Fix debug build Change-Id: I1a4db30f4cc33ee99b48a25db6e6fcd600d00ffd Reviewed-on: https://gerrit.libreoffice.org/3168 Reviewed-by: Andras Timar <ati...@suse.com> Tested-by: Andras Timar <ati...@suse.com> (cherry picked from commit c976cd58b7bee71ea43dd1f4aad3b1c1fcb32516) diff --git a/connectivity/source/drivers/mozab/MDriver.cxx b/connectivity/source/drivers/mozab/MDriver.cxx index 986f85a..2aa7fdb 100644 --- a/connectivity/source/drivers/mozab/MDriver.cxx +++ b/connectivity/source/drivers/mozab/MDriver.cxx @@ -272,7 +272,10 @@ namespace if ( !_rFunction ) { // did not find the symbol - OSL_FAIL( ( ::rtl::OString( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ) + ::rtl::OString( _pAsciiSymbolName ) ).getStr() ); + rtl::OUStringBuffer aBuf; + aBuf.append( "lcl_getFunctionFromModuleOrUnload: could not find the symbol " ); + aBuf.append( sSymbolName ); + OSL_FAIL( aBuf.makeStringAndClear().getStr() ); osl_unloadModule( _rModule ); _rModule = NULL; } commit a789a2fc94ec84d34dafb328c53dd0eaaa8ca4a0 Author: Noel Grandin <n...@peralex.com> Date: Wed Mar 20 09:12:24 2013 +0200 fdo#46808, convert sdb::QueryDesigner to new style Change-Id: I694dd16920304d0f07369e97c87a4a97b92eadeb diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index ed1f073..2d10f92 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -217,7 +217,7 @@ void OQuery::rebuildColumns() } // XServiceInfo -IMPLEMENT_SERVICE_INFO3(OQuery, "com.sun.star.sdb.dbaccess.OQuery", SERVICE_SDB_DATASETTINGS.ascii, SERVICE_SDB_QUERY.ascii, SERVICE_SDB_QUERYDEFINITION.ascii) +IMPLEMENT_SERVICE_INFO3(OQuery, "com.sun.star.sdb.dbaccess.OQuery", SERVICE_SDB_DATASETTINGS.ascii, SERVICE_SDB_QUERY.ascii, "com.sun.star.sdb.QueryDefinition") // ::com::sun::star::beans::XPropertyChangeListener void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource ) throw(RuntimeException) diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index 6ffb474..984b9e8 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -27,8 +27,9 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XContainer.hpp> -#include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/container/XContainerApproveBroadcaster.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/sdb/QueryDefinition.hpp> #include <connectivity/dbexception.hxx> @@ -154,10 +155,9 @@ void SAL_CALL OQueryContainer::appendByDescriptor( const Reference< XPropertySet throw DisposedException( ::rtl::OUString(), *this ); // first clone this object's CommandDefinition part - Reference< XPropertySet > xCommandDefinitionPart( - m_aContext->getServiceManager()->createInstanceWithContext( SERVICE_SDB_QUERYDEFINITION, m_aContext), - UNO_QUERY_THROW ); - ::comphelper::copyProperties( _rxDesc, xCommandDefinitionPart ); + Reference< css::sdb::XQueryDefinition > xCommandDefinitionPart = css::sdb::QueryDefinition::create(m_aContext); + + ::comphelper::copyProperties( _rxDesc, Reference<XPropertySet>(xCommandDefinitionPart, UNO_QUERY_THROW) ); // TODO : the columns part of the descriptor has to be copied // create a wrapper for the object (*before* inserting into our command definition container) diff --git a/dbaccess/source/core/dataaccess/commandcontainer.cxx b/dbaccess/source/core/dataaccess/commandcontainer.cxx index 5052af6..eb47000 100644 --- a/dbaccess/source/core/dataaccess/commandcontainer.cxx +++ b/dbaccess/source/core/dataaccess/commandcontainer.cxx @@ -70,7 +70,8 @@ Reference< XContent > OCommandContainer::createObject( const ::rtl::OUString& _r const TContentPtr& pElementContent( rDefinitions.find( _rName )->second ); if ( m_bTables ) return new OComponentDefinition( *this, _rName, m_aContext, pElementContent, m_bTables ); - return new OCommandDefinition( *this, _rName, m_aContext, pElementContent ); + else + return static_cast< css::sdb::XQueryDefinition * > ( new OCommandDefinition( *this, _rName, m_aContext, pElementContent ) ); } Reference< XInterface > SAL_CALL OCommandContainer::createInstanceWithArguments(const Sequence< Any >& /*aArguments*/ ) throw (Exception, RuntimeException) diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx index 8278bff..ba0016b 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.cxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx @@ -72,6 +72,62 @@ void OCommandDefinition::registerProperties() &rCommandDefinition.m_aLayoutInformation, ::getCppuType(&rCommandDefinition.m_aLayoutInformation)); } +rtl::OUString OCommandDefinition::getName() throw( ::com::sun::star::uno::RuntimeException ) +{ + return getDefinition().m_aProps.aTitle; +} + +rtl::OUString OCommandDefinition::getCommand() throw( ::com::sun::star::uno::RuntimeException ) +{ + return getCommandDefinition().m_sCommand; +} + +void OCommandDefinition::setCommand(const rtl::OUString& p1) throw( ::com::sun::star::uno::RuntimeException ) +{ + setPropertyValue(PROPERTY_COMMAND, Any(p1) ); +} + +sal_Bool OCommandDefinition::getEscapeProcessing() throw( ::com::sun::star::uno::RuntimeException ) +{ + return getCommandDefinition().m_bEscapeProcessing; +} + +void OCommandDefinition::setEscapeProcessing(sal_Bool p1) throw( ::com::sun::star::uno::RuntimeException ) +{ + setPropertyValue(PROPERTY_ESCAPE_PROCESSING, Any(p1) ); +} + +rtl::OUString OCommandDefinition::getUpdateTableName() throw( ::com::sun::star::uno::RuntimeException ) +{ + return getCommandDefinition().m_sUpdateTableName; +} + +void OCommandDefinition::setUpdateTableName(const rtl::OUString& p1) throw( ::com::sun::star::uno::RuntimeException ) +{ + setPropertyValue(PROPERTY_UPDATE_TABLENAME, Any(p1) ); +} + +rtl::OUString OCommandDefinition::getUpdateCatalogName() throw( ::com::sun::star::uno::RuntimeException ) +{ + return getCommandDefinition().m_sUpdateCatalogName; +} + +void OCommandDefinition::setUpdateCatalogName(const rtl::OUString& p1) throw( ::com::sun::star::uno::RuntimeException ) +{ + setPropertyValue(PROPERTY_UPDATE_CATALOGNAME, Any(p1) ); +} + +rtl::OUString OCommandDefinition::getUpdateSchemaName() throw( ::com::sun::star::uno::RuntimeException ) +{ + return getCommandDefinition().m_sUpdateSchemaName; +} + +void OCommandDefinition::setUpdateSchemaName(const rtl::OUString& p1) throw( ::com::sun::star::uno::RuntimeException ) +{ + setPropertyValue(PROPERTY_UPDATE_SCHEMANAME, Any(p1) ); +} + + OCommandDefinition::OCommandDefinition(const Reference< XComponentContext >& _xORB ,const Reference< XInterface >& _rxContainer ,const TContentPtr& _pImpl) @@ -114,7 +170,7 @@ OUString OCommandDefinition::getImplementationName_static( ) throw(RuntimeExcep Sequence< OUString > OCommandDefinition::getSupportedServiceNames_static( ) throw(RuntimeException) { Sequence< OUString > aServices(3); - aServices.getArray()[0] = SERVICE_SDB_QUERYDEFINITION; + aServices.getArray()[0] = "com.sun.star.sdb.QueryDefinition"; aServices.getArray()[1] = "com.sun.star.sdb.CommandDefinition"; aServices.getArray()[2] = "com.sun.star.ucb.Content"; return aServices; diff --git a/dbaccess/source/core/dataaccess/commanddefinition.hxx b/dbaccess/source/core/dataaccess/commanddefinition.hxx index f2a469b..ccc956b 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.hxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.hxx @@ -21,17 +21,19 @@ #define _DBA_COREDATAACESS_COMMANDDEFINITION_HXX_ #include "commandbase.hxx" -#include <comphelper/propertycontainer.hxx> #include "apitools.hxx" -#include <comphelper/uno3.hxx> +#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/sdbcx/XRename.hpp> -#include <cppuhelper/implbase1.hxx> -#include <comphelper/proparrhlp.hxx> +#include <com/sun/star/sdb/XQueryDefinition.hpp> #include "datasettings.hxx" -#include <com/sun/star/container/XNameAccess.hpp> #include "ContentHelper.hxx" #include "ComponentDefinition.hxx" +#include <comphelper/propertycontainer.hxx> +#include <comphelper/proparrhlp.hxx> +#include <comphelper/uno3.hxx> +#include <cppuhelper/implbase2.hxx> + //........................................................................ namespace dbaccess @@ -42,18 +44,19 @@ namespace dbaccess //= OCommandDefinition - a database "document" which describes a query //========================================================================= class OCommandDefinition_Impl : public OComponentDefinition_Impl - ,public OCommandBase + ,public OCommandBase { public: }; -typedef ::cppu::ImplHelper1 < ::com::sun::star::sdbcx::XRename +typedef ::cppu::ImplHelper2 < ::com::sun::star::sdbcx::XRename, + ::com::sun::star::sdb::XQueryDefinition > OCommandDefinition_Base; class OCommandDefinition; typedef ::comphelper::OPropertyArrayUsageHelper< OCommandDefinition > OCommandDefinition_PROP; -class OCommandDefinition :public OComponentDefinition +class OCommandDefinition : public OComponentDefinition ,public OCommandDefinition_Base ,public OCommandDefinition_PROP { @@ -96,6 +99,47 @@ public: // XRename virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException); + // overrides to resolve ambiguity + virtual void SAL_CALL setPropertyValue(const rtl::OUString& p1, const com::sun::star::uno::Any& p2) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) + { OComponentDefinition::setPropertyValue(p1, p2); } + virtual com::sun::star::uno::Any SAL_CALL getPropertyValue(const rtl::OUString& p1) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) + { return OComponentDefinition::getPropertyValue(p1); } + virtual void SAL_CALL addPropertyChangeListener(const rtl::OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener>& p2) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::addPropertyChangeListener(p1, p2); } + virtual void SAL_CALL removePropertyChangeListener(const rtl::OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertyChangeListener>& p2) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::removePropertyChangeListener(p1, p2); } + virtual void SAL_CALL addVetoableChangeListener(const rtl::OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XVetoableChangeListener>& p2) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::addVetoableChangeListener(p1, p2); } + virtual void SAL_CALL removeVetoableChangeListener(const rtl::OUString& p1, const com::sun::star::uno::Reference<com::sun::star::beans::XVetoableChangeListener>& p2) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::removeVetoableChangeListener(p1, p2); } + virtual com::sun::star::uno::Reference<com::sun::star::ucb::XContentIdentifier> SAL_CALL getIdentifier() throw( ::com::sun::star::uno::RuntimeException ) + { return OComponentDefinition::getIdentifier(); } + virtual rtl::OUString SAL_CALL getContentType() throw( ::com::sun::star::uno::RuntimeException ) + { return OComponentDefinition::getContentType(); } + virtual void SAL_CALL addContentEventListener(const com::sun::star::uno::Reference<com::sun::star::ucb::XContentEventListener>& p1) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::addContentEventListener(p1); } + virtual void SAL_CALL removeContentEventListener(const com::sun::star::uno::Reference<com::sun::star::ucb::XContentEventListener>& p1) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::removeContentEventListener(p1); } + virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::dispose(); } + virtual void SAL_CALL addEventListener(const com::sun::star::uno::Reference<com::sun::star::lang::XEventListener>& p1) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::addEventListener(p1); } + virtual void SAL_CALL removeEventListener(const com::sun::star::uno::Reference<com::sun::star::lang::XEventListener>& p1) throw( ::com::sun::star::uno::RuntimeException ) + { OComponentDefinition::removeEventListener(p1); } + + // XQueryDefinition properties + virtual rtl::OUString getName() throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString getCommand() throw( ::com::sun::star::uno::RuntimeException ); + virtual void setCommand(const rtl::OUString&) throw( ::com::sun::star::uno::RuntimeException ); + virtual sal_Bool getEscapeProcessing() throw( ::com::sun::star::uno::RuntimeException ); + virtual void setEscapeProcessing(sal_Bool) throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString getUpdateTableName() throw( ::com::sun::star::uno::RuntimeException ); + virtual void setUpdateTableName(const rtl::OUString&) throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString getUpdateCatalogName() throw( ::com::sun::star::uno::RuntimeException ); + virtual void setUpdateCatalogName(const rtl::OUString&) throw( ::com::sun::star::uno::RuntimeException ); + virtual rtl::OUString getUpdateSchemaName() throw( ::com::sun::star::uno::RuntimeException ); + virtual void setUpdateSchemaName(const rtl::OUString&) throw( ::com::sun::star::uno::RuntimeException ); + // OPropertySetHelper DECLARE_PROPERTYCONTAINER_DEFAULTS( ); diff --git a/dbaccess/source/inc/stringconstants.hrc b/dbaccess/source/inc/stringconstants.hrc index 8c60d05..0784969 100644 --- a/dbaccess/source/inc/stringconstants.hrc +++ b/dbaccess/source/inc/stringconstants.hrc @@ -365,7 +365,6 @@ DECLARE_CONSTASCII_USTRING(SERVICE_SDB_SQLQUERYCOMPOSER); DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATASETTINGS); DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERYDESCRIPTOR); DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERY); -DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERYDEFINITION); DECLARE_CONSTASCII_USTRING(SERVICE_SDB_COLUMNSETTINGS); DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMNS); DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_TABLES); diff --git a/dbaccess/source/inc/stringconstants.inc b/dbaccess/source/inc/stringconstants.inc index 3ce49a0..e72c373 100644 --- a/dbaccess/source/inc/stringconstants.inc +++ b/dbaccess/source/inc/stringconstants.inc @@ -202,7 +202,6 @@ IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_SQLQUERYCOMPOSER, "com.sun.star.sdb.SQL IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATASETTINGS, "com.sun.star.sdb.DefinitionSettings"); IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERYDESCRIPTOR, "com.sun.star.sdb.QueryDescriptor"); IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERY, "com.sun.star.sdb.Query"); -IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERYDEFINITION, "com.sun.star.sdb.QueryDefinition"); IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMNS, "com.sun.star.sdbcx.Columns"); IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_TABLES, "com.sun.star.sdbcx.Tables"); IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERIES, "com.sun.star.sdb.Queries"); diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 2c18bf8..7151bc3 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -292,6 +292,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdb,\ InteractionHandler \ FilterDialog \ OrderDialog \ + QueryDefinition \ ReportDesign \ TableDefinition \ TextConnectionSettings \ @@ -1042,7 +1043,6 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/sdb, OrderColumn \ PreparedStatement \ Query \ - QueryDefinition \ QueryDescriptor \ QueryDesign \ RelationDesign \ @@ -3125,6 +3125,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/sdb,\ XOfficeDatabaseDocument \ XParametersSupplier \ XQueriesSupplier \ + XQueryDefinition \ XQueryDefinitionsSupplier \ XReportDocumentsSupplier \ XResultSetAccess \ diff --git a/offapi/com/sun/star/sdb/QueryDefinition.idl b/offapi/com/sun/star/sdb/QueryDefinition.idl index 6107e31..2f0f7fe 100644 --- a/offapi/com/sun/star/sdb/QueryDefinition.idl +++ b/offapi/com/sun/star/sdb/QueryDefinition.idl @@ -19,7 +19,7 @@ #ifndef __com_sun_star_sdb_QueryDefinition_idl__ #define __com_sun_star_sdb_QueryDefinition_idl__ -#include <com/sun/star/beans/XPropertySet.idl> +#include <com/sun/star/sdb/XQueryDefinition.idl> module com { module sun { module star { module sdb { @@ -30,44 +30,7 @@ It can be used, if there is a need to execute SQL statement more than once. </p> */ -published service QueryDefinition -{ - - /** access to the owning database definition object. - */ - interface com::sun::star::beans::XPropertySet; - - - /** is the name of the definition. - */ - [readonly, property] string Name; - - - /** is the command of the query, this is typically a select statement. - */ - [property] string Command; - - - /** should we use escape processing for the query. - */ - [property] boolean EscapeProcessing; - - - /** is the name of the table which should be updated. This is usually used - for queries which relate on more than one table. - */ - [property] string UpdateTableName; - - - /** is the name of the update table catalog. - */ - [property] string UpdateCatalogName; - - - /** is the name of the update table schema. - */ - [property] string UpdateSchemaName; -}; +published service QueryDefinition : XQueryDefinition; }; }; }; }; diff --git a/offapi/com/sun/star/sdb/XQueryDefinition.idl b/offapi/com/sun/star/sdb/XQueryDefinition.idl new file mode 100644 index 0000000..064a7bb --- /dev/null +++ b/offapi/com/sun/star/sdb/XQueryDefinition.idl @@ -0,0 +1,52 @@ +/* -*- 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_XQueryDefinition_idl__ +#define __com_sun_star_sdb_XQueryDefinition_idl__ + +#include <com/sun/star/beans/XPropertySet.idl> +#include <com/sun/star/ucb/XContent.idl> +#include <com/sun/star/lang/XComponent.idl> + + module com { module sun { module star { module sdb { + + +/** + @since LibreOffice 4.1 + */ +published interface XQueryDefinition +{ + + /** access to the owning database definition object. + */ + interface com::sun::star::beans::XPropertySet; + + interface com::sun::star::ucb::XContent; + + interface com::sun::star::lang::XComponent; + +}; + + +}; }; }; }; + +/*=========================================================================== +===========================================================================*/ +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb index f348396..b0c2c88 100644 Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits