calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / dbaccess / source / core / dataaccess / connection.cxx
blob144b3936630a5d609177e6751d6680481ded07ff
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/config.h>
22 #include <iterator>
24 #include "connection.hxx"
25 #include "datasource.hxx"
26 #include <strings.hrc>
27 #include <strings.hxx>
28 #include <core_resource.hxx>
29 #include <statement.hxx>
30 #include <preparedstatement.hxx>
31 #include <callablestatement.hxx>
32 #include <SingleSelectQueryComposer.hxx>
33 #include <querycomposer.hxx>
35 #include <com/sun/star/lang/NoSupportException.hpp>
36 #include <com/sun/star/sdb/CommandType.hpp>
37 #include <com/sun/star/sdb/tools/ConnectionTools.hpp>
38 #include <com/sun/star/reflection/ProxyFactory.hpp>
39 #include <com/sun/star/beans/NamedValue.hpp>
40 #include <connectivity/dbtools.hxx>
41 #include <connectivity/dbmetadata.hxx>
42 #include <comphelper/diagnose_ex.hxx>
43 #include <osl/diagnose.h>
44 #include <comphelper/sequence.hxx>
45 #include <comphelper/types.hxx>
46 #include <cppuhelper/supportsservice.hxx>
48 using namespace ::com::sun::star::uno;
49 using namespace ::com::sun::star::lang;
50 using namespace ::com::sun::star::util;
51 using namespace ::com::sun::star::sdb;
52 using namespace ::com::sun::star::sdb::application;
53 using namespace ::com::sun::star::sdbc;
54 using namespace ::com::sun::star::sdbcx;
55 using namespace ::com::sun::star::beans;
56 using namespace ::com::sun::star::reflection;
57 using namespace ::com::sun::star::container;
58 using namespace ::com::sun::star::graphic;
59 using namespace ::osl;
60 using namespace ::comphelper;
61 using namespace ::cppu;
62 using namespace ::dbtools;
64 using ::com::sun::star::sdb::tools::XTableName;
65 using ::com::sun::star::sdb::tools::XObjectNames;
66 using ::com::sun::star::sdb::tools::XDataSourceMetaData;
68 namespace dbaccess
71 // XServiceInfo
72 OUString OConnection::getImplementationName( )
74 return "com.sun.star.comp.dbaccess.Connection";
77 sal_Bool OConnection::supportsService( const OUString& _rServiceName )
79 return cppu::supportsService(this, _rServiceName);
82 Sequence< OUString > OConnection::getSupportedServiceNames( )
84 Sequence< OUString > aSupported = OConnectionWrapper::getSupportedServiceNames();
86 if ( comphelper::findValue( aSupported, SERVICE_SDB_CONNECTION ) == -1 )
88 sal_Int32 nLen = aSupported.getLength();
89 aSupported.realloc( nLen + 1 );
90 aSupported.getArray()[ nLen ] = SERVICE_SDB_CONNECTION;
93 return aSupported;
96 // XCloseable
97 void OConnection::close()
99 // being closed is the same as being disposed
100 dispose();
103 sal_Bool OConnection::isClosed()
105 MutexGuard aGuard(m_aMutex);
106 return !m_xMasterConnection.is();
109 // XConnection
110 Reference< XStatement > OConnection::createStatement()
112 MutexGuard aGuard(m_aMutex);
113 checkDisposed();
115 Reference< XStatement > xStatement;
116 Reference< XStatement > xMasterStatement = m_xMasterConnection->createStatement();
117 if ( xMasterStatement.is() )
119 xStatement = new OStatement(this, xMasterStatement);
120 m_aStatements.emplace_back(xStatement);
122 return xStatement;
125 Reference< XPreparedStatement > OConnection::prepareStatement(const OUString& sql)
127 MutexGuard aGuard(m_aMutex);
128 checkDisposed();
130 // TODO convert the SQL to SQL the driver understands
131 Reference< XPreparedStatement > xStatement;
132 Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareStatement(sql);
133 if ( xMasterStatement.is() )
135 xStatement = new OPreparedStatement(this, xMasterStatement);
136 m_aStatements.emplace_back(xStatement);
138 return xStatement;
141 Reference< XPreparedStatement > OConnection::prepareCall(const OUString& sql)
143 MutexGuard aGuard(m_aMutex);
144 checkDisposed();
146 Reference< XPreparedStatement > xStatement;
147 Reference< XPreparedStatement > xMasterStatement = m_xMasterConnection->prepareCall(sql);
148 if ( xMasterStatement.is() )
150 xStatement = new OCallableStatement(this, xMasterStatement);
151 m_aStatements.emplace_back(xStatement);
153 return xStatement;
156 OUString OConnection::nativeSQL(const OUString& sql)
158 MutexGuard aGuard(m_aMutex);
159 checkDisposed();
160 return m_xMasterConnection->nativeSQL(sql);
163 void OConnection::setAutoCommit(sal_Bool autoCommit)
165 MutexGuard aGuard(m_aMutex);
166 checkDisposed();
167 m_xMasterConnection->setAutoCommit(autoCommit);
170 sal_Bool OConnection::getAutoCommit()
172 MutexGuard aGuard(m_aMutex);
173 checkDisposed();
174 return m_xMasterConnection->getAutoCommit();
177 void OConnection::commit()
179 MutexGuard aGuard(m_aMutex);
180 checkDisposed();
181 m_xMasterConnection->commit();
184 void OConnection::rollback()
186 MutexGuard aGuard(m_aMutex);
187 checkDisposed();
188 m_xMasterConnection->rollback();
191 Reference< XDatabaseMetaData > OConnection::getMetaData()
193 MutexGuard aGuard(m_aMutex);
194 checkDisposed();
195 return m_xMasterConnection->getMetaData();
198 void OConnection::setReadOnly(sal_Bool readOnly)
200 MutexGuard aGuard(m_aMutex);
201 checkDisposed();
202 m_xMasterConnection->setReadOnly(readOnly);
205 sal_Bool OConnection::isReadOnly()
207 MutexGuard aGuard(m_aMutex);
208 checkDisposed();
209 return m_xMasterConnection->isReadOnly();
212 void OConnection::setCatalog(const OUString& catalog)
214 MutexGuard aGuard(m_aMutex);
215 checkDisposed();
216 m_xMasterConnection->setCatalog(catalog);
219 OUString OConnection::getCatalog()
221 MutexGuard aGuard(m_aMutex);
222 checkDisposed();
223 return m_xMasterConnection->getCatalog();
226 void OConnection::setTransactionIsolation(sal_Int32 level)
228 MutexGuard aGuard(m_aMutex);
229 checkDisposed();
230 m_xMasterConnection->setTransactionIsolation(level);
233 sal_Int32 OConnection::getTransactionIsolation()
235 MutexGuard aGuard(m_aMutex);
236 checkDisposed();
237 return m_xMasterConnection->getTransactionIsolation();
240 Reference< XNameAccess > OConnection::getTypeMap()
242 MutexGuard aGuard(m_aMutex);
243 checkDisposed();
244 return m_xMasterConnection->getTypeMap();
247 void OConnection::setTypeMap(const Reference< XNameAccess > & typeMap)
249 MutexGuard aGuard(m_aMutex);
250 checkDisposed();
251 m_xMasterConnection->setTypeMap(typeMap);
254 // OConnection
256 OConnection::OConnection(ODatabaseSource& _rDB
257 , Reference< XConnection > const & _rxMaster
258 , const Reference< XComponentContext >& _rxORB)
259 :OSubComponent(m_aMutex, static_cast< OWeakObject* >(&_rDB))
260 // as the queries reroute their refcounting to us, this m_aMutex is okey. If the queries
261 // container would do its own refcounting, it would have to acquire m_pMutex
262 // same for tables
263 ,m_aTableFilter(_rDB.m_pImpl->m_aTableFilter)
264 ,m_aTableTypeFilter(_rDB.m_pImpl->m_aTableTypeFilter)
265 ,m_aContext( _rxORB )
266 ,m_xMasterConnection(_rxMaster)
267 ,m_aWarnings( Reference< XWarningsSupplier >( _rxMaster, UNO_QUERY ) )
268 ,m_nInAppend(0)
269 ,m_bSupportsViews(false)
270 ,m_bSupportsUsers(false)
271 ,m_bSupportsGroups(false)
273 osl_atomic_increment(&m_refCount);
277 Reference< XProxyFactory > xProxyFactory = ProxyFactory::create( m_aContext );
278 Reference<XAggregation> xAgg = xProxyFactory->createProxy(_rxMaster);
279 setDelegation(xAgg,m_refCount);
280 OSL_ENSURE(m_xConnection.is(), "OConnection::OConnection : invalid master connection !");
282 catch(const Exception&)
284 DBG_UNHANDLED_EXCEPTION("dbaccess");
287 m_xTableUIProvider.set(m_xMasterConnection, css::uno::UNO_QUERY);
291 m_xQueries = OQueryContainer::create(Reference< XNameContainer >(_rDB.getQueryDefinitions(), UNO_QUERY), this, _rxORB, &m_aWarnings).get();
293 bool bCase = true;
294 Reference<XDatabaseMetaData> xMeta;
297 xMeta = getMetaData();
298 bCase = xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers();
300 catch(const SQLException&)
303 Reference< XNameContainer > xTableDefinitions(_rDB.getTables(),UNO_QUERY);
304 m_pTables.reset( new OTableContainer( *this, m_aMutex, this, bCase, xTableDefinitions, this, m_nInAppend ) );
306 // check if we support types
307 if ( xMeta.is() )
309 Reference<XResultSet> xRes = xMeta->getTableTypes();
310 if(xRes.is())
312 Reference<XRow> xRow(xRes,UNO_QUERY);
313 while(xRes->next())
315 OUString sValue = xRow->getString(1);
316 if( !xRow->wasNull() && sValue == "VIEW")
318 m_bSupportsViews = true;
319 break;
323 // some dbs don't support this type so we should ask if a XViewsSupplier is supported
324 if(!m_bSupportsViews)
326 Reference< XViewsSupplier > xMaster(getMasterTables(),UNO_QUERY);
328 if (xMaster.is() && xMaster->getViews().is())
329 m_bSupportsViews = true;
331 if(m_bSupportsViews)
333 m_pViews.reset( new OViewContainer(*this, m_aMutex, this, bCase, this, m_nInAppend) );
334 m_pViews->addContainerListener(m_pTables.get());
335 m_pTables->addContainerListener(m_pViews.get());
337 m_bSupportsUsers = Reference< XUsersSupplier> (getMasterTables(),UNO_QUERY).is();
338 m_bSupportsGroups = Reference< XGroupsSupplier> (getMasterTables(),UNO_QUERY).is();
340 impl_checkTableQueryNames_nothrow();
343 catch(const Exception& )
345 DBG_UNHANDLED_EXCEPTION("dbaccess");
347 osl_atomic_decrement( &m_refCount );
350 OConnection::~OConnection()
354 // XWarningsSupplier
355 Any SAL_CALL OConnection::getWarnings()
357 MutexGuard aGuard(m_aMutex);
358 checkDisposed();
359 return m_aWarnings.getWarnings();
362 void SAL_CALL OConnection::clearWarnings( )
364 MutexGuard aGuard(m_aMutex);
365 checkDisposed();
366 m_aWarnings.clearWarnings();
369 namespace
371 struct CompareTypeByName
373 bool operator() ( const Type& _rLHS, const Type& _rRHS ) const
375 return _rLHS.getTypeName() < _rRHS.getTypeName();
378 typedef std::set< Type, CompareTypeByName > TypeBag;
380 void lcl_copyTypes( TypeBag& _out_rTypes, const Sequence< Type >& _rTypes )
382 std::copy( _rTypes.begin(), _rTypes.end(),
383 std::insert_iterator< TypeBag >( _out_rTypes, _out_rTypes.begin() ) );
387 // css::lang::XTypeProvider
388 Sequence< Type > OConnection::getTypes()
390 TypeBag aNormalizedTypes;
392 lcl_copyTypes( aNormalizedTypes, OSubComponent::getTypes() );
393 lcl_copyTypes( aNormalizedTypes, OConnection_Base::getTypes() );
394 lcl_copyTypes( aNormalizedTypes, ::connectivity::OConnectionWrapper::getTypes() );
396 if ( !m_bSupportsViews )
397 aNormalizedTypes.erase( cppu::UnoType<XViewsSupplier>::get() );
398 if ( !m_bSupportsUsers )
399 aNormalizedTypes.erase( cppu::UnoType<XUsersSupplier>::get() );
400 if ( !m_bSupportsGroups )
401 aNormalizedTypes.erase( cppu::UnoType<XGroupsSupplier>::get() );
403 return comphelper::containerToSequence(aNormalizedTypes);
406 Sequence< sal_Int8 > OConnection::getImplementationId()
408 return css::uno::Sequence<sal_Int8>();
411 // css::uno::XInterface
412 Any OConnection::queryInterface( const Type & rType )
414 if ( !m_bSupportsViews && rType.equals( cppu::UnoType<XViewsSupplier>::get() ) )
415 return Any();
416 else if ( !m_bSupportsUsers && rType.equals( cppu::UnoType<XUsersSupplier>::get() ) )
417 return Any();
418 else if ( !m_bSupportsGroups && rType.equals( cppu::UnoType<XGroupsSupplier>::get() ) )
419 return Any();
420 Any aReturn = OSubComponent::queryInterface( rType );
421 if (!aReturn.hasValue())
423 aReturn = OConnection_Base::queryInterface( rType );
424 if (!aReturn.hasValue())
425 aReturn = OConnectionWrapper::queryInterface( rType );
427 return aReturn;
430 void OConnection::acquire() noexcept
432 // include this one when you want to see who calls it (call graph)
433 OSubComponent::acquire();
436 void OConnection::release() noexcept
438 // include this one when you want to see who calls it (call graph)
439 OSubComponent::release();
442 // OSubComponent
443 void OConnection::disposing()
445 MutexGuard aGuard(m_aMutex);
447 OSubComponent::disposing();
448 OConnectionWrapper::disposing();
450 for (auto const& statement : m_aStatements)
452 Reference<XComponent> xComp(statement.get(),UNO_QUERY);
453 ::comphelper::disposeComponent(xComp);
455 m_aStatements.clear();
456 m_xMasterTables = nullptr;
458 if(m_pTables)
459 m_pTables->dispose();
460 if(m_pViews)
461 m_pViews->dispose();
463 ::comphelper::disposeComponent(m_xQueries);
465 for (auto const& composer : m_aComposers)
467 Reference<XComponent> xComp(composer.get(),UNO_QUERY);
468 ::comphelper::disposeComponent(xComp);
471 m_aComposers.clear();
475 if (m_xMasterConnection.is())
476 m_xMasterConnection->close();
478 catch(const Exception&)
481 m_xMasterConnection = nullptr;
484 // XChild
485 Reference< XInterface > OConnection::getParent()
487 MutexGuard aGuard(m_aMutex);
488 checkDisposed();
489 return m_xParent;
492 void OConnection::setParent(const Reference< XInterface > & /*Parent*/)
494 throw NoSupportException();
497 // XSQLQueryComposerFactory
498 Reference< XSQLQueryComposer > OConnection::createQueryComposer()
500 MutexGuard aGuard(m_aMutex);
501 checkDisposed();
503 // Reference< XNumberFormatsSupplier > xSupplier = pParent->getNumberFormatsSupplier();
504 Reference< XSQLQueryComposer > xComposer( new OQueryComposer( this ) );
505 m_aComposers.emplace_back(xComposer);
506 return xComposer;
509 void OConnection::impl_fillTableFilter()
511 Reference<XPropertySet> xProp(getParent(),UNO_QUERY);
512 if ( xProp.is() )
514 xProp->getPropertyValue(PROPERTY_TABLEFILTER) >>= m_aTableFilter;
515 xProp->getPropertyValue(PROPERTY_TABLETYPEFILTER) >>= m_aTableTypeFilter;
519 void OConnection::refresh(const Reference< XNameAccess >& _rToBeRefreshed)
521 if ( _rToBeRefreshed == Reference< XNameAccess >(m_pTables.get()) )
523 if (m_pTables && !m_pTables->isInitialized())
525 impl_fillTableFilter();
526 // check if our "master connection" can supply tables
527 getMasterTables();
529 if (m_xMasterTables.is() && m_xMasterTables->getTables().is())
530 { // yes -> wrap them
531 m_pTables->construct(m_xMasterTables->getTables(),m_aTableFilter, m_aTableTypeFilter);
533 else
534 { // no -> use an own container
535 m_pTables->construct(m_aTableFilter, m_aTableTypeFilter);
539 else if ( _rToBeRefreshed == Reference< XNameAccess >(m_pViews.get()) )
541 if (m_pViews && !m_pViews->isInitialized())
543 impl_fillTableFilter();
544 // check if our "master connection" can supply tables
545 Reference< XViewsSupplier > xMaster(getMasterTables(),UNO_QUERY);
547 if (xMaster.is() && xMaster->getViews().is())
548 m_pViews->construct(xMaster->getViews(),m_aTableFilter, m_aTableTypeFilter);
549 else
550 m_pViews->construct(m_aTableFilter, m_aTableTypeFilter);
555 // XTablesSupplier
556 Reference< XNameAccess > OConnection::getTables()
558 MutexGuard aGuard(m_aMutex);
559 checkDisposed();
561 refresh(m_pTables.get());
563 return m_pTables.get();
566 Reference< XNameAccess > SAL_CALL OConnection::getViews( )
568 MutexGuard aGuard(m_aMutex);
569 checkDisposed();
571 refresh(m_pViews.get());
573 return m_pViews.get();
576 // XQueriesSupplier
577 Reference< XNameAccess > OConnection::getQueries()
579 MutexGuard aGuard(m_aMutex);
580 checkDisposed();
582 return m_xQueries;
585 // css::sdb::XCommandPreparation
586 Reference< XPreparedStatement > SAL_CALL OConnection::prepareCommand( const OUString& command, sal_Int32 commandType )
588 MutexGuard aGuard(m_aMutex);
589 checkDisposed();
591 OUString aStatement;
592 switch (commandType)
594 case CommandType::TABLE:
596 aStatement = "SELECT * FROM ";
598 OUString sCatalog, sSchema, sTable;
599 ::dbtools::qualifiedNameComponents( getMetaData(), command, sCatalog, sSchema, sTable, ::dbtools::EComposeRule::InDataManipulation );
600 aStatement += ::dbtools::composeTableNameForSelect( this, sCatalog, sSchema, sTable );
602 break;
603 case CommandType::QUERY:
604 if ( m_xQueries->hasByName(command) )
606 Reference< XPropertySet > xQuery(m_xQueries->getByName(command),UNO_QUERY);
607 xQuery->getPropertyValue(PROPERTY_COMMAND) >>= aStatement;
609 break;
610 default:
611 aStatement = command;
613 // TODO EscapeProcessing
614 return prepareStatement(aStatement);
617 Reference< XInterface > SAL_CALL OConnection::createInstance( const OUString& _sServiceSpecifier )
619 Reference< XServiceInfo > xRet;
620 if ( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER == _sServiceSpecifier || _sServiceSpecifier == "com.sun.star.sdb.SingleSelectQueryAnalyzer" )
622 xRet = new OSingleSelectQueryComposer( getTables(),this, m_aContext );
623 m_aComposers.emplace_back(xRet);
625 else
627 if ( !_sServiceSpecifier.isEmpty() )
629 TSupportServices::const_iterator aFind = m_aSupportServices.find(_sServiceSpecifier);
630 if ( aFind == m_aSupportServices.end() )
632 Reference<XConnection> xMy(this);
633 Sequence<Any> aArgs{ Any(NamedValue("ActiveConnection",Any(xMy))) };
634 aFind = m_aSupportServices.emplace(
635 _sServiceSpecifier,
636 m_aContext->getServiceManager()->createInstanceWithArgumentsAndContext(_sServiceSpecifier, aArgs, m_aContext)
637 ).first;
639 return aFind->second;
642 return Reference<XInterface>(xRet, UNO_QUERY);
645 Reference< XInterface > SAL_CALL OConnection::createInstanceWithArguments( const OUString& _sServiceSpecifier, const Sequence< Any >& /*Arguments*/ )
647 return createInstance(_sServiceSpecifier);
650 Sequence< OUString > SAL_CALL OConnection::getAvailableServiceNames( )
652 Sequence< OUString > aRet { SERVICE_NAME_SINGLESELECTQUERYCOMPOSER };
653 return aRet;
656 Reference< XTablesSupplier > const & OConnection::getMasterTables()
658 // check if out "master connection" can supply tables
659 if(!m_xMasterTables.is())
663 Reference<XDatabaseMetaData> xMeta = getMetaData();
664 if ( xMeta.is() )
665 m_xMasterTables = ::dbtools::getDataDefinitionByURLAndConnection( xMeta->getURL(), m_xMasterConnection, m_aContext );
667 catch(const SQLException&)
671 return m_xMasterTables;
674 // XUsersSupplier
675 Reference< XNameAccess > SAL_CALL OConnection::getUsers( )
677 MutexGuard aGuard(m_aMutex);
678 checkDisposed();
680 Reference<XUsersSupplier> xUsr(getMasterTables(),UNO_QUERY);
681 return xUsr.is() ? xUsr->getUsers() : Reference< XNameAccess >();
684 // XGroupsSupplier
685 Reference< XNameAccess > SAL_CALL OConnection::getGroups( )
687 MutexGuard aGuard(m_aMutex);
688 checkDisposed();
689 Reference<XGroupsSupplier> xGrp(getMasterTables(),UNO_QUERY);
690 return xGrp.is() ? xGrp->getGroups() : Reference< XNameAccess >();
693 void OConnection::impl_loadConnectionTools_throw()
695 m_xConnectionTools = css::sdb::tools::ConnectionTools::createWithConnection( m_aContext, this );
698 Reference< XTableName > SAL_CALL OConnection::createTableName( )
700 MutexGuard aGuard(m_aMutex);
701 checkDisposed();
702 impl_loadConnectionTools_throw();
704 return m_xConnectionTools->createTableName();
707 Reference< XObjectNames > SAL_CALL OConnection::getObjectNames( )
709 MutexGuard aGuard(m_aMutex);
710 checkDisposed();
711 impl_loadConnectionTools_throw();
713 return m_xConnectionTools->getObjectNames();
716 Reference< XDataSourceMetaData > SAL_CALL OConnection::getDataSourceMetaData( )
718 MutexGuard aGuard(m_aMutex);
719 checkDisposed();
720 impl_loadConnectionTools_throw();
722 return m_xConnectionTools->getDataSourceMetaData();
725 Reference< css::container::XNameAccess > SAL_CALL OConnection::getFieldsByCommandDescriptor( ::sal_Int32 commandType, const OUString& command, css::uno::Reference< css::lang::XComponent >& keepFieldsAlive )
727 MutexGuard aGuard(m_aMutex);
728 checkDisposed();
729 impl_loadConnectionTools_throw();
731 return m_xConnectionTools->getFieldsByCommandDescriptor(commandType,command,keepFieldsAlive);
734 Reference< XSingleSelectQueryComposer > SAL_CALL OConnection::getComposer( ::sal_Int32 commandType, const OUString& command )
736 MutexGuard aGuard(m_aMutex);
737 checkDisposed();
738 impl_loadConnectionTools_throw();
740 return m_xConnectionTools->getComposer(commandType,command);
743 void OConnection::impl_checkTableQueryNames_nothrow()
745 DatabaseMetaData aMeta( static_cast< XConnection* >( this ) );
746 if ( !aMeta.supportsSubqueriesInFrom() )
747 // nothing to do
748 return;
752 Reference< XNameAccess > xTables( getTables() );
753 const Sequence< OUString > aTableNames( xTables->getElementNames() );
754 std::set< OUString > aSortedTableNames( aTableNames.begin(), aTableNames.end() );
756 Reference< XNameAccess > xQueries( getQueries() );
757 const Sequence< OUString > aQueryNames( xQueries->getElementNames() );
759 for ( auto const & queryName : aQueryNames )
761 if ( aSortedTableNames.find( queryName ) != aSortedTableNames.end() )
763 OUString sConflictWarning( DBA_RES( RID_STR_CONFLICTING_NAMES ) );
764 m_aWarnings.appendWarning( sConflictWarning, "01SB0", *this );
768 catch( const Exception& )
770 DBG_UNHANDLED_EXCEPTION("dbaccess");
774 Reference< XGraphic > SAL_CALL OConnection::getTableIcon( const OUString& TableName, ::sal_Int32 ColorMode )
776 Reference< XGraphic > xReturn;
778 // ask our aggregate
779 if ( m_xTableUIProvider.is() )
780 xReturn = m_xTableUIProvider->getTableIcon( TableName, ColorMode );
782 // ask ourself
783 // well, we don't have own functionality here ...
784 // In the future, we might decide to delegate the complete handling to this interface.
785 // In this case, we would need to load the icon here.
787 return xReturn;
790 Reference< XInterface > SAL_CALL OConnection::getTableEditor( const Reference< XDatabaseDocumentUI >& DocumentUI, const OUString& TableName )
792 Reference< XInterface > xReturn;
794 // ask our aggregate
795 if ( m_xTableUIProvider.is() )
796 xReturn = m_xTableUIProvider->getTableEditor( DocumentUI, TableName );
798 // ask ourself
799 // well, we don't have own functionality here ...
800 // In the future, we might decide to delegate the complete handling to this interface.
801 // In this case, we would need to instantiate a css.sdb.TableDesign here.
803 return xReturn;
806 } // namespace dbaccess
808 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */