Kaydet (Commit) e382d378 authored tarafından Timothy Pearson's avatar Timothy Pearson Kaydeden (comit) Stephan Bergmann

tdeab: Fix unit test failure when TDE support is enabled

Change-Id: I91311e2017a93dbfbffb20b9ba4595c62ce8165b
Signed-off-by: 's avatarTimothy Pearson <kb9vqf@pearsoncomputing.net>
Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 8f74734c
...@@ -34,6 +34,16 @@ ...@@ -34,6 +34,16 @@
#include "resource/kab_res.hrc" #include "resource/kab_res.hrc"
#include "resource/sharedresources.hxx" #include "resource/sharedresources.hxx"
#if ENABLE_TDE
#define KAB_SERVICE_NAME "tdeab"
#else // ENABLE_TDE
#define KAB_SERVICE_NAME "kab"
#endif // ENABLE_TDE
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
using namespace com::sun::star::lang; using namespace com::sun::star::lang;
using namespace com::sun::star::beans; using namespace com::sun::star::beans;
...@@ -120,7 +130,7 @@ bool KabImplModule::impl_loadModule() ...@@ -120,7 +130,7 @@ bool KabImplModule::impl_loadModule()
OSL_ENSURE( !m_hConnectorModule && !m_pConnectionFactoryFunc && !m_pApplicationInitFunc && !m_pApplicationShutdownFunc && !m_pKDEVersionCheckFunc, OSL_ENSURE( !m_hConnectorModule && !m_pConnectionFactoryFunc && !m_pApplicationInitFunc && !m_pApplicationShutdownFunc && !m_pKDEVersionCheckFunc,
"KabImplModule::impl_loadModule: inconsistence: inconsistency (never attempted load before, but some values already set)!"); "KabImplModule::impl_loadModule: inconsistence: inconsistency (never attempted load before, but some values already set)!");
const OUString sModuleName( SAL_MODULENAME( "kabdrv1" )); const OUString sModuleName( SAL_MODULENAME( KAB_SERVICE_NAME "drv1" ));
m_hConnectorModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, SAL_LOADMODULE_NOW ); // LAZY! #i61335# m_hConnectorModule = osl_loadModuleRelative( &thisModule, sModuleName.pData, SAL_LOADMODULE_NOW ); // LAZY! #i61335#
OSL_ENSURE( m_hConnectorModule, "KabImplModule::impl_loadModule: could not load the implementation library!" ); OSL_ENSURE( m_hConnectorModule, "KabImplModule::impl_loadModule: could not load the implementation library!" );
if ( !m_hConnectorModule ) if ( !m_hConnectorModule )
...@@ -379,7 +389,7 @@ Reference< XConnection > SAL_CALL KabDriver::connect( const OUString& url, const ...@@ -379,7 +389,7 @@ Reference< XConnection > SAL_CALL KabDriver::connect( const OUString& url, const
// create a new connection with the given properties and append it to our vector // create a new connection with the given properties and append it to our vector
KabConnection* pConnection = m_aImplModule.createConnection( this ); KabConnection* pConnection = m_aImplModule.createConnection( this );
SAL_WARN_IF( !pConnection, "connectivity.kab", "KabDriver::connect: no connection has been created by the factory!" ); SAL_WARN_IF( !pConnection, "connectivity." KAB_SERVICE_NAME, "KabDriver::connect: no connection has been created by the factory!" );
// by definition, the factory function returned an object which was acquired once // by definition, the factory function returned an object which was acquired once
Reference< XConnection > xConnection = pConnection; Reference< XConnection > xConnection = pConnection;
...@@ -403,7 +413,7 @@ sal_Bool SAL_CALL KabDriver::acceptsURL( const OUString& url ) ...@@ -403,7 +413,7 @@ sal_Bool SAL_CALL KabDriver::acceptsURL( const OUString& url )
return sal_False; return sal_False;
// here we have to look whether we support this URL format // here we have to look whether we support this URL format
return url.startsWith("sdbc:address:kab:"); return url.startsWith("sdbc:address:" KAB_SERVICE_NAME ":");
} }
Sequence< DriverPropertyInfo > SAL_CALL KabDriver::getPropertyInfo( const OUString&, const Sequence< PropertyValue >& ) throw(SQLException, RuntimeException, std::exception) Sequence< DriverPropertyInfo > SAL_CALL KabDriver::getPropertyInfo( const OUString&, const Sequence< PropertyValue >& ) throw(SQLException, RuntimeException, std::exception)
...@@ -439,7 +449,7 @@ void SAL_CALL KabDriver::disposing( const EventObject& ) throw (RuntimeException ...@@ -439,7 +449,7 @@ void SAL_CALL KabDriver::disposing( const EventObject& ) throw (RuntimeException
const sal_Char* KabDriver::impl_getAsciiImplementationName() const sal_Char* KabDriver::impl_getAsciiImplementationName()
{ {
return "com.sun.star.comp.sdbc.kab.Driver"; return "com.sun.star.comp.sdbc." KAB_SERVICE_NAME ".Driver";
// this name is referenced in the configuration and in the kab.xml // this name is referenced in the configuration and in the kab.xml
// Please be careful when changing it. // Please be careful when changing it.
} }
...@@ -448,7 +458,7 @@ OUString KabDriver::impl_getConfigurationSettingsPath() ...@@ -448,7 +458,7 @@ OUString KabDriver::impl_getConfigurationSettingsPath()
{ {
OUStringBuffer aPath; OUStringBuffer aPath;
aPath.appendAscii( "/org.openoffice.Office.DataAccess/DriverSettings/" ); aPath.appendAscii( "/org.openoffice.Office.DataAccess/DriverSettings/" );
aPath.appendAscii( "com.sun.star.comp.sdbc.kab.Driver" ); aPath.appendAscii( "com.sun.star.comp.sdbc." KAB_SERVICE_NAME ".Driver" );
return aPath.makeStringAndClear(); return aPath.makeStringAndClear();
} }
......
...@@ -18,9 +18,16 @@ ...@@ -18,9 +18,16 @@
*/ */
#include <config_vclplug.h>
#include "KDriver.hxx" #include "KDriver.hxx"
#include <cppuhelper/factory.hxx> #include <cppuhelper/factory.hxx>
#if ENABLE_TDE
#define kab_component_getFactory tdeab_component_getFactory
#endif // ENABLE_TDE
using namespace connectivity::kab; using namespace connectivity::kab;
using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Sequence;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
--> -->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components"> prefix="tdeab" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.sdbc.tdeab.Driver"> <implementation name="com.sun.star.comp.sdbc.tdeab.Driver">
<service name="com.sun.star.sdbc.Driver"/> <service name="com.sun.star.sdbc.Driver"/>
</implementation> </implementation>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment