diff options
Diffstat (limited to 'dbaccess')
23 files changed, 82 insertions, 121 deletions
diff --git a/dbaccess/Executable_odbcconfig.mk b/dbaccess/Executable_odbcconfig.mk index 9afc9ac40c5a..bb2febd1e54d 100644 --- a/dbaccess/Executable_odbcconfig.mk +++ b/dbaccess/Executable_odbcconfig.mk @@ -34,7 +34,11 @@ $(eval $(call gb_Executable_set_include,odbcconfig,\ -I$(realpath $(SRCDIR)/dbaccess/inc) \ -I$(realpath $(SRCDIR)/dbaccess/inc/pch) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,odbcconfig,\ + offapi \ + udkapi \ )) $(eval $(call gb_Executable_add_linked_libs,odbcconfig,\ diff --git a/dbaccess/Library_dba.mk b/dbaccess/Library_dba.mk index 368eaa192e4a..eabd13a9b74d 100644 --- a/dbaccess/Library_dba.mk +++ b/dbaccess/Library_dba.mk @@ -40,13 +40,17 @@ $(eval $(call gb_Library_set_include,dba,\ -I$(realpath $(SRCDIR)/dbaccess/source/inc) \ -I$(realpath $(SRCDIR)/dbaccess/source/core/inc) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ )) $(eval $(call gb_Library_add_defs,dba,\ -DOOO_DLLIMPLEMENTATION_DBA \ )) +$(eval $(call gb_Library_add_api,dba,\ + offapi \ + udkapi \ +)) + $(eval $(call gb_Library_add_linked_libs,dba,\ comphelper \ cppu \ diff --git a/dbaccess/Library_dbaxml.mk b/dbaccess/Library_dbaxml.mk index e0a190898c24..477f86b53db6 100644 --- a/dbaccess/Library_dbaxml.mk +++ b/dbaccess/Library_dbaxml.mk @@ -34,7 +34,11 @@ $(eval $(call gb_Library_set_include,dbaxml,\ -I$(realpath $(SRCDIR)/dbaccess/inc/pch) \ -I$(realpath $(SRCDIR)/dbaccess/source/inc) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,dbaxml,\ + offapi \ + udkapi \ )) $(eval $(call gb_Library_add_linked_libs,dbaxml,\ diff --git a/dbaccess/Library_dbmm.mk b/dbaccess/Library_dbmm.mk index db6b152b2d4f..023157ddae65 100644 --- a/dbaccess/Library_dbmm.mk +++ b/dbaccess/Library_dbmm.mk @@ -38,7 +38,11 @@ $(eval $(call gb_Library_set_include,dbmm,\ -I$(realpath $(SRCDIR)/dbaccess/inc) \ -I$(realpath $(SRCDIR)/dbaccess/inc/pch) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,dbmm,\ + offapi \ + udkapi \ )) $(eval $(call gb_Library_add_linked_libs,dbmm,\ diff --git a/dbaccess/Library_sdbt.mk b/dbaccess/Library_sdbt.mk index a93bc256bdc0..5338fcf56997 100644 --- a/dbaccess/Library_sdbt.mk +++ b/dbaccess/Library_sdbt.mk @@ -40,7 +40,11 @@ $(eval $(call gb_Library_set_include,sdbt,\ -I$(realpath $(SRCDIR)/dbaccess/source/inc/) \ -I$(realpath $(SRCDIR)/dbaccess/source/sdbtools/inc) \ -I$(OUTDIR)/inc \ - -I$(OUTDIR)/inc/offuh \ +)) + +$(eval $(call gb_Library_add_api,sdbt,\ + offapi \ + udkapi \ )) $(eval $(call gb_Library_add_linked_libs,sdbt,\ diff --git a/dbaccess/source/core/api/CRowSetDataColumn.cxx b/dbaccess/source/core/api/CRowSetDataColumn.cxx index 2aa99a9ff767..79738dc6b7b5 100644 --- a/dbaccess/source/core/api/CRowSetDataColumn.cxx +++ b/dbaccess/source/core/api/CRowSetDataColumn.cxx @@ -203,7 +203,7 @@ Sequence< sal_Int8 > ORowSetDataColumn::getImplementationId() throw (RuntimeExce void ORowSetDataColumn::fireValueChange(const ORowSetValue& _rOldValue) { - if ( !m_aColumnValue.isNull() && m_aColumnValue->is() && (!(((*m_aColumnValue)->get())[m_nPos] == _rOldValue)) ) + if ( !m_aColumnValue.isNull() && m_aColumnValue->is() && (((*m_aColumnValue)->get())[m_nPos] != _rOldValue) ) { sal_Int32 nHandle = PROPERTY_ID_VALUE; m_aOldValue = _rOldValue.makeAny(); diff --git a/dbaccess/source/core/misc/services.cxx b/dbaccess/source/core/misc/services.cxx index 61e9c65d2e59..e1b47a6e831c 100644 --- a/dbaccess/source/core/misc/services.cxx +++ b/dbaccess/source/core/misc/services.cxx @@ -96,22 +96,13 @@ extern "C" void SAL_CALL createRegistryInfo_DBA() } //--------------------------------------------------------------------------------------- - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment ** - ) -{ - createRegistryInfo_DBA(); - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL dba_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey) { + createRegistryInfo_DBA(); + Reference< XInterface > xRet; if (pServiceManager && pImplementationName) { diff --git a/dbaccess/source/ext/adabas/Aservices.cxx b/dbaccess/source/ext/adabas/Aservices.cxx index eb83f464b473..dbe21ca8c9f4 100644 --- a/dbaccess/source/ext/adabas/Aservices.cxx +++ b/dbaccess/source/ext/adabas/Aservices.cxx @@ -57,22 +57,13 @@ extern "C" void SAL_CALL createRegistryInfo_adabasui() } //--------------------------------------------------------------------------------------- - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment ** - ) -{ - createRegistryInfo_adabasui(); - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL adabasui_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* /*pRegistryKey*/) { + createRegistryInfo_adabasui(); + Reference< XInterface > xRet; if (pServiceManager && pImplementationName) { diff --git a/dbaccess/source/ext/adabas/adabasui.component b/dbaccess/source/ext/adabas/adabasui.component index e547a0cffd4e..e9a79b1d59c1 100644 --- a/dbaccess/source/ext/adabas/adabasui.component +++ b/dbaccess/source/ext/adabas/adabasui.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="adabasui" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="org.openoffice.comp.adabasui.AdabasCreateDialog"> <service name="com.sun.star.sdb.AdabasCreationDialog"/> diff --git a/dbaccess/source/ext/adabas/adabasui.dxp b/dbaccess/source/ext/adabas/adabasui.dxp deleted file mode 100644 index 926e49f5f1a5..000000000000 --- a/dbaccess/source/ext/adabas/adabasui.dxp +++ /dev/null @@ -1,3 +0,0 @@ -component_getImplementationEnvironment -component_getFactory - diff --git a/dbaccess/source/ext/adabas/exports.dxp b/dbaccess/source/ext/adabas/exports.dxp deleted file mode 100644 index f0e1c69934bc..000000000000 --- a/dbaccess/source/ext/adabas/exports.dxp +++ /dev/null @@ -1,2 +0,0 @@ -component_getImplementationEnvironment -component_getFactory diff --git a/dbaccess/source/ext/macromigration/dbmm.component b/dbaccess/source/ext/macromigration/dbmm.component index a74e94510aeb..cb91044f5ee6 100644 --- a/dbaccess/source/ext/macromigration/dbmm.component +++ b/dbaccess/source/ext/macromigration/dbmm.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="dbmm" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.dbaccess.macromigration.MacroMigrationDialogService"> <service name="com.sun.star.sdb.application.MacroMigrationWizard"/> diff --git a/dbaccess/source/ext/macromigration/dbmm_services.cxx b/dbaccess/source/ext/macromigration/dbmm_services.cxx index 5d595c63c7bc..c88c6de887d4 100644 --- a/dbaccess/source/ext/macromigration/dbmm_services.cxx +++ b/dbaccess/source/ext/macromigration/dbmm_services.cxx @@ -49,6 +49,11 @@ namespace dbmm } // namespace dbmm //........................................................................ -IMPLEMENT_COMPONENT_LIBRARY_API( ::dbmm::MacroMigrationModule, ::dbmm::initializeModule ) +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL dbmm_component_getFactory( + const sal_Char* pImplementationName, void* pServiceManager, void* pRegistryKey ) +{ + ::dbmm::initializeModule(); + return ::dbmm::MacroMigrationModule::getInstance().getComponentFactory( pImplementationName, pServiceManager, pRegistryKey ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/filter/xml/dbaxml.component b/dbaccess/source/filter/xml/dbaxml.component index 23b3a5c1a776..86816c9f2128 100644 --- a/dbaccess/source/filter/xml/dbaxml.component +++ b/dbaccess/source/filter/xml/dbaxml.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="dbaxml" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.sdb.DBExportFilter"> <service name="com.sun.star.document.ExportFilter"/> diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index bef47dc01ade..a7eb078f8f29 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -120,9 +120,8 @@ namespace dbaxml { ::rtl::Reference< jvmaccess::VirtualMachine > xJVM = ::connectivity::getJavaVM(m_xFactory); } - catch(uno::Exception& ex) + catch (const uno::Exception&) { - (void)ex; OSL_ASSERT(0); } } @@ -167,9 +166,8 @@ namespace dbaxml ::comphelper::disposeComponent(xModel); } } - catch(uno::Exception& ex) + catch (const uno::Exception&) { - (void)ex; OSL_ASSERT(0); } } @@ -268,33 +266,31 @@ sal_Int32 ReadThroughComponent( { xParser->parseStream( aParserInput ); } -#if OSL_DEBUG_LEVEL > 1 - catch( SAXParseException& r ) + catch (const SAXParseException& r) { - ByteString aError( "SAX parse exception catched while importing:\n" ); - aError += ByteString( String( r.Message), RTL_TEXTENCODING_ASCII_US ); - aError += ByteString::CreateFromInt32( r.LineNumber ); - aError += ','; - aError += ByteString::CreateFromInt32( r.ColumnNumber ); - - OSL_FAIL( aError.GetBuffer() ); - return 1; - } +#if OSL_DEBUG_LEVEL > 1 + rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM( + "SAX parse exception catched while importing:\n")); + aError.append(rtl::OUStringToOString(r.Message, + RTL_TEXTENCODING_ASCII_US)); + aError.append(r.LineNumber); + aError.append(','); + aError.append(r.ColumnNumber); + OSL_FAIL(aError.getStr()); #else - catch( SAXParseException& ) - { + (void)r; +#endif return 1; } -#endif - catch( SAXException& ) + catch (const SAXException&) { return 1; } - catch( packages::zip::ZipIOException& ) + catch (const packages::zip::ZipIOException&) { return ERRCODE_IO_BROKENPACKAGE; } - catch( Exception& ) + catch (const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -346,11 +342,11 @@ sal_Int32 ReadThroughComponent( uno::Any aAny = xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) ); aAny >>= bEncrypted; } - catch( packages::WrongPasswordException& ) + catch (const packages::WrongPasswordException&) { return ERRCODE_SFX_WRONGPASSWORD; } - catch ( uno::Exception& ) + catch (const uno::Exception&) { return 1; // TODO/LATER: error handling } @@ -457,7 +453,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) { xStorage.set( pMedium->GetStorage( sal_False ), UNO_QUERY_THROW ); } - catch( const Exception& ) + catch (const Exception&) { Any aError = ::cppu::getCaughtException(); if ( aError.isExtractableTo( ::cppu::UnoType< RuntimeException >::get() ) ) @@ -908,7 +904,7 @@ void ODBFilter::setPropertyInfo() { xDataSource->setPropertyValue(PROPERTY_INFO,makeAny(aInfo)); } - catch(const Exception&) + catch (const Exception&) { DBG_UNHANDLED_EXCEPTION(); } diff --git a/dbaccess/source/filter/xml/xmlservices.cxx b/dbaccess/source/filter/xml/xmlservices.cxx index 93df97d58ca2..119418209286 100644 --- a/dbaccess/source/filter/xml/xmlservices.cxx +++ b/dbaccess/source/filter/xml/xmlservices.cxx @@ -68,22 +68,13 @@ extern "C" void SAL_CALL createRegistryInfo_dbaxml() } //--------------------------------------------------------------------------------------- - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment ** - ) -{ - createRegistryInfo_dbaxml(); - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL dbaxml_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* /*pRegistryKey*/) { + createRegistryInfo_dbaxml(); + Reference< XInterface > xRet; if (pServiceManager && pImplementationName) { diff --git a/dbaccess/source/sdbtools/misc/sdbt_services.cxx b/dbaccess/source/sdbtools/misc/sdbt_services.cxx index 3bef9a0b26b4..9956d7a8d03b 100644 --- a/dbaccess/source/sdbtools/misc/sdbt_services.cxx +++ b/dbaccess/source/sdbtools/misc/sdbt_services.cxx @@ -54,22 +54,13 @@ extern "C" void SAL_CALL sdbt_initializeModule() } //--------------------------------------------------------------------------------------- - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment ** - ) -{ - sdbt_initializeModule(); - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL sdbt_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* /*pRegistryKey*/) { + sdbt_initializeModule(); + Reference< XInterface > xRet; if (pServiceManager && pImplementationName) { diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 74be4d23d182..7f24b7b37fe1 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -100,20 +100,7 @@ using namespace ::com::sun::star::util; namespace { - // ----------------------------------------------------------------------------- - double checkDoubleForDateFormat(double _nValue,sal_Int32 _nFormatKey,const Reference< ::com::sun::star::util::XNumberFormatter>& _xNumberFormatter) - { - double nValue = _nValue; - sal_Int32 nNumberFormat = ::comphelper::getNumberFormatType(_xNumberFormatter,_nFormatKey); - if( (nNumberFormat & ::com::sun::star::util::NumberFormat::DATE) == ::com::sun::star::util::NumberFormat::DATE - || (nNumberFormat & ::com::sun::star::util::NumberFormat::DATETIME) == ::com::sun::star::util::NumberFormat::DATETIME ) - { - nValue = DBTypeConversion::toStandardDbDate(DBTypeConversion::getNULLDate(_xNumberFormatter->getNumberFormatsSupplier()),nValue); - } - return nValue; - } - // ----------------------------------------------------------------------------- template< typename T1, typename T2> void lcl_HideAndDeleteControl(short& _nPos,T1** _pControl,T2** _pControlText) { if ( *_pControl ) diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 464aba52b7df..f9c7ec0fed77 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -42,6 +42,7 @@ #include <unotools/pathoptions.hxx> #include <ucbhelper/content.hxx> #include <svl/filenotation.hxx> +#include <rtl/strbuf.hxx> //......................................................................... @@ -493,14 +494,13 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const // Erst einmal alle Tabellenindizes loeschen ByteString aNDX; sal_uInt16 nKeyCnt = aInfFile.GetKeyCount(); - ByteString aKeyName; ByteString aEntry; sal_uInt16 nKey = 0; while( nKey < nKeyCnt ) { // Verweist der Key auf ein Indexfile?... - aKeyName = aInfFile.GetKeyName( nKey ); + ByteString aKeyName = aInfFile.GetKeyName( nKey ); aNDX = aKeyName.Copy(0,3); //...wenn ja, Indexfile loeschen, nKey steht dann auf nachfolgendem Key @@ -521,10 +521,13 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const ++aIndex, ++nPos ) { - aKeyName = "NDX"; + rtl::OStringBuffer aKeyName(RTL_CONSTASCII_STRINGPARAM("NDX")); if( nPos > 0 ) // Erster Index erhaelt keine Ziffer - aKeyName += ByteString::CreateFromInt32( nPos ); - aInfFile.WriteKey( aKeyName, ByteString(aIndex->GetIndexFileName(), gsl_getSystemTextEncoding()) ); + aKeyName.append(static_cast<sal_Int32>(nPos)); + aInfFile.WriteKey( + aKeyName.makeStringAndClear(), + rtl::OUStringToOString(aIndex->GetIndexFileName(), + gsl_getSystemTextEncoding())); } aInfFile.Flush(); diff --git a/dbaccess/source/ui/misc/uiservices.cxx b/dbaccess/source/ui/misc/uiservices.cxx index dfce75ace0df..68405fcaadcd 100644 --- a/dbaccess/source/ui/misc/uiservices.cxx +++ b/dbaccess/source/ui/misc/uiservices.cxx @@ -107,22 +107,13 @@ extern "C" void SAL_CALL createRegistryInfo_DBU() } //--------------------------------------------------------------------------------------- - -extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( - const sal_Char **ppEnvTypeName, - uno_Environment ** - ) -{ - createRegistryInfo_DBU(); - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -//--------------------------------------------------------------------------------------- -extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( +extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL dbu_component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, void* /*pRegistryKey*/) { + createRegistryInfo_DBU(); + Reference< XInterface > xRet; if (pServiceManager && pImplementationName) { diff --git a/dbaccess/util/dba.component b/dbaccess/util/dba.component index b25768dbfab6..5b5155a6c604 100644 --- a/dbaccess/util/dba.component +++ b/dbaccess/util/dba.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="dba" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.chart2.data.DatabaseDataProvider"> <service name="com.sun.star.chart2.data.DatabaseDataProvider"/> diff --git a/dbaccess/util/dbu.component b/dbaccess/util/dbu.component index ce0dc45cf0be..e5260ed164e9 100644 --- a/dbaccess/util/dbu.component +++ b/dbaccess/util/dbu.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="dbu" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.dbaccess.DatabaseInteractionHandler"> <service name="com.sun.star.sdb.DatabaseInteractionHandler"/> diff --git a/dbaccess/util/sdbt.component b/dbaccess/util/sdbt.component index 0038c0cad27f..9c0dec30405f 100644 --- a/dbaccess/util/sdbt.component +++ b/dbaccess/util/sdbt.component @@ -26,7 +26,7 @@ * **********************************************************************--> -<component loader="com.sun.star.loader.SharedLibrary" +<component loader="com.sun.star.loader.SharedLibrary" prefix="sdbt" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.dbaccess.ConnectionTools"> <service name="com.sun.star.sdb.tools.ConnectionTools"/> |