summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk7
-rw-r--r--connectivity/inc/connectivity/TTableHelper.hxx9
-rw-r--r--connectivity/inc/connectivity/dbtools.hxx27
-rw-r--r--connectivity/inc/connectivity/formattedcolumnvalue.hxx14
-rw-r--r--connectivity/source/commontools/TIndexes.cxx164
-rw-r--r--connectivity/source/commontools/TKeys.cxx154
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx121
-rw-r--r--connectivity/source/commontools/dbtools.cxx4
-rw-r--r--connectivity/source/commontools/dbtools2.cxx32
-rw-r--r--connectivity/source/commontools/formattedcolumnvalue.cxx90
-rw-r--r--connectivity/source/cpool/dbpool.map8
-rw-r--r--connectivity/source/cpool/makefile.mk2
-rw-r--r--connectivity/source/dbtools/dbt.map8
-rw-r--r--connectivity/source/drivers/adabas/adabas.map8
-rw-r--r--connectivity/source/drivers/adabas/makefile.mk2
-rwxr-xr-xconnectivity/source/drivers/ado/ado.xcu5
-rw-r--r--connectivity/source/drivers/calc/calc.map8
-rw-r--r--connectivity/source/drivers/calc/makefile.mk2
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx1
-rw-r--r--connectivity/source/drivers/dbase/dbase.map10
-rw-r--r--connectivity/source/drivers/dbase/makefile.mk2
-rw-r--r--connectivity/source/drivers/evoab/evoab.map8
-rw-r--r--connectivity/source/drivers/evoab/makefile.mk2
-rw-r--r--connectivity/source/drivers/evoab2/evoab2.map8
-rw-r--r--connectivity/source/drivers/evoab2/makefile.mk2
-rw-r--r--connectivity/source/drivers/flat/flat.map8
-rw-r--r--connectivity/source/drivers/flat/makefile.mk2
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/JStatement.cxx68
-rw-r--r--connectivity/source/drivers/jdbc/jdbc.map8
-rw-r--r--connectivity/source/drivers/jdbc/makefile.mk2
-rw-r--r--connectivity/source/drivers/kab/kab.map8
-rw-r--r--connectivity/source/drivers/kab/kabdrv.map2
-rw-r--r--connectivity/source/drivers/kab/makefile.mk2
-rwxr-xr-xconnectivity/source/drivers/macab/MacabConnection.cxx3
-rwxr-xr-xconnectivity/source/drivers/macab/MacabServices.cxx6
-rwxr-xr-xconnectivity/source/drivers/macab/macab.map8
-rwxr-xr-xconnectivity/source/drivers/macab/macab.xcu2
-rwxr-xr-xconnectivity/source/drivers/macab/macabdrv.map6
-rwxr-xr-xconnectivity/source/drivers/macab/makefile.mk4
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx6
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx1
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/makefile.mk2
-rw-r--r--connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map8
-rw-r--r--connectivity/source/drivers/mozab/makefile.mk2
-rw-r--r--connectivity/source/drivers/mozab/mozab.map8
-rw-r--r--connectivity/source/drivers/mozab/mozabdrv.map2
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx4
-rw-r--r--connectivity/source/drivers/mysql/YTables.cxx19
-rw-r--r--connectivity/source/drivers/mysql/makefile.mk2
-rw-r--r--connectivity/source/drivers/mysql/mysql.map8
-rw-r--r--connectivity/source/drivers/odbc/makefile.mk2
-rw-r--r--connectivity/source/drivers/odbc/odbc.map8
-rw-r--r--connectivity/source/drivers/odbcbase/OResultSet.cxx28
-rw-r--r--connectivity/source/inc/mysql/YTables.hxx5
-rw-r--r--connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx2
-rw-r--r--connectivity/source/inc/odbc/OResultSet.hxx1
-rw-r--r--connectivity/source/manager/makefile.mk2
-rw-r--r--connectivity/source/manager/mdrivermanager.cxx2
-rw-r--r--connectivity/source/manager/sdbc.map8
-rw-r--r--connectivity/source/parse/sqlflex.l2
61 files changed, 511 insertions, 440 deletions
diff --git a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
index 4976a7d607..ce9581b934 100644
--- a/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
+++ b/connectivity/com/sun/star/sdbcx/comp/hsqldb/makefile.mk
@@ -38,10 +38,9 @@ SECONDARY_PACKAGE = org$/hsqldb$/lib
.IF "$(SYSTEM_HSQLDB)" == "YES"
-XCLASSPATH!:=$(XCLASSPATH)$(PATH_SEPERATOR)$(HSQLDB_JAR)
-JARFILES+= $(HSQLDB_JAR)
+EXTRAJARFILES = $(HSQLDB_JAR)
.ELSE
-JARFILES+= hsqldb.jar
+JARFILES = hsqldb.jar
.ENDIF
JAVAFILES =\
@@ -60,7 +59,7 @@ JAVACLASSFILES = $(foreach,i,$(JAVAFILES) $(CLASSDIR)$/$(PACKAGE)$/$(i:b).class
JARCOMPRESS = TRUE
JARCLASSDIRS = $(PACKAGE) $(SECONDARY_PACKAGE)
JARTARGET = $(TARGET).jar
-JARCLASSPATH = $(JARFILES) ..
+JARCLASSPATH = $(JARFILES) $(EXTRAJARFILES) ..
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/connectivity/inc/connectivity/TTableHelper.hxx b/connectivity/inc/connectivity/TTableHelper.hxx
index a896d0a0ce..db220ffe1a 100644
--- a/connectivity/inc/connectivity/TTableHelper.hxx
+++ b/connectivity/inc/connectivity/TTableHelper.hxx
@@ -33,6 +33,10 @@
#include "connectivity/sdbcx/VKey.hxx"
#include "connectivity/StdTypeDefs.hxx"
#include <comphelper/stl_types.hxx>
+#include <com/sun/star/sdb/tools/XTableRename.hpp>
+#include <com/sun/star/sdb/tools/XTableAlteration.hpp>
+#include <com/sun/star/sdb/tools/XKeyAlteration.hpp>
+#include <com/sun/star/sdb/tools/XIndexAlteration.hpp>
namespace connectivity
{
@@ -155,6 +159,11 @@ namespace connectivity
void addKey(const ::rtl::OUString& _sName,const sdbcx::TKeyProperties& _aKeyProperties);
virtual ::rtl::OUString getTypeCreatePattern() const;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableRename> getRenameService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableAlteration> getAlterService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XKeyAlteration> getKeyService() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XIndexAlteration> getIndexService() const;
};
}
#endif // CONNECTIVITY_TABLEHELPER_HXX
diff --git a/connectivity/inc/connectivity/dbtools.hxx b/connectivity/inc/connectivity/dbtools.hxx
index 27d788653b..829a0ff774 100644
--- a/connectivity/inc/connectivity/dbtools.hxx
+++ b/connectivity/inc/connectivity/dbtools.hxx
@@ -350,6 +350,33 @@ namespace dbtools
,const ::rtl::OUString& _sProperty,
sal_Bool _bDefault = sal_False);
+ /** retrieves a particular indirect data source setting
+
+ @param _rxDataSource
+ a data source component
+ @param _pAsciiSettingsName
+ the ASCII name of the setting to obtain
+ @param _rSettingsValue
+ the value of the setting, upon successfull return
+
+ @return
+ <FALSE/> if the setting is not present in the <member scope="com::sun::star::sdb">DataSource::Info</member>
+ member of the data source
+ <TRUE/> otherwise
+ */
+ OOO_DLLPUBLIC_DBTOOLS
+ bool getDataSourceSetting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource,
+ const sal_Char* _pAsciiSettingsName,
+ ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
+ );
+ OOO_DLLPUBLIC_DBTOOLS
+ bool getDataSourceSetting(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDataSource,
+ const ::rtl::OUString& _sSettingsName,
+ ::com::sun::star::uno::Any& /* [out] */ _rSettingsValue
+ );
+
OOO_DLLPUBLIC_DBTOOLS ::rtl::OUString getDefaultReportEngineServiceName(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
/** quote the given name with the given quote string.
diff --git a/connectivity/inc/connectivity/formattedcolumnvalue.hxx b/connectivity/inc/connectivity/formattedcolumnvalue.hxx
index f131141eba..0d146f953c 100644
--- a/connectivity/inc/connectivity/formattedcolumnvalue.hxx
+++ b/connectivity/inc/connectivity/formattedcolumnvalue.hxx
@@ -33,6 +33,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/sdb/XColumn.hpp>
#include <com/sun/star/sdb/XColumnUpdate.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
/** === end UNO includes === **/
#include <boost/noncopyable.hpp>
@@ -74,6 +75,19 @@ namespace dbtools
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn
);
+ /** constructs an instance
+
+ The format key for the string value exchange is taken from the given column object.
+ If it has a non-<NULL/> property value <code>FormatKey</code>, this key is taken.
+ Otherwise, a default format matching the column type is determined.
+
+ The locale of this fallback format is the current system locale.
+ */
+ FormattedColumnValue(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& i_rNumberFormatter,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_rColumn
+ );
+
// note that all methods of this class need to be virtual, since it's
// used in a load-on-demand context in module SVX
diff --git a/connectivity/source/commontools/TIndexes.cxx b/connectivity/source/commontools/TIndexes.cxx
index 73d242bb1d..e979262e8c 100644
--- a/connectivity/source/commontools/TIndexes.cxx
+++ b/connectivity/source/commontools/TIndexes.cxx
@@ -140,73 +140,80 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const ::rtl::OUString& _rForName
if ( m_pTable->isNew() )
return cloneDescriptor( descriptor );
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- ::rtl::OUStringBuffer aSql( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE ")));
- ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString aDot = ::rtl::OUString::createFromAscii(".");
+ if ( m_pTable->getIndexService().is() )
+ {
+ m_pTable->getIndexService()->addIndex(m_pTable,descriptor);
+ }
+ else
+ {
+ ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
+ ::rtl::OUStringBuffer aSql( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CREATE ")));
+ ::rtl::OUString aQuote = m_pTable->getMetaData()->getIdentifierQuoteString( );
+ ::rtl::OUString aDot = ::rtl::OUString::createFromAscii(".");
- if(comphelper::getBOOL(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISUNIQUE))))
- aSql.appendAscii("UNIQUE ");
- aSql.appendAscii("INDEX ");
+ if(comphelper::getBOOL(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISUNIQUE))))
+ aSql.appendAscii("UNIQUE ");
+ aSql.appendAscii("INDEX ");
-
- ::rtl::OUString aCatalog,aSchema,aTable;
- dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation);
- ::rtl::OUString aComposedName;
-
- aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions);
- if ( _rForName.getLength() )
- {
- aSql.append( ::dbtools::quoteName( aQuote, _rForName ) );
- aSql.appendAscii(" ON ");
- aSql.append(aComposedName);
- aSql.appendAscii(" ( ");
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" );
- sal_Int32 nCount = xColumns->getCount();
- for(sal_Int32 i = 0 ; i < nCount; ++i)
+
+ ::rtl::OUString aCatalog,aSchema,aTable;
+ dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::eInDataManipulation);
+ ::rtl::OUString aComposedName;
+
+ aComposedName = dbtools::composeTableName(m_pTable->getMetaData(),aCatalog,aSchema,aTable,sal_True,::dbtools::eInIndexDefinitions);
+ if ( _rForName.getLength() )
{
- xColProp.set(xColumns->getByIndex(i),UNO_QUERY);
- aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
-
- if ( bAddIndexAppendix )
- {
-
- aSql.appendAscii(any2bool(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISASCENDING)))
- ?
- " ASC"
- :
- " DESC");
+ aSql.append( ::dbtools::quoteName( aQuote, _rForName ) );
+ aSql.appendAscii(" ON ");
+ aSql.append(aComposedName);
+ aSql.appendAscii(" ( ");
+
+ Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
+ Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
+ Reference< XPropertySet > xColProp;
+ sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" );
+ sal_Int32 nCount = xColumns->getCount();
+ for(sal_Int32 i = 0 ; i < nCount; ++i)
+ {
+ xColProp.set(xColumns->getByIndex(i),UNO_QUERY);
+ aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
+
+ if ( bAddIndexAppendix )
+ {
+
+ aSql.appendAscii(any2bool(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISASCENDING)))
+ ?
+ " ASC"
+ :
+ " DESC");
+ }
+ aSql.appendAscii(",");
}
- aSql.appendAscii(",");
+ aSql.setCharAt(aSql.getLength()-1,')');
}
- aSql.setCharAt(aSql.getLength()-1,')');
- }
- else
- {
- aSql.append(aComposedName);
+ else
+ {
+ aSql.append(aComposedName);
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- if(xColumns->getCount() != 1)
- throw SQLException();
+ Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
+ Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
+ Reference< XPropertySet > xColProp;
+ if(xColumns->getCount() != 1)
+ throw SQLException();
- xColumns->getByIndex(0) >>= xColProp;
+ xColumns->getByIndex(0) >>= xColProp;
- aSql.append(aDot);
- aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
- }
+ aSql.append(aDot);
+ aSql.append(::dbtools::quoteName( aQuote,comphelper::getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))));
+ }
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- ::rtl::OUString sSql = aSql.makeStringAndClear();
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ if ( xStmt.is() )
+ {
+ ::rtl::OUString sSql = aSql.makeStringAndClear();
+ xStmt->execute(sSql);
+ ::comphelper::disposeComponent(xStmt);
+ }
}
return createObject( _rForName );
@@ -218,27 +225,34 @@ void OIndexesHelper::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElem
Reference< XConnection> xConnection = m_pTable->getConnection();
if( xConnection.is() && !m_pTable->isNew())
{
- ::rtl::OUString aName,aSchema;
- sal_Int32 nLen = _sElementName.indexOf('.');
- if(nLen != -1)
- aSchema = _sElementName.copy(0,nLen);
- aName = _sElementName.copy(nLen+1);
+ if ( m_pTable->getIndexService().is() )
+ {
+ m_pTable->getIndexService()->dropIndex(m_pTable,_sElementName);
+ }
+ else
+ {
+ ::rtl::OUString aName,aSchema;
+ sal_Int32 nLen = _sElementName.indexOf('.');
+ if(nLen != -1)
+ aSchema = _sElementName.copy(0,nLen);
+ aName = _sElementName.copy(nLen+1);
- ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP INDEX ");
+ ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP INDEX ");
- ::rtl::OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true );
- ::rtl::OUString sIndexName,sTemp;
- sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions );
+ ::rtl::OUString aComposedName = dbtools::composeTableName( m_pTable->getMetaData(), m_pTable, ::dbtools::eInIndexDefinitions, false, false, true );
+ ::rtl::OUString sIndexName,sTemp;
+ sIndexName = dbtools::composeTableName( m_pTable->getMetaData(), sTemp, aSchema, aName, sal_True, ::dbtools::eInIndexDefinitions );
- aSql += sIndexName
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "))
- + aComposedName;
+ aSql += sIndexName
+ + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ON "))
+ + aComposedName;
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ if ( xStmt.is() )
+ {
+ xStmt->execute(aSql);
+ ::comphelper::disposeComponent(xStmt);
+ }
}
}
}
diff --git a/connectivity/source/commontools/TKeys.cxx b/connectivity/source/commontools/TKeys.cxx
index dc16a51cff..865e51ae03 100644
--- a/connectivity/source/commontools/TKeys.cxx
+++ b/connectivity/source/commontools/TKeys.cxx
@@ -147,69 +147,80 @@ sdbcx::ObjectType OKeysHelper::appendObject( const ::rtl::OUString& _rForName, c
return xNewDescriptor;
}
- // if we're here, we belong to a table which is not new, i.e. already exists in the database.
- // In this case, really append the new index.
-
const ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
sal_Int32 nKeyType = getINT32(descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)));
+ sal_Int32 nUpdateRule = 0, nDeleteRule = 0;
+ ::rtl::OUString sReferencedName;
- ::rtl::OUString aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
- ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString aDot = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
-
- aSql += composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true );
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ADD "));
-
- if ( nKeyType == KeyType::PRIMARY )
+ if ( nKeyType == KeyType::FOREIGN )
{
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" PRIMARY KEY ("));
+ descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)) >>= sReferencedName;
+ descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_UPDATERULE)) >>= nUpdateRule;
+ descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)) >>= nDeleteRule;
}
- else if ( nKeyType == KeyType::FOREIGN )
+
+ if ( m_pTable->getKeyService().is() )
{
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FOREIGN KEY ("));
+ m_pTable->getKeyService()->addKey(m_pTable,descriptor);
}
else
- throw SQLException();
-
- Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
- Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
- Reference< XPropertySet > xColProp;
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
{
- ::cppu::extractInterface(xColProp,xColumns->getByIndex(i));
- aSql += ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
- }
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
+ // if we're here, we belong to a table which is not new, i.e. already exists in the database.
+ // In this case, really append the new index.
+ ::rtl::OUStringBuffer aSql;
+ aSql.appendAscii("ALTER TABLE ");
+ ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString( );
+ ::rtl::OUString aDot = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("."));
- sal_Int32 nUpdateRule = 0, nDeleteRule = 0;
- ::rtl::OUString sReferencedName;
+ aSql.append(composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable, ::dbtools::eInTableDefinitions, false, false, true ));
+ aSql.appendAscii(" ADD ");
- if ( nKeyType == KeyType::FOREIGN )
- {
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_REFERENCEDTABLE)) >>= sReferencedName;
-
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" REFERENCES "))
- + ::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions);
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ("));
+ if ( nKeyType == KeyType::PRIMARY )
+ {
+ aSql.appendAscii(" PRIMARY KEY (");
+ }
+ else if ( nKeyType == KeyType::FOREIGN )
+ {
+ aSql.appendAscii(" FOREIGN KEY (");
+ }
+ else
+ throw SQLException();
- for(sal_Int32 i=0;i<xColumns->getCount();++i)
+ Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY);
+ Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY);
+ Reference< XPropertySet > xColProp;
+ for(sal_Int32 i = 0 ; i < xColumns->getCount() ; ++i)
{
- xColumns->getByIndex(i) >>= xColProp;
- aSql += ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN))))
- + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(","));
+ if ( i > 0 )
+ aSql.appendAscii(",");
+ ::cppu::extractInterface(xColProp,xColumns->getByIndex(i));
+ aSql.append( ::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)))) );
+
}
- aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")));
+ aSql.appendAscii(")");
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_UPDATERULE)) >>= nUpdateRule;
- descriptor->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_DELETERULE)) >>= nDeleteRule;
+ if ( nKeyType == KeyType::FOREIGN )
+ {
+ aSql.appendAscii(" REFERENCES ");
+ aSql.append(::dbtools::quoteTableName(m_pTable->getConnection()->getMetaData(),sReferencedName,::dbtools::eInTableDefinitions));
+ aSql.appendAscii(" (");
- aSql += getKeyRuleString(sal_True ,nUpdateRule);
- aSql += getKeyRuleString(sal_False ,nDeleteRule);
- }
+ for(sal_Int32 i=0;i<xColumns->getCount();++i)
+ {
+ if ( i > 0 )
+ aSql.appendAscii(",");
+ xColumns->getByIndex(i) >>= xColProp;
+ aSql.append(::dbtools::quoteName( aQuote,getString(xColProp->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_RELATEDCOLUMN)))));
+
+ }
+ aSql.appendAscii(")");
+ aSql.append(getKeyRuleString(sal_True ,nUpdateRule));
+ aSql.append(getKeyRuleString(sal_False ,nDeleteRule));
+ }
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- xStmt->execute(aSql);
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ xStmt->execute(aSql.makeStringAndClear());
+ }
// find the name which the database gave the new key
::rtl::OUString sNewName( _rForName );
try
@@ -266,34 +277,41 @@ void OKeysHelper::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName
Reference< XConnection> xConnection = m_pTable->getConnection();
if ( xConnection.is() && !m_pTable->isNew() )
{
- ::rtl::OUString aSql = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ALTER TABLE "));
-
- aSql += composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true );
-
Reference<XPropertySet> xKey(getObject(_nPos),UNO_QUERY);
-
- sal_Int32 nKeyType = KeyType::PRIMARY;
- if ( xKey.is() )
+ if ( m_pTable->getKeyService().is() )
{
- ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
- xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nKeyType;
- }
- if ( KeyType::PRIMARY == nKeyType )
- {
- aSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DROP PRIMARY KEY"));
+ m_pTable->getKeyService()->dropKey(m_pTable,xKey);
}
else
{
- aSql += getDropForeignKey();
- const ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString();
- aSql += ::dbtools::quoteName( aQuote,_sElementName);
- }
+ ::rtl::OUStringBuffer aSql;
+ aSql.appendAscii("ALTER TABLE ");
- Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(aSql);
- ::comphelper::disposeComponent(xStmt);
+ aSql.append( composeTableName( m_pTable->getConnection()->getMetaData(), m_pTable,::dbtools::eInTableDefinitions, false, false, true ));
+
+ sal_Int32 nKeyType = KeyType::PRIMARY;
+ if ( xKey.is() )
+ {
+ ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap();
+ xKey->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPE)) >>= nKeyType;
+ }
+ if ( KeyType::PRIMARY == nKeyType )
+ {
+ aSql.appendAscii(" DROP PRIMARY KEY");
+ }
+ else
+ {
+ aSql.append(getDropForeignKey());
+ const ::rtl::OUString aQuote = m_pTable->getConnection()->getMetaData()->getIdentifierQuoteString();
+ aSql.append( ::dbtools::quoteName( aQuote,_sElementName) );
+ }
+
+ Reference< XStatement > xStmt = m_pTable->getConnection()->createStatement( );
+ if ( xStmt.is() )
+ {
+ xStmt->execute(aSql.makeStringAndClear());
+ ::comphelper::disposeComponent(xStmt);
+ }
}
}
}
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index b8e19073d4..0be2c930a2 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -95,14 +95,53 @@ public:
}
namespace connectivity
{
+ ::rtl::OUString lcl_getServiceNameForSetting(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,const ::rtl::OUString& i_sSetting)
+ {
+ ::rtl::OUString sSupportService;
+ Any aValue;
+ if ( ::dbtools::getDataSourceSetting(_xConnection,i_sSetting,aValue) )
+ {
+ aValue >>= sSupportService;
+ }
+ return sSupportService;
+ }
struct OTableHelperImpl
{
TKeyMap m_aKeys;
- Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
+ // helper services which can be provided by extensions
+ Reference< ::com::sun::star::sdb::tools::XTableRename> m_xRename;
+ Reference< ::com::sun::star::sdb::tools::XTableAlteration> m_xAlter;
+ Reference< ::com::sun::star::sdb::tools::XKeyAlteration> m_xKeyAlter;
+ Reference< ::com::sun::star::sdb::tools::XIndexAlteration> m_xIndexAlter;
+
+ Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
::comphelper::ImplementationReference< OTableContainerListener,XContainerListener>
m_xTablePropertyListener;
::std::vector< ColumnDesc > m_aColumnDesc;
+ OTableHelperImpl(const Reference< ::com::sun::star::sdbc::XConnection >& _xConnection)
+ : m_xConnection(_xConnection)
+ {
+ try
+ {
+ m_xMetaData = m_xConnection->getMetaData();
+ Reference<XMultiServiceFactory> xFac(_xConnection,UNO_QUERY);
+ if ( xFac.is() )
+ {
+ static const ::rtl::OUString s_sTableRename(RTL_CONSTASCII_USTRINGPARAM("TableRenameServiceName"));
+ m_xRename.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableRename)),UNO_QUERY);
+ static const ::rtl::OUString s_sTableAlteration(RTL_CONSTASCII_USTRINGPARAM("TableAlterationServiceName"));
+ m_xAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sTableAlteration)),UNO_QUERY);
+ static const ::rtl::OUString s_sKeyAlteration(RTL_CONSTASCII_USTRINGPARAM("KeyAlterationServiceName"));
+ m_xKeyAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sKeyAlteration)),UNO_QUERY);
+ static const ::rtl::OUString s_sIndexAlteration(RTL_CONSTASCII_USTRINGPARAM("IndexAlterationServiceName"));
+ m_xIndexAlter.set(xFac->createInstance(lcl_getServiceNameForSetting(m_xConnection,s_sIndexAlteration)),UNO_QUERY);
+ }
+ }
+ catch(const Exception&)
+ {
+ }
+ }
};
}
@@ -110,16 +149,8 @@ OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
const Reference< XConnection >& _xConnection,
sal_Bool _bCase)
:OTable_TYPEDEF(_pTables,_bCase)
- ,m_pImpl(new OTableHelperImpl)
-{
- try
- {
- m_pImpl->m_xConnection = _xConnection;
- m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData();
- }
- catch(const Exception&)
- {
- }
+ ,m_pImpl(new OTableHelperImpl(_xConnection))
+{
}
// -------------------------------------------------------------------------
OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
@@ -137,16 +168,8 @@ OTableHelper::OTableHelper( sdbcx::OCollection* _pTables,
_Description,
_SchemaName,
_CatalogName)
- ,m_pImpl(new OTableHelperImpl)
+ ,m_pImpl(new OTableHelperImpl(_xConnection))
{
- try
- {
- m_pImpl->m_xConnection = _xConnection;
- m_pImpl->m_xMetaData = m_pImpl->m_xConnection->getMetaData();
- }
- catch(const Exception&)
- {
- }
}
// -----------------------------------------------------------------------------
OTableHelper::~OTableHelper()
@@ -480,24 +503,31 @@ void SAL_CALL OTableHelper::rename( const ::rtl::OUString& newName ) throw(SQLEx
if(!isNew())
{
- ::rtl::OUString sSql = getRenameStart();
- ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
+ if ( m_pImpl->m_xRename.is() )
+ {
+ m_pImpl->m_xRename->rename(this,newName);
+ }
+ else
+ {
+ ::rtl::OUString sSql = getRenameStart();
+ ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
- ::rtl::OUString sCatalog,sSchema,sTable;
- ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
+ ::rtl::OUString sCatalog,sSchema,sTable;
+ ::dbtools::qualifiedNameComponents(getMetaData(),newName,sCatalog,sSchema,sTable,::dbtools::eInDataManipulation);
- ::rtl::OUString sComposedName;
- sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation);
- sSql += sComposedName
- + ::rtl::OUString::createFromAscii(" TO ");
- sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation);
- sSql += sComposedName;
+ ::rtl::OUString sComposedName;
+ sComposedName = ::dbtools::composeTableName(getMetaData(),m_CatalogName,m_SchemaName,m_Name,sal_True,::dbtools::eInDataManipulation);
+ sSql += sComposedName
+ + ::rtl::OUString::createFromAscii(" TO ");
+ sComposedName = ::dbtools::composeTableName(getMetaData(),sCatalog,sSchema,sTable,sal_True,::dbtools::eInDataManipulation);
+ sSql += sComposedName;
- Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( );
- if ( xStmt.is() )
- {
- xStmt->execute(sSql);
- ::comphelper::disposeComponent(xStmt);
+ Reference< XStatement > xStmt = m_pImpl->m_xConnection->createStatement( );
+ if ( xStmt.is() )
+ {
+ xStmt->execute(sSql);
+ ::comphelper::disposeComponent(xStmt);
+ }
}
OTable_TYPEDEF::rename(newName);
@@ -576,3 +606,24 @@ Reference< XConnection> OTableHelper::getConnection() const
{
return m_pImpl->m_xConnection;
}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XTableRename> OTableHelper::getRenameService() const
+{
+ return m_pImpl->m_xRename;
+}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XTableAlteration> OTableHelper::getAlterService() const
+{
+ return m_pImpl->m_xAlter;
+}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XKeyAlteration> OTableHelper::getKeyService() const
+{
+ return m_pImpl->m_xKeyAlter;
+}
+// -----------------------------------------------------------------------------
+Reference< ::com::sun::star::sdb::tools::XIndexAlteration> OTableHelper::getIndexService() const
+{
+ return m_pImpl->m_xIndexAlter;
+}
+// -----------------------------------------------------------------------------
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index ba926613d9..7011665ab3 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -318,8 +318,8 @@ Reference< XConnection > getConnection_allowException(
Reference<XCompletedConnection> xConnectionCompletion(xProp, UNO_QUERY);
if (xConnectionCompletion.is())
{ // instantiate the default SDB interaction handler
- Reference< XInteractionHandler > xHandler(_rxFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.sdb.InteractionHandler")), UNO_QUERY);
- OSL_ENSURE(xHandler.is(), "dbtools::getConnection service com.sun.star.sdb.InteractionHandler not available!");
+ Reference< XInteractionHandler > xHandler(_rxFactory->createInstance(::rtl::OUString::createFromAscii("com.sun.star.task.InteractionHandler")), UNO_QUERY);
+ OSL_ENSURE(xHandler.is(), "dbtools::getConnection service com.sun.star.task.InteractionHandler not available!");
if (xHandler.is())
{
xConnection = xConnectionCompletion->connectWithCompletion(xHandler);
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 5e6a1063cf..3a9f97f0d0 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -593,7 +593,39 @@ bool getBooleanDataSourceSetting( const Reference< XConnection >& _rxConnection,
}
return bValue;
}
+// -------------------------------------------------------------------------
+bool getDataSourceSetting( const Reference< XInterface >& _xChild, const ::rtl::OUString& _sAsciiSettingsName,
+ Any& /* [out] */ _rSettingsValue )
+{
+ bool bIsPresent = false;
+ try
+ {
+ const Reference< XPropertySet> xDataSourceProperties( findDataSource( _xChild ), UNO_QUERY );
+ OSL_ENSURE( xDataSourceProperties.is(), "getDataSourceSetting: invalid data source object!" );
+ if ( !xDataSourceProperties.is() )
+ return false;
+
+ const Reference< XPropertySet > xSettings(
+ xDataSourceProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings") ) ),
+ UNO_QUERY_THROW
+ );
+ _rSettingsValue = xSettings->getPropertyValue( _sAsciiSettingsName );
+ bIsPresent = true;
+ }
+ catch( const Exception& )
+ {
+ bIsPresent = false;
+ }
+ return bIsPresent;
+}
+// -------------------------------------------------------------------------
+bool getDataSourceSetting( const Reference< XInterface >& _rxDataSource, const sal_Char* _pAsciiSettingsName,
+ Any& /* [out] */ _rSettingsValue )
+{
+ ::rtl::OUString sAsciiSettingsName = ::rtl::OUString::createFromAscii(_pAsciiSettingsName);
+ return getDataSourceSetting( _rxDataSource, sAsciiSettingsName,_rSettingsValue );
+}
// -----------------------------------------------------------------------------
sal_Bool isDataSourcePropertyEnabled(const Reference<XInterface>& _xProp,const ::rtl::OUString& _sProperty,sal_Bool _bDefault)
{
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index ac965e1037..90bb97ac1d 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -42,13 +42,11 @@
/** === end UNO includes === **/
//#include <unotools/syslocale.hxx>
-
#include <tools/diagnose_ex.h>
-
#include <i18npool/mslangid.hxx>
-
#include <comphelper/numbers.hxx>
#include <comphelper/componentcontext.hxx>
+#include <unotools/sharedunocomponent.hxx>
//........................................................................
namespace dbtools
@@ -59,6 +57,7 @@ namespace dbtools
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::UNO_SET_THROW;
using ::com::sun::star::uno::Exception;
using ::com::sun::star::uno::RuntimeException;
using ::com::sun::star::uno::Any;
@@ -113,21 +112,7 @@ namespace dbtools
//................................................................
void lcl_clear_nothrow( FormattedColumnValue_Data& _rData )
{
- if ( _rData.m_xFormatter.is() )
- {
- try
- {
- Reference< XComponent > xFormatterComp( _rData.m_xFormatter, UNO_QUERY );
- if ( xFormatterComp.is() )
- xFormatterComp->dispose();
- }
- catch( const Exception& )
- {
- DBG_UNHANDLED_EXCEPTION();
- }
- _rData.m_xFormatter.clear();
- }
-
+ _rData.m_xFormatter.clear();
_rData.m_nFormatKey = 0;
_rData.m_nFieldType = DataType::OTHER;
_rData.m_nKeyType = NumberFormat::UNDEFINED;
@@ -138,21 +123,24 @@ namespace dbtools
}
//................................................................
- void lcl_initColumnDataValue_nothrow( const ::comphelper::ComponentContext& _rContext, FormattedColumnValue_Data& _rData,
- const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& _rxColumn )
+ void lcl_initColumnDataValue_nothrow( FormattedColumnValue_Data& _rData,
+ const Reference< XNumberFormatter >& i_rNumberFormatter, const Reference< XPropertySet >& _rxColumn )
{
lcl_clear_nothrow( _rData );
- OSL_PRECOND( _rxRowSet.is(), "lcl_initColumnDataValue_nothrow: no row set!" );
- OSL_PRECOND( _rxColumn.is(), "lcl_initColumnDataValue_nothrow: no column!" );
- if ( !_rxRowSet.is() || !_rxColumn.is() )
+ OSL_PRECOND( i_rNumberFormatter.is(), "lcl_initColumnDataValue_nothrow: no number formats -> no formatted values!" );
+ if ( !i_rNumberFormatter.is() )
return;
try
{
+ Reference< XNumberFormatsSupplier > xNumberFormatsSupp( i_rNumberFormatter->getNumberFormatsSupplier(), UNO_SET_THROW );
+
+ // remember the column
_rData.m_xColumn.set( _rxColumn, UNO_QUERY_THROW );
_rData.m_xColumnUpdate.set( _rxColumn, UNO_QUERY );
+ // determine the field type, and whether it's a numeric field
OSL_VERIFY( _rxColumn->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Type" ) ) ) >>= _rData.m_nFieldType );
switch ( _rData.m_nFieldType )
@@ -177,10 +165,6 @@ namespace dbtools
break;
}
- // get the number formats supplier of the connection of the form
- Reference< XConnection > xConnection( getConnection( _rxRowSet ), UNO_QUERY_THROW );
- Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_False, _rContext.getLegacyServiceFactory() ), UNO_QUERY_THROW );
-
// get the format key of our bound field
Reference< XPropertySetInfo > xPSI( _rxColumn->getPropertySetInfo(), UNO_QUERY_THROW );
bool bHaveFieldFormat = false;
@@ -194,23 +178,49 @@ namespace dbtools
// fall back to a format key as indicated by the field type
Locale aSystemLocale;
MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage(), aSystemLocale );
- Reference< XNumberFormatTypes > xNumTypes( xSupplier->getNumberFormats(), UNO_QUERY_THROW );
+ Reference< XNumberFormatTypes > xNumTypes( xNumberFormatsSupp->getNumberFormats(), UNO_QUERY_THROW );
_rData.m_nFormatKey = getDefaultNumberFormat( _rxColumn, xNumTypes, aSystemLocale );
}
// some more formatter settings
- _rData.m_nKeyType = ::comphelper::getNumberFormatType( xSupplier->getNumberFormats(), _rData.m_nFormatKey );
- Reference< XPropertySet > xFormatSettings( xSupplier->getNumberFormatSettings(), UNO_QUERY_THROW );
+ _rData.m_nKeyType = ::comphelper::getNumberFormatType( xNumberFormatsSupp->getNumberFormats(), _rData.m_nFormatKey );
+ Reference< XPropertySet > xFormatSettings( xNumberFormatsSupp->getNumberFormatSettings(), UNO_QUERY_THROW );
OSL_VERIFY( xFormatSettings->getPropertyValue( ::rtl::OUString::createFromAscii( "NullDate" ) ) >>= _rData.m_aNullDate );
- // create a formatter working with the connection's number format supplier
- _rData.m_xFormatter.set( _rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW );
- _rData.m_xFormatter->attachNumberFormatsSupplier( xSupplier );
+ // remember the formatter
+ _rData.m_xFormatter = i_rNumberFormatter;
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ }
+
+ //................................................................
+ void lcl_initColumnDataValue_nothrow( const ::comphelper::ComponentContext& i_rContext, FormattedColumnValue_Data& i_rData,
+ const Reference< XRowSet >& i_rRowSet, const Reference< XPropertySet >& i_rColumn )
+ {
+ OSL_PRECOND( i_rRowSet.is(), "lcl_initColumnDataValue_nothrow: no row set!" );
+ if ( !i_rRowSet.is() )
+ return;
+
+ Reference< XNumberFormatter > xNumberFormatter;
+ try
+ {
+ // get the number formats supplier of the connection of the form
+ Reference< XConnection > xConnection( getConnection( i_rRowSet ), UNO_QUERY_THROW );
+ Reference< XNumberFormatsSupplier > xSupplier( getNumberFormats( xConnection, sal_True, i_rContext.getLegacyServiceFactory() ), UNO_SET_THROW );
+
+ // create a number formatter for it
+ xNumberFormatter.set( i_rContext.createComponent( "com.sun.star.util.NumberFormatter" ), UNO_QUERY_THROW );
+ xNumberFormatter->attachNumberFormatsSupplier( xSupplier );
}
catch( const Exception& )
{
DBG_UNHANDLED_EXCEPTION();
}
+
+ lcl_initColumnDataValue_nothrow( i_rData, xNumberFormatter, i_rColumn );
}
}
@@ -218,11 +228,19 @@ namespace dbtools
//= FormattedColumnValue
//====================================================================
//--------------------------------------------------------------------
- FormattedColumnValue::FormattedColumnValue( const ::comphelper::ComponentContext& _rContext,
- const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& _rxColumn )
+ FormattedColumnValue::FormattedColumnValue( const ::comphelper::ComponentContext& i_rContext,
+ const Reference< XRowSet >& _rxRowSet, const Reference< XPropertySet >& i_rColumn )
+ :m_pData( new FormattedColumnValue_Data )
+ {
+ lcl_initColumnDataValue_nothrow( i_rContext, *m_pData, _rxRowSet, i_rColumn );
+ }
+
+ //--------------------------------------------------------------------
+ FormattedColumnValue::FormattedColumnValue( const Reference< XNumberFormatter >& i_rNumberFormatter,
+ const Reference< XPropertySet >& _rxColumn )
:m_pData( new FormattedColumnValue_Data )
{
- lcl_initColumnDataValue_nothrow( _rContext, *m_pData, _rxRowSet, _rxColumn );
+ lcl_initColumnDataValue_nothrow( *m_pData, i_rNumberFormatter, _rxColumn );
}
//--------------------------------------------------------------------
diff --git a/connectivity/source/cpool/dbpool.map b/connectivity/source/cpool/dbpool.map
deleted file mode 100644
index 7202c9d71b..0000000000
--- a/connectivity/source/cpool/dbpool.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DBPOOL_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/cpool/makefile.mk b/connectivity/source/cpool/makefile.mk
index 124e7b574d..1f6e49c6cb 100644
--- a/connectivity/source/cpool/makefile.mk
+++ b/connectivity/source/cpool/makefile.mk
@@ -55,7 +55,7 @@ SLOFILES=\
SHL1TARGET= $(DBPOOL_TARGET)$(DBPOOL_MAJOR)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/dbtools/dbt.map b/connectivity/source/dbtools/dbt.map
deleted file mode 100644
index c3eaaa5a25..0000000000
--- a/connectivity/source/dbtools/dbt.map
+++ /dev/null
@@ -1,8 +0,0 @@
-DBTOOLS_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/adabas/adabas.map b/connectivity/source/drivers/adabas/adabas.map
deleted file mode 100644
index 7ce4c703e6..0000000000
--- a/connectivity/source/drivers/adabas/adabas.map
+++ /dev/null
@@ -1,8 +0,0 @@
-ADABAS_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/adabas/makefile.mk b/connectivity/source/drivers/adabas/makefile.mk
index e3e9d76ac2..9268f02a3b 100644
--- a/connectivity/source/drivers/adabas/makefile.mk
+++ b/connectivity/source/drivers/adabas/makefile.mk
@@ -71,7 +71,7 @@ SLOFILES=\
$(SLO)$/BResultSetMetaData.obj \
$(SLO)$/BResultSet.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/ado/ado.xcu b/connectivity/source/drivers/ado/ado.xcu
index a1207a1c90..63da80f5ef 100755
--- a/connectivity/source/drivers/ado/ado.xcu
+++ b/connectivity/source/drivers/ado/ado.xcu
@@ -154,6 +154,11 @@
<value>3</value>
</prop>
</node>
+ <node oor:name="ColumnAliasInOrderBy" oor:op="replace">
+ <prop oor:name="Value" oor:type="xs:boolean">
+ <value>false</value>
+ </prop>
+ </node>
</node>
<node oor:name="Features">
<node oor:name="UseSQL92NamingConstraints" oor:op="replace">
diff --git a/connectivity/source/drivers/calc/calc.map b/connectivity/source/drivers/calc/calc.map
deleted file mode 100644
index bcab8e6c91..0000000000
--- a/connectivity/source/drivers/calc/calc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-CALC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/calc/makefile.mk b/connectivity/source/drivers/calc/makefile.mk
index 452e9a92b3..8e193524aa 100644
--- a/connectivity/source/drivers/calc/makefile.mk
+++ b/connectivity/source/drivers/calc/makefile.mk
@@ -57,7 +57,7 @@ SLOFILES=\
$(SLO)$/Cservices.obj \
$(SLO)$/CDriver.obj
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index c8fadc05e6..ab6fc6d580 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -1527,6 +1527,7 @@ BOOL ODbaseTable::InsertRow(OValueRefVector& rRow, BOOL bFlush,const Reference<X
// Buffer mit Leerzeichen fuellen
AllocBuffer();
memset(m_pBuffer, 0, m_aHeader.db_slng);
+ m_pBuffer[0] = ' ';
// Gesamte neue Row uebernehmen:
// ... und am Ende als neuen Record hinzufuegen:
diff --git a/connectivity/source/drivers/dbase/dbase.map b/connectivity/source/drivers/dbase/dbase.map
deleted file mode 100644
index 2c620b4f36..0000000000
--- a/connectivity/source/drivers/dbase/dbase.map
+++ /dev/null
@@ -1,10 +0,0 @@
-DBASE_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
-
-
diff --git a/connectivity/source/drivers/dbase/makefile.mk b/connectivity/source/drivers/dbase/makefile.mk
index dded9086bc..f855cf1f45 100644
--- a/connectivity/source/drivers/dbase/makefile.mk
+++ b/connectivity/source/drivers/dbase/makefile.mk
@@ -89,7 +89,7 @@ EXCEPTIONSFILES +=\
.ENDIF
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/evoab/evoab.map b/connectivity/source/drivers/evoab/evoab.map
deleted file mode 100644
index 00cf7191f1..0000000000
--- a/connectivity/source/drivers/evoab/evoab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EVOAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/evoab/makefile.mk b/connectivity/source/drivers/evoab/makefile.mk
index 31d654fd26..c1dbc21cdf 100644
--- a/connectivity/source/drivers/evoab/makefile.mk
+++ b/connectivity/source/drivers/evoab/makefile.mk
@@ -65,7 +65,7 @@ SLOFILES=\
$(SLO)$/LDebug.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/evoab2/evoab2.map b/connectivity/source/drivers/evoab2/evoab2.map
deleted file mode 100644
index 00cf7191f1..0000000000
--- a/connectivity/source/drivers/evoab2/evoab2.map
+++ /dev/null
@@ -1,8 +0,0 @@
-EVOAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/evoab2/makefile.mk b/connectivity/source/drivers/evoab2/makefile.mk
index 43600a379f..e8a1cf96cd 100644
--- a/connectivity/source/drivers/evoab2/makefile.mk
+++ b/connectivity/source/drivers/evoab2/makefile.mk
@@ -65,7 +65,7 @@ SLOFILES=\
$(SLO)$/EApi.obj \
$(SLO)$/NDebug.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/flat/flat.map b/connectivity/source/drivers/flat/flat.map
deleted file mode 100644
index bf26bd0fa0..0000000000
--- a/connectivity/source/drivers/flat/flat.map
+++ /dev/null
@@ -1,8 +0,0 @@
-FLAT_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/flat/makefile.mk b/connectivity/source/drivers/flat/makefile.mk
index 312e6d6c94..2d1f99f759 100644
--- a/connectivity/source/drivers/flat/makefile.mk
+++ b/connectivity/source/drivers/flat/makefile.mk
@@ -70,7 +70,7 @@ EXCEPTIONSFILES=\
$(SLO)$/EDriver.obj
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
SHL1TARGET=$(TARGET)$(DLLPOSTFIX)
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index da622e5c0f..0229841889 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -211,7 +211,7 @@ void SAL_CALL OHSQLTable::alterColumnByName( const ::rtl::OUString& colName, con
// now we should look if the name of the column changed
::rtl::OUString sNewColumnName;
descriptor->getPropertyValue(rProp.getNameByIndex(PROPERTY_ID_NAME)) >>= sNewColumnName;
- if ( !sNewColumnName.equalsIgnoreAsciiCase(colName) )
+ if ( !sNewColumnName.equals(colName) )
{
const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx
index a247df0958..a94fa523d0 100644
--- a/connectivity/source/drivers/jdbc/JStatement.cxx
+++ b/connectivity/source/drivers/jdbc/JStatement.cxx
@@ -709,38 +709,44 @@ void java_sql_Statement_Base::getFastPropertyValue(
) const
{
java_sql_Statement_Base* THIS = const_cast<java_sql_Statement_Base*>(this);
- switch(nHandle)
+ try
+ {
+ switch(nHandle)
+ {
+ case PROPERTY_ID_QUERYTIMEOUT:
+ rValue <<= THIS->getQueryTimeOut();
+ break;
+ case PROPERTY_ID_MAXFIELDSIZE:
+ rValue <<= THIS->getMaxFieldSize();
+ break;
+ case PROPERTY_ID_MAXROWS:
+ rValue <<= THIS->getMaxRows();
+ break;
+ case PROPERTY_ID_CURSORNAME:
+ rValue <<= THIS->getCursorName();
+ break;
+ case PROPERTY_ID_RESULTSETCONCURRENCY:
+ rValue <<= THIS->getResultSetConcurrency();
+ break;
+ case PROPERTY_ID_RESULTSETTYPE:
+ rValue <<= THIS->getResultSetType();
+ break;
+ case PROPERTY_ID_FETCHDIRECTION:
+ rValue <<= THIS->getFetchDirection();
+ break;
+ case PROPERTY_ID_FETCHSIZE:
+ rValue <<= THIS->getFetchSize();
+ break;
+ case PROPERTY_ID_ESCAPEPROCESSING:
+ rValue <<= (sal_Bool)m_bEscapeProcessing;
+ break;
+ case PROPERTY_ID_USEBOOKMARKS:
+ default:
+ ;
+ }
+ }
+ catch(const Exception&)
{
- case PROPERTY_ID_QUERYTIMEOUT:
- rValue <<= THIS->getQueryTimeOut();
- break;
- case PROPERTY_ID_MAXFIELDSIZE:
- rValue <<= THIS->getMaxFieldSize();
- break;
- case PROPERTY_ID_MAXROWS:
- rValue <<= THIS->getMaxRows();
- break;
- case PROPERTY_ID_CURSORNAME:
- rValue <<= THIS->getCursorName();
- break;
- case PROPERTY_ID_RESULTSETCONCURRENCY:
- rValue <<= THIS->getResultSetConcurrency();
- break;
- case PROPERTY_ID_RESULTSETTYPE:
- rValue <<= THIS->getResultSetType();
- break;
- case PROPERTY_ID_FETCHDIRECTION:
- rValue <<= THIS->getFetchDirection();
- break;
- case PROPERTY_ID_FETCHSIZE:
- rValue <<= THIS->getFetchSize();
- break;
- case PROPERTY_ID_ESCAPEPROCESSING:
- rValue <<= (sal_Bool)m_bEscapeProcessing;
- break;
- case PROPERTY_ID_USEBOOKMARKS:
- default:
- ;
}
}
// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/jdbc/jdbc.map b/connectivity/source/drivers/jdbc/jdbc.map
deleted file mode 100644
index 23369ec764..0000000000
--- a/connectivity/source/drivers/jdbc/jdbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-JDBC_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/jdbc/makefile.mk b/connectivity/source/drivers/jdbc/makefile.mk
index 2de63f2c03..4661995216 100644
--- a/connectivity/source/drivers/jdbc/makefile.mk
+++ b/connectivity/source/drivers/jdbc/makefile.mk
@@ -78,7 +78,7 @@ SLOFILES=\
$(SLO)$/tools.obj \
$(SLO)$/ContextClassLoader.obj
-SHL1VERSIONMAP=$(JDBC_TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/kab/kab.map b/connectivity/source/drivers/kab/kab.map
deleted file mode 100644
index 6b7216de8c..0000000000
--- a/connectivity/source/drivers/kab/kab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-KAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/kab/kabdrv.map b/connectivity/source/drivers/kab/kabdrv.map
index c32084ddd4..5de866f2e5 100644
--- a/connectivity/source/drivers/kab/kabdrv.map
+++ b/connectivity/source/drivers/kab/kabdrv.map
@@ -1,4 +1,4 @@
-KAB_1_0 {
+UDK_3_0_0 {
global:
createKabConnection;
initKApplication;
diff --git a/connectivity/source/drivers/kab/makefile.mk b/connectivity/source/drivers/kab/makefile.mk
index 98148a29e9..2a0dc5cd89 100644
--- a/connectivity/source/drivers/kab/makefile.mk
+++ b/connectivity/source/drivers/kab/makefile.mk
@@ -61,7 +61,7 @@ DEPOBJFILES= \
# --- Library -----------------------------------
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1TARGET= $(TARGET)$(KAB_MAJOR)
SHL1OBJS=$(SLOFILES)
diff --git a/connectivity/source/drivers/macab/MacabConnection.cxx b/connectivity/source/drivers/macab/MacabConnection.cxx
index 0762879506..c9155adba2 100755
--- a/connectivity/source/drivers/macab/MacabConnection.cxx
+++ b/connectivity/source/drivers/macab/MacabConnection.cxx
@@ -314,10 +314,11 @@ MacabAddressBook* MacabConnection::getAddressBook() const
return m_pAddressBook;
}
// -----------------------------------------------------------------------------
-extern "C" void* SAL_CALL createMacabConnection( void* _pDriver )
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL createMacabConnection( void* _pDriver )
{
MacabConnection* pConnection = new MacabConnection( static_cast< MacabDriver* >( _pDriver ) );
// by definition, the pointer crossing library boundaries as void ptr is acquired once
pConnection->acquire();
return pConnection;
}
+
diff --git a/connectivity/source/drivers/macab/MacabServices.cxx b/connectivity/source/drivers/macab/MacabServices.cxx
index 84bba28bb9..6fc29f4736 100755
--- a/connectivity/source/drivers/macab/MacabServices.cxx
+++ b/connectivity/source/drivers/macab/MacabServices.cxx
@@ -114,7 +114,7 @@ struct ProviderRequest
//---------------------------------------------------------------------------------------
-extern "C" void SAL_CALL component_getImplementationEnvironment(
+extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
const sal_Char **ppEnvTypeName,
uno_Environment **
)
@@ -123,7 +123,7 @@ extern "C" void SAL_CALL component_getImplementationEnvironment(
}
//---------------------------------------------------------------------------------------
-extern "C" sal_Bool SAL_CALL component_writeInfo(
+extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
void*,
void* pRegistryKey
)
@@ -148,7 +148,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(
}
//---------------------------------------------------------------------------------------
-extern "C" void* SAL_CALL component_getFactory(
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
void*)
diff --git a/connectivity/source/drivers/macab/macab.map b/connectivity/source/drivers/macab/macab.map
deleted file mode 100755
index fe2d1ac905..0000000000
--- a/connectivity/source/drivers/macab/macab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MACAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/macab/macab.xcu b/connectivity/source/drivers/macab/macab.xcu
index 2418698c3d..cbb9d0b6b0 100755
--- a/connectivity/source/drivers/macab/macab.xcu
+++ b/connectivity/source/drivers/macab/macab.xcu
@@ -27,7 +27,7 @@
************************************************************************ -->
<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<node oor:name="Installed">
- <node oor:name="sdbc:address:macab:*" oor:op="replace">
+ <node oor:name="sdbc:address:macab" oor:op="replace">
<prop oor:name="Driver">
<value>com.sun.star.comp.sdbc.macab.Driver</value>
</prop>
diff --git a/connectivity/source/drivers/macab/macabdrv.map b/connectivity/source/drivers/macab/macabdrv.map
deleted file mode 100755
index d953690f6b..0000000000
--- a/connectivity/source/drivers/macab/macabdrv.map
+++ /dev/null
@@ -1,6 +0,0 @@
-MACAB_1_0 {
- global:
- createMacabConnection;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/macab/makefile.mk b/connectivity/source/drivers/macab/makefile.mk
index 811f1fabb1..35532b15ec 100755
--- a/connectivity/source/drivers/macab/makefile.mk
+++ b/connectivity/source/drivers/macab/makefile.mk
@@ -54,8 +54,6 @@ DEPOBJFILES= \
# --- Library -----------------------------------
-SHL1VERSIONMAP=$(TARGET).map
-
SHL1TARGET= $(TARGET)$(MACAB_MAJOR)
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
@@ -98,8 +96,6 @@ MACAB_LIB=-framework Carbon -framework AddressBook
# --- Library -----------------------------------
-SHL2VERSIONMAP=$(TARGET2).map
-
SHL2TARGET= $(TARGET2)$(MACAB_MAJOR)
SHL2OBJS=$(SLO2FILES)
SHL2STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
index 5e89ceec66..7c1deacce2 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
@@ -30,12 +30,6 @@
#include <MNSINIParser.hxx>
#include <rtl/byteseq.hxx>
-ini_Section * IniParser::getSection(OUString const & secName)
-{
- if (mAllSection.find(secName) != mAllSection.end())
- return &mAllSection[secName];
- return NULL;
-}
IniParser::IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException )
{
OUString iniUrl;
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
index 7b35aeec4a..7c2c5b88af 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.hxx
@@ -72,7 +72,6 @@ class IniParser
IniSectionMap mAllSection;
public:
IniSectionMap * getAllSection(){return &mAllSection;};
- ini_Section * getSection(OUString const & secName);
IniParser(OUString const & rIniName) throw(com::sun::star::io::IOException );
#if OSL_DEBUG_LEVEL > 0
void Dump();
diff --git a/connectivity/source/drivers/mozab/bootstrap/makefile.mk b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
index 78c1e39578..6a4172da20 100644
--- a/connectivity/source/drivers/mozab/bootstrap/makefile.mk
+++ b/connectivity/source/drivers/mozab/bootstrap/makefile.mk
@@ -67,7 +67,7 @@ SLOFILES += \
CDEFS+=-DMINIMAL_PROFILEDISCOVER
SHL1TARGET=$(TARGET)
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1DEF=$(MISC)$/$(SHL1TARGET).def
DEF1NAME=$(SHL1TARGET)
diff --git a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map b/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map
deleted file mode 100644
index 750db5d4af..0000000000
--- a/connectivity/source/drivers/mozab/bootstrap/mozbootstrap.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MOZBOOTSTRAP_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mozab/makefile.mk b/connectivity/source/drivers/mozab/makefile.mk
index ffcc41af75..b1e12fde6f 100644
--- a/connectivity/source/drivers/mozab/makefile.mk
+++ b/connectivity/source/drivers/mozab/makefile.mk
@@ -85,7 +85,7 @@ SLOFILES=\
# --- MOZAB BASE Library -----------------------------------
-SHL1VERSIONMAP= $(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1TARGET= $(TARGET)$(DLLPOSTFIX)
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/drivers/mozab/mozab.map b/connectivity/source/drivers/mozab/mozab.map
deleted file mode 100644
index 9f3a1f27d0..0000000000
--- a/connectivity/source/drivers/mozab/mozab.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MOZAB_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/mozab/mozabdrv.map b/connectivity/source/drivers/mozab/mozabdrv.map
index 918cb530e1..a431a07377 100644
--- a/connectivity/source/drivers/mozab/mozabdrv.map
+++ b/connectivity/source/drivers/mozab/mozabdrv.map
@@ -1,4 +1,4 @@
-MOZABDRV_1_0 {
+UDK_3_0_0 {
global:
OMozabConnection_CreateInstance;
OMozillaBootstrap_CreateInstance;
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index d89d502068..8b91207002 100644
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ b/connectivity/source/drivers/mysql/YTable.cxx
@@ -281,7 +281,7 @@ void SAL_CALL OMySQLTable::alterColumnByName( const ::rtl::OUString& colName, co
const ::rtl::OUString sQuote = getMetaData()->getIdentifierQuoteString( );
sSql += ::dbtools::quoteName(sQuote,colName);
sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
- sSql += ::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern());
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(descriptor,getConnection(),getTypeCreatePattern()));
executeStatement(sSql);
}
m_pColumns->refresh();
@@ -310,7 +310,7 @@ void OMySQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rCo
::comphelper::copyProperties(_xDescriptor,xProp);
xProp->setPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE),makeAny(nNewType));
- sSql += ::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern());
+ sSql += OTables::adjustSQL(::dbtools::createStandardColumnPart(xProp,getConnection(),getTypeCreatePattern()));
executeStatement(sSql);
}
// -----------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index 9cb1a1a688..d147a66793 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -184,12 +184,27 @@ void OTables::dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName)
}
}
// -------------------------------------------------------------------------
+::rtl::OUString OTables::adjustSQL(const ::rtl::OUString& _sSql)
+{
+ ::rtl::OUString sSQL = _sSql;
+ static const ::rtl::OUString s_sUNSIGNED(RTL_CONSTASCII_USTRINGPARAM("UNSIGNED"));
+ sal_Int32 nIndex = sSQL.indexOf(s_sUNSIGNED);
+ while(nIndex != -1 )
+ {
+ sal_Int32 nParen = sSQL.indexOf(')',nIndex);
+ sal_Int32 nPos = nIndex + s_sUNSIGNED.getLength();
+ ::rtl::OUString sNewUnsigned( sSQL.copy(nPos,nParen - nPos + 1));
+ sSQL = sSQL.replaceAt(nIndex,s_sUNSIGNED.getLength()+sNewUnsigned.getLength(),sNewUnsigned + s_sUNSIGNED);
+ nIndex = sSQL.indexOf(s_sUNSIGNED,nIndex + s_sUNSIGNED.getLength()+sNewUnsigned.getLength());
+ }
+ return sSQL;
+}
+// -------------------------------------------------------------------------
void OTables::createTable( const Reference< XPropertySet >& descriptor )
{
const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
static const ::rtl::OUString s_sCreatePattern(RTL_CONSTASCII_USTRINGPARAM("(M,D)"));
- const ::rtl::OUString aSql = ::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern);
-
+ const ::rtl::OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,s_sCreatePattern));
Reference< XStatement > xStmt = xConnection->createStatement( );
if ( xStmt.is() )
{
diff --git a/connectivity/source/drivers/mysql/makefile.mk b/connectivity/source/drivers/mysql/makefile.mk
index af486c2938..fbb68321cb 100644
--- a/connectivity/source/drivers/mysql/makefile.mk
+++ b/connectivity/source/drivers/mysql/makefile.mk
@@ -55,7 +55,7 @@ SLOFILES=\
$(SLO)$/YUsers.obj \
$(SLO)$/Yservices.obj
-SHL1VERSIONMAP=$(MYSQL_TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Library -----------------------------------
diff --git a/connectivity/source/drivers/mysql/mysql.map b/connectivity/source/drivers/mysql/mysql.map
deleted file mode 100644
index 834658431a..0000000000
--- a/connectivity/source/drivers/mysql/mysql.map
+++ /dev/null
@@ -1,8 +0,0 @@
-MYSQL_2_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/odbc/makefile.mk b/connectivity/source/drivers/odbc/makefile.mk
index 09052f9d77..508cbfb6df 100644
--- a/connectivity/source/drivers/odbc/makefile.mk
+++ b/connectivity/source/drivers/odbc/makefile.mk
@@ -71,7 +71,7 @@ SHL1IMPLIB= i$(ODBC_TARGET)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def
DEF1NAME= $(SHL1TARGET)
-SHL1VERSIONMAP=odbc.map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
# --- Targets ----------------------------------
diff --git a/connectivity/source/drivers/odbc/odbc.map b/connectivity/source/drivers/odbc/odbc.map
deleted file mode 100644
index 14e4b7110c..0000000000
--- a/connectivity/source/drivers/odbc/odbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-ODBC_3_0_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx
index 09f32dc342..84d57eae9a 100644
--- a/connectivity/source/drivers/odbcbase/OResultSet.cxx
+++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx
@@ -466,11 +466,9 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro
return nRet;
}
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
+ const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex);
- switch(aFind->second)
+ switch(nColumnType)
{
case SQL_WVARCHAR:
case SQL_WCHAR:
@@ -479,7 +477,7 @@ Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes( sal_Int32 columnIndex ) thro
case SQL_CHAR:
case SQL_LONGVARCHAR:
{
- ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,aFind->second,m_bWasNull,**this,m_nTextEncoding);
+ ::rtl::OUString aRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
return Sequence<sal_Int8>(reinterpret_cast<const sal_Int8*>(aRet.getStr()),sizeof(sal_Unicode)*aRet.getLength());
}
default:
@@ -624,10 +622,8 @@ sal_Int16 SAL_CALL OResultSet::getShort( sal_Int32 columnIndex ) throw(SQLExcept
else
{
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
- nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,aFind->second,m_bWasNull,**this,m_nTextEncoding);
+ const SWORD nColumnType = impl_getColumnType_nothrow(columnIndex);
+ nRet = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,columnIndex,nColumnType,m_bWasNull,**this,m_nTextEncoding);
}
return nRet;
}
@@ -1502,10 +1498,8 @@ void OResultSet::fillRow(sal_Int32 _nToColumn)
case DataType::LONGVARCHAR:
case DataType::CLOB:
{
- ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(nColumn);
- if ( aFind == m_aODBCColumnTypes.end() )
- aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(nColumn,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,nColumn))).first;
- *pColumn = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,nColumn,aFind->second,m_bWasNull,**this,m_nTextEncoding);
+ const SWORD nColumnType = impl_getColumnType_nothrow(nColumn);
+ *pColumn = OTools::getStringValue(m_pStatement->getOwnConnection(),m_aStatementHandle,nColumn,nColumnType,m_bWasNull,**this,m_nTextEncoding);
}
break;
case DataType::BIGINT:
@@ -1750,4 +1744,12 @@ void OResultSet::fillNeededData(SQLRETURN _nRet)
while (nRet == SQL_NEED_DATA);
}
}
+// -----------------------------------------------------------------------------
+SWORD OResultSet::impl_getColumnType_nothrow(sal_Int32 columnIndex)
+{
+ ::std::map<sal_Int32,SWORD>::iterator aFind = m_aODBCColumnTypes.find(columnIndex);
+ if ( aFind == m_aODBCColumnTypes.end() )
+ aFind = m_aODBCColumnTypes.insert(::std::map<sal_Int32,SWORD>::value_type(columnIndex,OResultSetMetaData::getColumnODBCType(m_pStatement->getOwnConnection(),m_aStatementHandle,*this,columnIndex))).first;
+ return aFind->second;
+}
diff --git a/connectivity/source/inc/mysql/YTables.hxx b/connectivity/source/inc/mysql/YTables.hxx
index 7900039aad..93c05658b0 100644
--- a/connectivity/source/inc/mysql/YTables.hxx
+++ b/connectivity/source/inc/mysql/YTables.hxx
@@ -71,6 +71,11 @@ namespace connectivity
can contain () which have to filled with values
*/
static ::rtl::OUString getTypeString(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColProp);
+
+ /** convert the sql statement to fit MySQL notation
+ @param _sSql in/out
+ */
+ static ::rtl::OUString adjustSQL(const ::rtl::OUString& _sSql);
};
}
}
diff --git a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
index b6e53c22d5..7dddc9af81 100644
--- a/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
+++ b/connectivity/source/inc/odbc/ODatabaseMetaDataResultSet.hxx
@@ -97,7 +97,7 @@ namespace connectivity
sal_Int32 getFetchDirection() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
sal_Int32 getFetchSize() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
::rtl::OUString getCursorName() const throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- SWORD impl_getColumnType_nothrow(sal_Int32 column);
+ SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex);
sal_Int32 mapColumn (sal_Int32 column);
diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx
index 6fcf4a8263..a2b01c802e 100644
--- a/connectivity/source/inc/odbc/OResultSet.hxx
+++ b/connectivity/source/inc/odbc/OResultSet.hxx
@@ -173,6 +173,7 @@ namespace connectivity
sal_Bool moveImpl(IResultSetHelper::Movement _eCursorPosition, sal_Int32 _nOffset, sal_Bool _bRetrieveData);
TVoidPtr allocBindColumn(sal_Int32 _nType,sal_Int32 _nColumnIndex);
SQLRETURN unbind(sal_Bool _bUnbindHandle = sal_True);
+ SWORD impl_getColumnType_nothrow(sal_Int32 columnIndex);
// OPropertyArrayUsageHelper
virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
diff --git a/connectivity/source/manager/makefile.mk b/connectivity/source/manager/makefile.mk
index e72dfc78bc..52ec191ec8 100644
--- a/connectivity/source/manager/makefile.mk
+++ b/connectivity/source/manager/makefile.mk
@@ -52,7 +52,7 @@ SLOFILES=\
SHL1TARGET= $(SDBC_TARGET)$(SDBC_MAJOR)
-SHL1VERSIONMAP=$(TARGET).map
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
SHL1OBJS=$(SLOFILES)
SHL1STDLIBS=\
diff --git a/connectivity/source/manager/mdrivermanager.cxx b/connectivity/source/manager/mdrivermanager.cxx
index bd678ee210..353605e478 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -717,7 +717,7 @@ Reference< XDriver > OSDBCDriverManager::implGetDriverForURL(const ::rtl::OUStri
}
// found something?
- if ( m_aDriversBS.end() != aFind )
+ if ( m_aDriversBS.end() != aFind && aFind->xDriver.is() && aFind->xDriver->acceptsURL(_rURL) )
xReturn = aFind->xDriver;
}
diff --git a/connectivity/source/manager/sdbc.map b/connectivity/source/manager/sdbc.map
deleted file mode 100644
index 2d8534b22e..0000000000
--- a/connectivity/source/manager/sdbc.map
+++ /dev/null
@@ -1,8 +0,0 @@
-SDBC_1_0 {
- global:
- component_getImplementationEnvironment;
- component_writeInfo;
- component_getFactory;
- local:
- *;
-};
diff --git a/connectivity/source/parse/sqlflex.l b/connectivity/source/parse/sqlflex.l
index 77544ece30..275bd5b346 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -396,7 +396,7 @@ VAR_SAMP {SQL_NEW_KEYWORD(SQL_TOKEN_VAR_S
<SQL>\" { return gatherString('\"',0); }
<SQL>` { return gatherString('`' ,0); }
-<PREDICATE_GER,PREDICATE_ENG,DATE>"[" { return gatherString(']' ,0);}
+<PREDICATE_GER,PREDICATE_ENG,DATE,SQL>"[" { return gatherString(']' ,0);}
\' { return gatherString('\'',1); }