2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 22:04:38 +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 .
|
|
|
|
*/
|
2006-09-17 01:40:10 +00:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
|
2005-01-21 15:39:26 +00:00
|
|
|
#include "hsqldb/HConnection.hxx"
|
2007-11-21 14:00:58 +00:00
|
|
|
#include "hsqldb/HTools.hxx"
|
2006-10-05 12:39:47 +00:00
|
|
|
#include "hsqlui.hrc"
|
2007-11-21 14:00:58 +00:00
|
|
|
|
|
|
|
#include <connectivity/dbtools.hxx>
|
2006-10-05 12:39:47 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/beans/NamedValue.hpp>
|
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
|
|
|
#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
|
|
|
|
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XRow.hpp>
|
2012-05-26 13:53:19 +02:00
|
|
|
#include <com/sun/star/graphic/GraphicProvider.hpp>
|
2006-10-05 12:39:47 +00:00
|
|
|
#include <com/sun/star/graphic/XGraphicProvider.hpp>
|
|
|
|
#include <com/sun/star/graphic/GraphicColorMode.hpp>
|
|
|
|
#include <com/sun/star/beans/PropertyValue.hpp>
|
2008-01-30 06:53:14 +00:00
|
|
|
#include <com/sun/star/sdbc/XDatabaseMetaData2.hpp>
|
2006-10-05 12:39:47 +00:00
|
|
|
|
2007-11-21 14:00:58 +00:00
|
|
|
#include <comphelper/listenernotification.hxx>
|
2012-09-19 13:15:15 +02:00
|
|
|
#include <comphelper/processfactory.hxx>
|
2007-11-21 14:00:58 +00:00
|
|
|
#include <comphelper/sequence.hxx>
|
2006-10-05 12:39:47 +00:00
|
|
|
#include <cppuhelper/exc_hlp.hxx>
|
|
|
|
#include <rtl/ustrbuf.hxx>
|
2007-11-21 14:00:58 +00:00
|
|
|
#include <tools/diagnose_ex.h>
|
2005-10-24 07:21:12 +00:00
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
#include "resource/sharedresources.hxx"
|
|
|
|
#include "resource/hsqldb_res.hrc"
|
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
using ::com::sun::star::util::XFlushListener;
|
|
|
|
using ::com::sun::star::lang::EventObject;
|
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::uno::Exception;
|
|
|
|
using ::com::sun::star::uno::RuntimeException;
|
|
|
|
using ::com::sun::star::uno::UNO_QUERY;
|
|
|
|
using ::com::sun::star::uno::UNO_QUERY_THROW;
|
2012-11-27 11:00:51 +02:00
|
|
|
using ::com::sun::star::uno::XComponentContext;
|
2006-10-05 12:39:47 +00:00
|
|
|
using ::com::sun::star::sdbc::XStatement;
|
|
|
|
using ::com::sun::star::sdbc::XConnection;
|
|
|
|
using ::com::sun::star::sdbcx::XDataDefinitionSupplier;
|
|
|
|
using ::com::sun::star::sdbcx::XTablesSupplier;
|
|
|
|
using ::com::sun::star::container::XNameAccess;
|
|
|
|
using ::com::sun::star::uno::Sequence;
|
|
|
|
using ::com::sun::star::beans::NamedValue;
|
|
|
|
using ::com::sun::star::lang::WrappedTargetException;
|
|
|
|
using ::com::sun::star::lang::ServiceNotRegisteredException;
|
|
|
|
using ::com::sun::star::sdbc::XDriver;
|
|
|
|
using ::com::sun::star::lang::XMultiServiceFactory;
|
|
|
|
using ::com::sun::star::graphic::XGraphic;
|
2012-05-26 13:53:19 +02:00
|
|
|
using ::com::sun::star::graphic::GraphicProvider;
|
2006-10-05 12:39:47 +00:00
|
|
|
using ::com::sun::star::graphic::XGraphicProvider;
|
|
|
|
using ::com::sun::star::uno::XInterface;
|
|
|
|
using ::com::sun::star::lang::IllegalArgumentException;
|
|
|
|
using ::com::sun::star::ui::dialogs::XExecutableDialog;
|
|
|
|
using ::com::sun::star::uno::Any;
|
|
|
|
using ::com::sun::star::uno::makeAny;
|
|
|
|
using ::com::sun::star::sdbc::XResultSet;
|
|
|
|
using ::com::sun::star::sdbc::XDatabaseMetaData;
|
2008-01-30 06:53:14 +00:00
|
|
|
using ::com::sun::star::sdbc::XDatabaseMetaData2;
|
2006-10-05 12:39:47 +00:00
|
|
|
using ::com::sun::star::sdbc::XRow;
|
|
|
|
using ::com::sun::star::sdb::application::XDatabaseDocumentUI;
|
|
|
|
using ::com::sun::star::beans::PropertyValue;
|
2013-04-01 18:45:57 +02:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
namespace GraphicColorMode = ::com::sun::star::graphic::GraphicColorMode;
|
|
|
|
|
|
|
|
namespace connectivity { namespace hsqldb
|
2005-10-24 07:21:12 +00:00
|
|
|
{
|
2006-10-05 12:39:47 +00:00
|
|
|
void SAL_CALL OHsqlConnection::disposing(void)
|
|
|
|
{
|
|
|
|
m_aFlushListeners.disposeAndClear( EventObject( *this ) );
|
|
|
|
OHsqlConnection_BASE::disposing();
|
|
|
|
OConnectionWrapper::disposing();
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
OHsqlConnection::OHsqlConnection( const Reference< XDriver > _rxDriver,
|
2012-11-27 11:00:51 +02:00
|
|
|
const Reference< XConnection >& _xConnection ,const Reference< XComponentContext >& _rxContext )
|
2006-10-05 12:39:47 +00:00
|
|
|
:OHsqlConnection_BASE( m_aMutex )
|
|
|
|
,m_aFlushListeners( m_aMutex )
|
|
|
|
,m_xDriver( _rxDriver )
|
2012-11-27 11:00:51 +02:00
|
|
|
,m_xContext( _rxContext )
|
2008-01-30 06:53:14 +00:00
|
|
|
,m_bIni(true)
|
|
|
|
,m_bReadOnly(false)
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
2012-11-27 11:00:51 +02:00
|
|
|
setDelegation(_xConnection,_rxContext,m_refCount);
|
2006-10-05 12:39:47 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
OHsqlConnection::~OHsqlConnection()
|
|
|
|
{
|
|
|
|
if ( !OHsqlConnection_BASE::rBHelper.bDisposed )
|
2005-10-24 07:21:12 +00:00
|
|
|
{
|
2012-09-22 01:51:12 -05:00
|
|
|
osl_atomic_increment( &m_refCount );
|
2006-10-05 12:39:47 +00:00
|
|
|
dispose();
|
2005-10-24 07:21:12 +00:00
|
|
|
}
|
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
IMPLEMENT_FORWARD_XINTERFACE2(OHsqlConnection,OHsqlConnection_BASE,OConnectionWrapper)
|
|
|
|
IMPLEMENT_SERVICE_INFO(OHsqlConnection, "com.sun.star.sdbc.drivers.hsqldb.OHsqlConnection", "com.sun.star.sdbc.Connection")
|
|
|
|
IMPLEMENT_FORWARD_XTYPEPROVIDER2(OHsqlConnection,OHsqlConnection_BASE,OConnectionWrapper)
|
2005-01-21 15:39:26 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
::osl::Mutex& OHsqlConnection::getMutex() const
|
2005-01-21 15:39:26 +00:00
|
|
|
{
|
2006-10-05 12:39:47 +00:00
|
|
|
return m_aMutex;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
void OHsqlConnection::checkDisposed() const
|
|
|
|
{
|
|
|
|
::connectivity::checkDisposed( rBHelper.bDisposed );
|
2005-01-21 15:39:26 +00:00
|
|
|
}
|
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
// XFlushable
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL OHsqlConnection::flush( ) throw (RuntimeException, std::exception)
|
2005-01-21 15:39:26 +00:00
|
|
|
{
|
2006-10-05 12:39:47 +00:00
|
|
|
MethodGuard aGuard( *this );
|
|
|
|
|
|
|
|
try
|
2005-01-21 15:39:26 +00:00
|
|
|
{
|
2006-10-05 12:39:47 +00:00
|
|
|
if ( m_xConnection.is() )
|
|
|
|
{
|
2008-01-30 06:53:14 +00:00
|
|
|
if ( m_bIni )
|
|
|
|
{
|
|
|
|
m_bIni = false;
|
|
|
|
Reference< XDatabaseMetaData2 > xMeta2(m_xConnection->getMetaData(),UNO_QUERY_THROW);
|
|
|
|
const Sequence< PropertyValue > aInfo = xMeta2->getConnectionInfo();
|
|
|
|
const PropertyValue* pIter = aInfo.getConstArray();
|
|
|
|
const PropertyValue* pEnd = pIter + aInfo.getLength();
|
|
|
|
for(;pIter != pEnd;++pIter)
|
|
|
|
{
|
2013-11-05 14:39:55 +02:00
|
|
|
if ( pIter->Name.equalsAscii("readonly") )
|
2008-01-30 06:53:14 +00:00
|
|
|
m_bReadOnly = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !m_bReadOnly )
|
|
|
|
{
|
|
|
|
Reference< XStatement > xStmt( m_xConnection->createStatement(), UNO_QUERY_THROW );
|
2013-04-07 12:06:47 +02:00
|
|
|
xStmt->execute( OUString( "CHECKPOINT DEFRAG" ) );
|
2008-01-30 06:53:14 +00:00
|
|
|
}
|
2006-10-05 12:39:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
EventObject aFlushedEvent( *this );
|
|
|
|
m_aFlushListeners.notifyEach( &XFlushListener::flushed, aFlushedEvent );
|
|
|
|
}
|
2007-11-21 14:00:58 +00:00
|
|
|
catch(const Exception& )
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
2007-11-21 14:00:58 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2005-01-21 15:39:26 +00:00
|
|
|
}
|
2006-10-05 12:39:47 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL OHsqlConnection::addFlushListener( const Reference< XFlushListener >& l ) throw (RuntimeException, std::exception)
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
|
|
|
MethodGuard aGuard( *this );
|
|
|
|
m_aFlushListeners.addInterface( l );
|
2005-01-21 15:39:26 +00:00
|
|
|
}
|
2006-10-05 12:39:47 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
void SAL_CALL OHsqlConnection::removeFlushListener( const Reference< XFlushListener >& l ) throw (RuntimeException, std::exception)
|
2005-01-21 15:39:26 +00:00
|
|
|
{
|
2006-10-05 12:39:47 +00:00
|
|
|
MethodGuard aGuard( *this );
|
|
|
|
m_aFlushListeners.removeInterface( l );
|
2005-01-21 15:39:26 +00:00
|
|
|
}
|
2005-10-24 07:21:12 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
Reference< XGraphic > SAL_CALL OHsqlConnection::getTableIcon( const OUString& _TableName, ::sal_Int32 /*_ColorMode*/ ) throw (RuntimeException, std::exception)
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
|
|
|
MethodGuard aGuard( *this );
|
2005-10-24 07:21:12 +00:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
impl_checkExistingTable_throw( _TableName );
|
|
|
|
if ( !impl_isTextTable_nothrow( _TableName ) )
|
|
|
|
return NULL;
|
|
|
|
|
2010-11-11 16:26:08 +00:00
|
|
|
return impl_getTextTableIcon_nothrow();
|
2006-10-05 12:39:47 +00:00
|
|
|
}
|
2005-10-24 07:21:12 +00:00
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2014-02-25 21:31:58 +01:00
|
|
|
Reference< XInterface > SAL_CALL OHsqlConnection::getTableEditor( const Reference< XDatabaseDocumentUI >& _DocumentUI, const OUString& _TableName ) throw (IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception)
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
|
|
|
MethodGuard aGuard( *this );
|
|
|
|
|
|
|
|
impl_checkExistingTable_throw( _TableName );
|
|
|
|
if ( !impl_isTextTable_nothrow( _TableName ) )
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if ( !_DocumentUI.is() )
|
2008-10-01 12:28:29 +00:00
|
|
|
{
|
|
|
|
::connectivity::SharedResources aResources;
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString sError( aResources.getResourceString(STR_NO_DOCUMENTUI));
|
2006-10-05 12:39:47 +00:00
|
|
|
throw IllegalArgumentException(
|
2008-10-01 12:28:29 +00:00
|
|
|
sError,
|
2006-10-05 12:39:47 +00:00
|
|
|
*this,
|
|
|
|
0
|
|
|
|
);
|
2008-10-01 12:28:29 +00:00
|
|
|
} // if ( !_DocumentUI.is() )
|
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
|
|
|
|
// Reference< XExecutableDialog > xEditor = impl_createLinkedTableEditor_throw( _DocumentUI, _TableName );
|
|
|
|
// return xEditor.get();
|
|
|
|
return NULL;
|
|
|
|
// editor not yet implemented in this CWS
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
Reference< XNameAccess > OHsqlConnection::impl_getTableContainer_throw()
|
|
|
|
{
|
|
|
|
Reference< XNameAccess > xTables;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Reference< XConnection > xMe( *this, UNO_QUERY );
|
|
|
|
Reference< XDataDefinitionSupplier > xDefinitionsSupp( m_xDriver, UNO_QUERY_THROW );
|
|
|
|
Reference< XTablesSupplier > xTablesSupp( xDefinitionsSupp->getDataDefinitionByConnection( xMe ), UNO_QUERY_THROW );
|
|
|
|
xTables.set( xTablesSupp->getTables(), UNO_QUERY_THROW );
|
|
|
|
}
|
|
|
|
catch( const RuntimeException& ) { throw; }
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
2008-10-01 12:28:29 +00:00
|
|
|
::connectivity::SharedResources aResources;
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString sError( aResources.getResourceString(STR_NO_TABLE_CONTAINER));
|
2008-10-01 12:28:29 +00:00
|
|
|
throw WrappedTargetException( sError ,*this, ::cppu::getCaughtException() );
|
2006-10-05 12:39:47 +00:00
|
|
|
}
|
|
|
|
|
2014-04-04 00:13:31 +02:00
|
|
|
SAL_WARN_IF( !xTables.is(), "connectivity.hsqldb", "OHsqlConnection::impl_getTableContainer_throw: post condition not met!" );
|
2006-10-05 12:39:47 +00:00
|
|
|
return xTables;
|
|
|
|
}
|
|
|
|
|
2008-08-19 08:12:24 +00:00
|
|
|
//TODO: resource
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
void OHsqlConnection::impl_checkExistingTable_throw( const OUString& _rTableName )
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
|
|
|
bool bDoesExist = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Reference< XNameAccess > xTables( impl_getTableContainer_throw(), UNO_QUERY_THROW );
|
|
|
|
if ( xTables.is() )
|
|
|
|
bDoesExist = xTables->hasByName( _rTableName );
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
// that's a serious error in impl_getTableContainer_throw, or hasByName, however, we're only
|
|
|
|
// allowed to throw an IllegalArgumentException ourself
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bDoesExist )
|
2008-10-01 12:28:29 +00:00
|
|
|
{
|
|
|
|
::connectivity::SharedResources aResources;
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString sError( aResources.getResourceStringWithSubstitution(
|
2008-10-01 12:28:29 +00:00
|
|
|
STR_NO_TABLENAME,
|
|
|
|
"$tablename$", _rTableName
|
|
|
|
));
|
|
|
|
throw IllegalArgumentException( sError,*this, 0 );
|
|
|
|
} // if ( !bDoesExist )
|
2006-10-05 12:39:47 +00:00
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
bool OHsqlConnection::impl_isTextTable_nothrow( const OUString& _rTableName )
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
|
|
|
bool bIsTextTable = false;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Reference< XConnection > xMe( *this, UNO_QUERY_THROW );
|
|
|
|
|
|
|
|
// split the fully qualified name
|
|
|
|
Reference< XDatabaseMetaData > xMetaData( xMe->getMetaData(), UNO_QUERY_THROW );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sCatalog, sSchema, sName;
|
2006-10-05 12:39:47 +00:00
|
|
|
::dbtools::qualifiedNameComponents( xMetaData, _rTableName, sCatalog, sSchema, sName, ::dbtools::eComplete );
|
|
|
|
|
|
|
|
// get the table information
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringBuffer sSQL;
|
2006-10-05 12:39:47 +00:00
|
|
|
sSQL.appendAscii( "SELECT HSQLDB_TYPE FROM INFORMATION_SCHEMA.SYSTEM_TABLES" );
|
2007-11-21 14:00:58 +00:00
|
|
|
HTools::appendTableFilterCrit( sSQL, sCatalog, sSchema, sName, true );
|
|
|
|
sSQL.appendAscii( " AND TABLE_TYPE = 'TABLE'" );
|
2006-10-05 12:39:47 +00:00
|
|
|
|
|
|
|
Reference< XStatement > xStatement( xMe->createStatement(), UNO_QUERY_THROW );
|
|
|
|
Reference< XResultSet > xTableHsqlType( xStatement->executeQuery( sSQL.makeStringAndClear() ), UNO_QUERY_THROW );
|
|
|
|
|
|
|
|
if ( xTableHsqlType->next() ) // might not succeed in case of VIEWs
|
|
|
|
{
|
|
|
|
Reference< XRow > xValueAccess( xTableHsqlType, UNO_QUERY_THROW );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sTableType = xValueAccess->getString( 1 );
|
2012-04-06 19:49:53 +02:00
|
|
|
bIsTextTable = sTableType == "TEXT";
|
2006-10-05 12:39:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
}
|
|
|
|
|
|
|
|
return bIsTextTable;
|
|
|
|
}
|
|
|
|
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2010-11-11 16:26:08 +00:00
|
|
|
Reference< XGraphic > OHsqlConnection::impl_getTextTableIcon_nothrow()
|
2006-10-05 12:39:47 +00:00
|
|
|
{
|
|
|
|
Reference< XGraphic > xGraphic;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
// create a graphic provider
|
|
|
|
Reference< XGraphicProvider > xProvider;
|
2012-11-27 11:00:51 +02:00
|
|
|
if ( m_xContext.is() )
|
|
|
|
xProvider.set( GraphicProvider::create(m_xContext) );
|
2006-10-05 12:39:47 +00:00
|
|
|
|
|
|
|
// assemble the image URL
|
2013-04-07 12:06:47 +02:00
|
|
|
OUStringBuffer aImageURL;
|
2010-11-11 13:10:14 +01:00
|
|
|
// load the graphic from the global graphic repository
|
|
|
|
aImageURL.appendAscii( "private:graphicrepository/" );
|
|
|
|
// the relative path within the images.zip
|
|
|
|
aImageURL.appendAscii( "database/" );
|
|
|
|
aImageURL.appendAscii( LINKED_TEXT_TABLE_IMAGE_RESOURCE );
|
|
|
|
// the name of the graphic to use
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sImageURL( aImageURL.makeStringAndClear() );
|
2006-10-05 12:39:47 +00:00
|
|
|
|
|
|
|
// ask the provider to obtain a graphic
|
|
|
|
Sequence< PropertyValue > aMediaProperties( 1 );
|
2013-11-15 11:05:19 +02:00
|
|
|
aMediaProperties[0].Name = "URL";
|
2006-10-05 12:39:47 +00:00
|
|
|
aMediaProperties[0].Value <<= sImageURL;
|
|
|
|
xGraphic = xProvider->queryGraphic( aMediaProperties );
|
|
|
|
OSL_ENSURE( xGraphic.is(), "OHsqlConnection::impl_getTextTableIcon_nothrow: the provider did not give us a graphic object!" );
|
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
|
|
|
}
|
|
|
|
return xGraphic;
|
|
|
|
}
|
2005-01-21 15:39:26 +00:00
|
|
|
|
2006-10-05 12:39:47 +00:00
|
|
|
} } // namespace connectivity::hsqldb
|
2010-10-12 15:53:47 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|