Files
libreoffice/dbaccess/source/core/api/query.cxx

369 lines
14 KiB
C++
Raw Normal View History

/* -*- 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 .
*/
2000-09-18 23:16:46 +00:00
#include "query.hxx"
migrate to boost::gettext * all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-06-11 20:56:30 +01:00
#include "stringconstants.hxx"
CWS-TOOLING: integrate CWS evoab2def 2009-05-28 16:00:19 +0200 fs r272412 : don't use createFalse - Evo 2.22 simply hangs when ask for all contacts without a first name. Instead, in the WHERE 0=1 case, simply create an empty result set 2009-05-22 14:25:51 +0200 fs r272193 : #i10000# 2009-05-22 14:25:37 +0200 fs r272192 : oops, ENABLE_EVOAB2 for some platforms only, not generically 2009-05-22 14:19:00 +0200 fs r272191 : #i10000# 2009-05-22 12:42:38 +0200 fs r272183 : when sorting, properly use a syslocale collator, instead of comparing the numerical values of the string's UTF-16 code points 2009-05-20 15:09:00 +0200 fs r272131 : clear/getWarnings: also allowed without cache 2009-05-20 14:11:19 +0200 fs r272128 : removed debug traces 2009-05-20 14:03:31 +0200 fs r272126 : #i55701# +STR_SORT_BY_COL_ONLY 2009-05-20 14:02:29 +0200 fs r272125 : implement sorting 2009-05-20 10:10:19 +0200 fs r272107 : #i10000# 2009-05-19 16:02:17 +0200 fs r272089 : #i10000# 2009-05-19 16:02:02 +0200 fs r272088 : #i55701# strings for new error condition DATA_CANNOT_SELECT_UNFILTERED 2009-05-19 16:01:31 +0200 fs r272087 : #i55701# use DATA_CANNOT_SELECT_UNFILTERED as standardized error code 2009-05-19 15:59:59 +0200 fs r272086 : #i55701# +DATA_CANNOT_SELECT_UNFILTERED 2009-05-19 15:46:12 +0200 fs r272084 : #i55701# recognize the DATA_CANNOT_SELECT_UNFILTERED error condition, and allow filtering in this case, even when the result set is empty 2009-05-19 09:06:50 +0200 fs r272059 : merging changes from CWS dba32b, to prevent future conflicts with upcoming local changes 2009-05-18 21:48:58 +0200 fs r272054 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing 2009-05-18 21:48:42 +0200 fs r272053 : accessing a non-local unfiltered address book now returns an empty result set, and reports a warning, instead of ungracefully failing 2009-05-18 21:47:41 +0200 fs r272052 : +setExternalWarnings 2009-05-18 21:47:12 +0200 fs r272051 : #i55701# when re/loading the form, display any possible warnings 2009-05-18 21:43:26 +0200 fs r272050 : #i55701# implement XWarningsSupplier, exposing the warnings of our result set 2009-05-18 21:42:51 +0200 fs r272049 : #i55701# implement XWarningsSupplier, exposing the warnings of our aggregate RowSet 2009-05-18 17:53:59 +0200 fs r272041 : #i55701# moved the (I)WarningsContainer from dbaccess to connectivity, to be able to use it in the latter module, too 2009-05-18 17:24:10 +0200 fs r272040 : #i55701# properly enable the various Evolution types 2009-05-18 14:52:19 +0200 fs r272024 : #i55701# properly enable the Evolution types 2009-05-18 13:57:10 +0200 fs r272018 : fixed/extended whereAnalysis (column searching still not enabled, as neither LIKE nor = seem to work with my (somewhat older) Evolution version) 2009-05-18 13:56:08 +0200 fs r272017 : extended showParseTree 2009-05-18 13:55:25 +0200 fs r272016 : extended showParseTree 2009-05-18 11:40:16 +0200 fs r272008 : #i55701# 2009-05-18 11:39:02 +0200 fs r272006 : let the PreparedStatement return proper meta data, too 2009-05-18 10:05:37 +0200 fs r271999 : moved the XStatement interface to from OCommonStatement to OStatement - the former class is also the base for other classes which should not have this interface 2009-05-15 21:53:22 +0200 fs r271973 : collectColumnInformation: report invalid meta data as assertion 2009-05-15 21:51:40 +0200 fs r271972 : showParseTree should be const 2009-05-15 21:51:26 +0200 fs r271971 : showParseTree should be const 2009-05-15 21:51:03 +0200 fs r271970 : properly recognize the 'WHERE 0 = 1' clause, this way having proper statement meta data, this way saving much much calls from the DBA framework 2009-05-15 20:29:03 +0200 fs r271969 : cleaned up the mess with the statement classes 2009-05-15 15:51:11 +0200 fs r271944 : let the result set properly init its meta data 2009-05-15 15:29:54 +0200 fs r271939 : proper property implementations for the resultset class 2009-05-15 15:01:31 +0200 fs r271936 : proper property implementations for the statement class 2009-05-08 14:46:33 +0200 fs r271717 : component_foo must be PUBLIC 2009-05-06 09:20:05 +0200 fs r271565 : #i10000# (warnings on unxlngi6) 2009-05-06 09:01:30 +0200 fs r271564 : #i101493# 2009-05-05 23:08:12 +0200 fs r271560 : #i55701# merging the changes from the ancient (CVS-based) CWS evoab2default into this CWS here
2009-06-05 12:31:05 +00:00
#include <connectivity/warningscontainer.hxx>
#include "HelperCollections.hxx"
#include "core_resource.hxx"
migrate to boost::gettext * all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-06-11 20:56:30 +01:00
#include "strings.hrc"
2000-09-18 23:16:46 +00:00
#include <cppuhelper/queryinterface.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
2011-02-03 00:33:36 +01:00
#include <osl/diagnose.h>
2000-10-11 10:21:40 +00:00
#include <comphelper/propagg.hxx>
#include <comphelper/sequence.hxx>
2000-09-18 23:16:46 +00:00
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
#include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
2001-01-04 13:26:47 +00:00
#include <comphelper/types.hxx>
#include <comphelper/property.hxx>
#include <unotools/sharedunocomponent.hxx>
2001-02-23 14:22:32 +00:00
#include "definitioncolumn.hxx"
2001-08-30 07:07:36 +00:00
2001-08-15 12:05:15 +00:00
#include <functional>
2000-09-18 23:16:46 +00:00
2001-08-30 07:07:36 +00:00
#include "sdbcoretools.hxx"
2001-11-23 10:28:26 +00:00
#include "querycomposer.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include "ContainerMediator.hxx"
2001-08-30 07:07:36 +00:00
2000-09-18 23:16:46 +00:00
using namespace dbaccess;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb;
2000-09-18 23:16:46 +00:00
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
2000-10-11 10:21:40 +00:00
using namespace ::comphelper;
2000-09-18 23:16:46 +00:00
using namespace ::osl;
using namespace ::cppu;
using namespace ::utl;
2000-09-18 23:16:46 +00:00
namespace dbaccess
{
// OQuery
OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition
,const Reference< XConnection >& _rxConn
,const Reference< XComponentContext >& _xORB)
:OContentHelper(_xORB,nullptr,std::make_shared<OContentHelper_Impl>())
,OQueryDescriptor_Base(m_aMutex,*this)
,ODataSettings(OContentHelper::rBHelper,true)
2000-09-18 23:16:46 +00:00
,m_xCommandDefinition(_rxCommandDefinition)
,m_xConnection(_rxConn)
,m_pColumnMediator( nullptr )
,m_pWarnings( nullptr )
,m_eDoingCurrently(NONE)
2000-09-18 23:16:46 +00:00
{
registerProperties();
ODataSettings::registerPropertiesFor(this);
2000-09-18 23:16:46 +00:00
osl_atomic_increment(&m_refCount);
2011-02-03 00:33:36 +01:00
OSL_ENSURE(m_xCommandDefinition.is(), "OQuery::OQuery : invalid CommandDefinition object !");
if ( m_xCommandDefinition.is() )
2000-09-18 23:16:46 +00:00
{
try
{
::comphelper::copyProperties(_rxCommandDefinition,this);
}
catch(Exception&)
{
OSL_FAIL("OQueryDescriptor_Base::OQueryDescriptor_Base: caught an exception!");
}
m_xCommandDefinition->addPropertyChangeListener(OUString(), this);
// m_xCommandDefinition->addPropertyChangeListener(PROPERTY_NAME, this);
2001-03-02 09:24:52 +00:00
m_xCommandPropInfo = m_xCommandDefinition->getPropertySetInfo();
2000-09-18 23:16:46 +00:00
}
2011-02-03 00:33:36 +01:00
OSL_ENSURE(m_xConnection.is(), "OQuery::OQuery : invalid connection !");
osl_atomic_decrement(&m_refCount);
2001-08-30 07:07:36 +00:00
}
OQuery::~OQuery()
{
2000-09-18 23:16:46 +00:00
}
css::uno::Sequence<sal_Int8> OQuery::getImplementationId()
{
return css::uno::Sequence<sal_Int8>();
}
IMPLEMENT_GETTYPES3(OQuery,OQueryDescriptor_Base,ODataSettings,OContentHelper);
IMPLEMENT_FORWARD_XINTERFACE3( OQuery,OContentHelper,OQueryDescriptor_Base,ODataSettings)
void OQuery::rebuildColumns()
2000-09-18 23:16:46 +00:00
{
OSL_PRECOND( getColumnCount() == 0, "OQuery::rebuildColumns: column container should be empty!" );
// the base class' definition of rebuildColumns promised that clearColumns is called before rebuildColumns
2001-08-30 07:07:36 +00:00
try
2000-09-18 23:16:46 +00:00
{
m_pColumnMediator = nullptr;
Reference<XColumnsSupplier> xColSup(m_xCommandDefinition,UNO_QUERY);
Reference< XNameAccess > xColumnDefinitions;
if ( xColSup.is() )
{
xColumnDefinitions = xColSup->getColumns();
if ( xColumnDefinitions.is() )
m_pColumnMediator = new OContainerMediator( m_pColumns, xColumnDefinitions );
}
2000-09-18 23:16:46 +00:00
2001-08-30 07:07:36 +00:00
// fill the columns with columns from the statement
Reference< XMultiServiceFactory > xFactory( m_xConnection, UNO_QUERY_THROW );
SharedUNOComponent< XSingleSelectQueryComposer, DisposableComponent > xComposer(
Reference< XSingleSelectQueryComposer >( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ) );
Reference< XNameAccess > xColumns;
Reference< XIndexAccess > xColumnsIndexed;
try
2001-11-23 10:28:26 +00:00
{
xComposer->setQuery( m_sCommand );
Reference< XColumnsSupplier > xCols( xComposer, UNO_QUERY_THROW );
xColumns.set( xCols->getColumns(), UNO_QUERY_THROW );
xColumnsIndexed.set( xColumns, UNO_QUERY_THROW );
}
catch( const SQLException& ) { }
SharedUNOComponent< XPreparedStatement, DisposableComponent > xPreparedStatement;
if ( !xColumns.is() || ( xColumnsIndexed->getCount() == 0 ) )
{ // the QueryComposer could not parse it. Try a lean version.
xPreparedStatement.set( m_xConnection->prepareStatement( m_sCommand ), UNO_QUERY_THROW );
Reference< XResultSetMetaDataSupplier > xResMetaDataSup( xPreparedStatement, UNO_QUERY_THROW );
Reference< XResultSetMetaData > xResultSetMeta( xResMetaDataSup->getMetaData() );
if ( !xResultSetMeta.is() )
2001-11-23 10:28:26 +00:00
{
OUString sError( DBA_RES( RID_STR_STATEMENT_WITHOUT_RESULT_SET ) );
::dbtools::throwSQLException( sError, StandardSQLState::GENERAL_ERROR, *this );
2001-11-23 10:28:26 +00:00
}
Reference< XDatabaseMetaData > xDBMeta( m_xConnection->getMetaData(), UNO_QUERY_THROW );
2010-10-15 12:22:54 -05:00
::rtl::Reference< OSQLColumns > aParseColumns(
::connectivity::parse::OParseColumn::createColumnsForResultSet( xResultSetMeta, xDBMeta,xColumnDefinitions ) );
xColumns = OPrivateColumns::createWithIntrinsicNames(
aParseColumns, xDBMeta->supportsMixedCaseQuotedIdentifiers(), *this, m_aMutex );
if ( !xColumns.is() )
throw RuntimeException();
2001-11-23 10:28:26 +00:00
}
Sequence< OUString> aNames = xColumns->getElementNames();
const OUString* pIter = aNames.getConstArray();
const OUString* pEnd = pIter + aNames.getLength();
for ( sal_Int32 i = 0;pIter != pEnd; ++pIter,++i)
{
Reference<XPropertySet> xSource(xColumns->getByName( *pIter ),UNO_QUERY);
OUString sLabel = *pIter;
if ( xColumnDefinitions.is() && xColumnDefinitions->hasByName(*pIter) )
{
Reference<XPropertySet> xCommandColumn(xColumnDefinitions->getByName( *pIter ),UNO_QUERY);
xCommandColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel;
}
OQueryColumn* pColumn = new OQueryColumn( xSource, m_xConnection, sLabel);
Reference< XChild > xChild( *pColumn, UNO_QUERY_THROW );
xChild->setParent( *this );
2001-08-30 07:07:36 +00:00
implAppendColumn( *pIter, pColumn );
Reference< XPropertySet > xDest( *pColumn, UNO_QUERY_THROW );
if ( m_pColumnMediator.is() )
m_pColumnMediator->notifyElementCreated( *pIter, xDest );
}
2000-09-18 23:16:46 +00:00
}
2001-08-30 07:07:36 +00:00
catch( const SQLContext& e )
{
if ( m_pWarnings )
m_pWarnings->appendWarning( e );
}
catch( const SQLWarning& e )
{
if ( m_pWarnings )
m_pWarnings->appendWarning( e );
}
catch( const SQLException& e )
{
if ( m_pWarnings )
m_pWarnings->appendWarning( e );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
2001-08-30 07:07:36 +00:00
}
}
2000-09-18 23:16:46 +00:00
// XServiceInfo
IMPLEMENT_SERVICE_INFO3(OQuery, "com.sun.star.sdb.dbaccess.OQuery", SERVICE_SDB_DATASETTINGS, SERVICE_SDB_QUERY, "com.sun.star.sdb.QueryDefinition")
2000-09-18 23:16:46 +00:00
// css::beans::XPropertyChangeListener
void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource )
2000-09-18 23:16:46 +00:00
{
sal_Int32 nOwnHandle = -1;
{
MutexGuard aGuard(m_aMutex);
2011-02-03 00:33:36 +01:00
OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(),
2001-08-30 07:07:36 +00:00
"OQuery::propertyChange : where did this call come from ?");
2000-09-18 23:16:46 +00:00
if (m_eDoingCurrently == SETTING_PROPERTIES)
// we're setting the property ourself, so we will do the necessary notifications later
2000-09-18 23:16:46 +00:00
return;
// forward this to our own member holding a copy of the property value
if (getArrayHelper()->hasPropertyByName(_rSource.PropertyName))
{
Property aOwnProp = getArrayHelper()->getPropertyByName(_rSource.PropertyName);
nOwnHandle = aOwnProp.Handle;
ODataSettings::setFastPropertyValue_NoBroadcast(nOwnHandle, _rSource.NewValue);
2000-09-18 23:16:46 +00:00
// don't use our own setFastPropertyValue_NoBroadcast, this would forward it to the CommandSettings,
// again
// and don't use the "real" setPropertyValue, this is to expensive and not sure to succeed
}
else
{
2011-02-25 17:47:41 +01:00
OSL_FAIL("OQuery::propertyChange : my CommandDefinition has more properties than I do !");
2000-09-18 23:16:46 +00:00
}
}
fire(&nOwnHandle, &_rSource.NewValue, &_rSource.OldValue, 1, false);
2000-09-18 23:16:46 +00:00
}
void SAL_CALL OQuery::disposing( const EventObject& _rSource )
2000-09-18 23:16:46 +00:00
{
MutexGuard aGuard(m_aMutex);
2011-02-03 00:33:36 +01:00
OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(),
2001-08-30 07:07:36 +00:00
"OQuery::disposing : where did this call come from ?");
2000-09-18 23:16:46 +00:00
m_xCommandDefinition->removePropertyChangeListener(OUString(), this);
m_xCommandDefinition = nullptr;
2000-09-18 23:16:46 +00:00
}
// XDataDescriptorFactory
Reference< XPropertySet > SAL_CALL OQuery::createDataDescriptor( )
2000-09-18 23:16:46 +00:00
{
return new OQueryDescriptor(*this);
}
// pseudo-XComponent
void SAL_CALL OQuery::disposing()
2000-09-18 23:16:46 +00:00
{
MutexGuard aGuard(m_aMutex);
if (m_xCommandDefinition.is())
{
m_xCommandDefinition->removePropertyChangeListener(OUString(), this);
m_xCommandDefinition = nullptr;
2000-09-18 23:16:46 +00:00
}
disposeColumns();
m_pWarnings = nullptr;
2000-09-18 23:16:46 +00:00
}
void OQuery::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue )
2000-09-18 23:16:46 +00:00
{
ODataSettings::setFastPropertyValue_NoBroadcast(_nHandle, _rValue);
OUString sAggPropName;
2001-01-04 13:26:47 +00:00
sal_Int16 nAttr = 0;
2001-03-02 09:24:52 +00:00
if (getInfoHelper().fillPropertyMembersByHandle(&sAggPropName,&nAttr,_nHandle) &&
m_xCommandPropInfo.is() &&
m_xCommandPropInfo->hasPropertyByName(sAggPropName))
2000-09-18 23:16:46 +00:00
{ // the base class holds the property values itself, but we have to forward this to our CommandDefinition
2001-03-02 09:24:52 +00:00
2000-09-18 23:16:46 +00:00
m_eDoingCurrently = SETTING_PROPERTIES;
OAutoActionReset aAutoReset(*this);
2000-09-18 23:16:46 +00:00
m_xCommandDefinition->setPropertyValue(sAggPropName, _rValue);
if ( PROPERTY_ID_COMMAND == _nHandle )
// the columns are out of date if we are based on a new statement ....
2001-08-30 07:07:36 +00:00
setColumnsOutOfDate();
2000-09-18 23:16:46 +00:00
}
}
Reference< XPropertySetInfo > SAL_CALL OQuery::getPropertySetInfo( )
2000-09-18 23:16:46 +00:00
{
return createPropertySetInfo( getInfoHelper() ) ;
}
2001-08-30 07:07:36 +00:00
::cppu::IPropertyArrayHelper& OQuery::getInfoHelper()
2000-09-18 23:16:46 +00:00
{
return *getArrayHelper();
}
::cppu::IPropertyArrayHelper* OQuery::createArrayHelper( ) const
{
Sequence< Property > aProps;
// our own props
describeProperties(aProps);
return new ::cppu::OPropertyArrayHelper(aProps);
}
OColumn* OQuery::createColumn(const OUString& /*_rName*/) const
2001-02-23 14:22:32 +00:00
{
return nullptr;
2001-02-23 14:22:32 +00:00
}
void SAL_CALL OQuery::rename( const OUString& newName )
{
MutexGuard aGuard(m_aMutex);
Reference<XRename> xRename(m_xCommandDefinition,UNO_QUERY);
OSL_ENSURE(xRename.is(),"No XRename interface!");
if(xRename.is())
xRename->rename(newName);
}
void OQuery::registerProperties()
{
// the properties which OCommandBase supplies (it has no own registration, as it's not derived from
// a OPropertyStateContainer)
registerProperty(PROPERTY_NAME, PROPERTY_ID_NAME, PropertyAttribute::BOUND|PropertyAttribute::CONSTRAINED,
&m_sElementName, cppu::UnoType<decltype(m_sElementName)>::get());
registerProperty(PROPERTY_COMMAND, PROPERTY_ID_COMMAND, PropertyAttribute::BOUND,
&m_sCommand, cppu::UnoType<decltype(m_sCommand)>::get());
registerProperty(PROPERTY_ESCAPE_PROCESSING, PROPERTY_ID_ESCAPE_PROCESSING, PropertyAttribute::BOUND,
&m_bEscapeProcessing, cppu::UnoType<bool>::get());
registerProperty(PROPERTY_UPDATE_TABLENAME, PROPERTY_ID_UPDATE_TABLENAME, PropertyAttribute::BOUND,
&m_sUpdateTableName, cppu::UnoType<decltype(m_sUpdateTableName)>::get());
registerProperty(PROPERTY_UPDATE_SCHEMANAME, PROPERTY_ID_UPDATE_SCHEMANAME, PropertyAttribute::BOUND,
&m_sUpdateSchemaName, cppu::UnoType<decltype(m_sUpdateSchemaName)>::get());
registerProperty(PROPERTY_UPDATE_CATALOGNAME, PROPERTY_ID_UPDATE_CATALOGNAME, PropertyAttribute::BOUND,
&m_sUpdateCatalogName, cppu::UnoType<decltype(m_sUpdateCatalogName)>::get());
registerProperty(PROPERTY_LAYOUTINFORMATION, PROPERTY_ID_LAYOUTINFORMATION, PropertyAttribute::BOUND,
&m_aLayoutInformation, cppu::UnoType<decltype(m_aLayoutInformation)>::get());
}
2001-08-30 07:07:36 +00:00
OUString OQuery::determineContentType() const
CWS-TOOLING: integrate CWS dba31d 2008-12-08 16:22:07 +0100 rt r265005 : Remove DOS lineends 2008-12-05 13:56:24 +0100 fs r264906 : #i10000# removed unreachable statement 2008-11-20 11:41:26 +0100 fs r264037 : merged in the fix for #i95865# (it was wrongly committed to CWS dba32a, should have been here) 2008-11-20 11:34:24 +0100 fs r264036 : line ends 2008-11-14 08:44:50 +0100 lla r263665 : #i10000# comparsion between int and uint fixed 2008-11-13 13:31:12 +0100 lla r263641 : #i10000# build problem fixed 2008-11-13 11:20:01 +0100 lla r263625 : #i96130# hard code name of extension 2008-11-12 11:13:41 +0100 fs r263582 : #i96096# when opening a SRB-report fails due to the missing SRB extension, log this as warning only, and proceed with the migration 2008-11-12 11:11:35 +0100 fs r263581 : #i96096# ContentType handling. Now all contents deliver proper results in XContent::getContentType 2008-11-12 11:10:11 +0100 fs r263580 : #i96096# new ctors taking UNO_QUERY_THROW 2008-11-11 10:10:13 +0100 lla r263546 : CWS-TOOLING: rebase CWS dba31d to trunk@263288 (milestone: DEV300:m35) 2008-11-06 15:55:39 +0100 oj r263393 : #i93452# get field from model fallbackis the name 2008-11-06 15:31:47 +0100 oj r263392 : #i93465# remeber location of floating windows 2008-11-06 13:36:24 +0100 oj r263381 : #i93450# check typemap for null 2008-11-06 13:28:49 +0100 oj r263379 : #i93020# empty column list boxes when new relation should be created 2008-11-06 12:33:53 +0100 oj r263377 : #i93012# set border to default : flat 2008-11-06 12:26:54 +0100 oj r263375 : #i74927# do some less calls for odbc 2008-11-06 09:34:01 +0100 oj r263362 : #i93383# grabFocus in suspend to get allmodified cells 2008-11-03 21:01:39 +0100 oj r263308 : #i86739# check if slash can be valid for tables 2008-11-03 14:40:21 +0100 oj r263287 : #i86739# check if slash can be valid for tables 2008-11-03 14:32:17 +0100 oj r263286 : #i95227# column width 2008-11-03 14:27:26 +0100 oj r263285 : link fwe 2008-11-03 14:24:54 +0100 oj r263284 : #i95235# changed to hold no ref only weak 2008-10-31 11:21:48 +0100 oj r262859 : #i93459# set images add menu entry 2008-10-31 09:06:37 +0100 oj r262851 : #i88629# correct fileopen filter for database odb files 2008-10-30 15:01:04 +0100 oj r262828 : #i95229# set filter at the composer 2008-10-29 15:57:41 +0100 oj r262817 : #i95235# changed to hold no ref only weak 2008-10-29 15:57:19 +0100 oj r262816 : #i95235# changed to hold no ref only weak 2008-10-29 15:57:03 +0100 oj r262815 : #i95235# changed to hold no ref only weak 2008-10-29 15:56:15 +0100 oj r262814 : #i95235# filtermanger changed to hold no ref only weak 2008-10-29 10:32:39 +0100 oj r262773 : #i93474# use correct table name 2008-10-28 13:49:33 +0100 lla r262744 : #i95524# make an Invalidate and refresh on Tables 2008-10-28 10:45:02 +0100 fs r262707 : line ends 2008-10-28 10:34:42 +0100 fs r262706 : #i95522# don't expect the component to live in a TopWindow 2008-10-28 08:30:40 +0100 lla r262696 : #i93176# set preview mode on view 2008-10-28 07:56:57 +0100 oj r262694 : merge cvs svn 2008-10-27 14:13:51 +0100 oj r262673 : #i94129# use dummy data 2008-10-27 12:38:45 +0100 fs r262669 : #i94125# rework ScrollColumns 2008-10-23 15:53:57 +0200 oj r262624 : #i94568# do not load the embeddedobj just copy the storage 2008-10-23 14:39:14 +0200 oj r262622 : #i94129# handle chart correctly 2008-10-22 10:51:19 +0200 lla r262582 : #i94115# problem with left walk chart shape fixed 2008-10-22 07:47:48 +0200 oj r262576 : #i94455# rename now do not use remove insert 2008-10-22 07:47:27 +0200 oj r262575 : #i94455# rename now do not use remove insert 2008-10-21 12:46:26 +0200 lla r262567 : #i93845# extra check if default schema doesn't exists, fix assertion
2008-12-09 07:25:38 +00:00
{
return OUString( "application/vnd.org.openoffice.DatabaseQuery" );
CWS-TOOLING: integrate CWS dba31d 2008-12-08 16:22:07 +0100 rt r265005 : Remove DOS lineends 2008-12-05 13:56:24 +0100 fs r264906 : #i10000# removed unreachable statement 2008-11-20 11:41:26 +0100 fs r264037 : merged in the fix for #i95865# (it was wrongly committed to CWS dba32a, should have been here) 2008-11-20 11:34:24 +0100 fs r264036 : line ends 2008-11-14 08:44:50 +0100 lla r263665 : #i10000# comparsion between int and uint fixed 2008-11-13 13:31:12 +0100 lla r263641 : #i10000# build problem fixed 2008-11-13 11:20:01 +0100 lla r263625 : #i96130# hard code name of extension 2008-11-12 11:13:41 +0100 fs r263582 : #i96096# when opening a SRB-report fails due to the missing SRB extension, log this as warning only, and proceed with the migration 2008-11-12 11:11:35 +0100 fs r263581 : #i96096# ContentType handling. Now all contents deliver proper results in XContent::getContentType 2008-11-12 11:10:11 +0100 fs r263580 : #i96096# new ctors taking UNO_QUERY_THROW 2008-11-11 10:10:13 +0100 lla r263546 : CWS-TOOLING: rebase CWS dba31d to trunk@263288 (milestone: DEV300:m35) 2008-11-06 15:55:39 +0100 oj r263393 : #i93452# get field from model fallbackis the name 2008-11-06 15:31:47 +0100 oj r263392 : #i93465# remeber location of floating windows 2008-11-06 13:36:24 +0100 oj r263381 : #i93450# check typemap for null 2008-11-06 13:28:49 +0100 oj r263379 : #i93020# empty column list boxes when new relation should be created 2008-11-06 12:33:53 +0100 oj r263377 : #i93012# set border to default : flat 2008-11-06 12:26:54 +0100 oj r263375 : #i74927# do some less calls for odbc 2008-11-06 09:34:01 +0100 oj r263362 : #i93383# grabFocus in suspend to get allmodified cells 2008-11-03 21:01:39 +0100 oj r263308 : #i86739# check if slash can be valid for tables 2008-11-03 14:40:21 +0100 oj r263287 : #i86739# check if slash can be valid for tables 2008-11-03 14:32:17 +0100 oj r263286 : #i95227# column width 2008-11-03 14:27:26 +0100 oj r263285 : link fwe 2008-11-03 14:24:54 +0100 oj r263284 : #i95235# changed to hold no ref only weak 2008-10-31 11:21:48 +0100 oj r262859 : #i93459# set images add menu entry 2008-10-31 09:06:37 +0100 oj r262851 : #i88629# correct fileopen filter for database odb files 2008-10-30 15:01:04 +0100 oj r262828 : #i95229# set filter at the composer 2008-10-29 15:57:41 +0100 oj r262817 : #i95235# changed to hold no ref only weak 2008-10-29 15:57:19 +0100 oj r262816 : #i95235# changed to hold no ref only weak 2008-10-29 15:57:03 +0100 oj r262815 : #i95235# changed to hold no ref only weak 2008-10-29 15:56:15 +0100 oj r262814 : #i95235# filtermanger changed to hold no ref only weak 2008-10-29 10:32:39 +0100 oj r262773 : #i93474# use correct table name 2008-10-28 13:49:33 +0100 lla r262744 : #i95524# make an Invalidate and refresh on Tables 2008-10-28 10:45:02 +0100 fs r262707 : line ends 2008-10-28 10:34:42 +0100 fs r262706 : #i95522# don't expect the component to live in a TopWindow 2008-10-28 08:30:40 +0100 lla r262696 : #i93176# set preview mode on view 2008-10-28 07:56:57 +0100 oj r262694 : merge cvs svn 2008-10-27 14:13:51 +0100 oj r262673 : #i94129# use dummy data 2008-10-27 12:38:45 +0100 fs r262669 : #i94125# rework ScrollColumns 2008-10-23 15:53:57 +0200 oj r262624 : #i94568# do not load the embeddedobj just copy the storage 2008-10-23 14:39:14 +0200 oj r262622 : #i94129# handle chart correctly 2008-10-22 10:51:19 +0200 lla r262582 : #i94115# problem with left walk chart shape fixed 2008-10-22 07:47:48 +0200 oj r262576 : #i94455# rename now do not use remove insert 2008-10-22 07:47:27 +0200 oj r262575 : #i94455# rename now do not use remove insert 2008-10-21 12:46:26 +0200 lla r262567 : #i93845# extra check if default schema doesn't exists, fix assertion
2008-12-09 07:25:38 +00:00
}
} // namespace dbaccess
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */