diff options
author | Caolán McNamara <cmc@openoffice.org> | 2010-04-21 21:07:38 +0100 |
---|---|---|
committer | Caolán McNamara <cmc@openoffice.org> | 2010-04-21 21:07:38 +0100 |
commit | ced518a01002d7c335080ba972f0e3e252c7fc89 (patch) | |
tree | 0f355b9f134540c926fe25f2a08658ad684640be | |
parent | cf79e126be016d761a9d2279828c9e8fcf863267 (diff) | |
parent | f09e3e9714d6b3dd29f90dc8412702a6157edbf4 (diff) |
cmcfixes74: merge with DEV300 m75
31 files changed, 393 insertions, 187 deletions
diff --git a/dbaccess/prj/build.lst b/dbaccess/prj/build.lst index 0b6122d413ab..d5c6eacc7d2a 100644 --- a/dbaccess/prj/build.lst +++ b/dbaccess/prj/build.lst @@ -28,3 +28,4 @@ ba dbaccess\source\ui\imagelists nmake - all ba_uiimglst ba_inc NULL ba dbaccess\util nmake - all ba_util ba_uiimglst ba_capi ba_cdaccess ba_cmisc ba_crecovery ba_shared ba_uibrowser ba_uiapp ba_uicontrol ba_uidlg ba_uimisc ba_uiquery ba_uitabledesign ba_uirelationdesign ba_uiuno ba_conntools ba_misctools ba_miscres ba_ext_adabasui NULL ba dbaccess\win32\source\odbcconfig nmake - w ba_odbcconfig ba_inc NULL ba dbaccess\qa\complex\dbaccess nmake - all ba_complex_tests NULL +ba dbaccess\qa\unoapi nmake - all ba_q_unoapi NULL diff --git a/dbaccess/qa/complex/dbaccess/RowSet.java b/dbaccess/qa/complex/dbaccess/RowSet.java index d03abe90d59c..5a13f6724d1f 100644 --- a/dbaccess/qa/complex/dbaccess/RowSet.java +++ b/dbaccess/qa/complex/dbaccess/RowSet.java @@ -977,7 +977,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("could not text the relationship between XParameters and XParametersSupplier" + e.getMessage(), false); + assure("could not test the relationship between XParameters and XParametersSupplier" + e.getMessage(), false); } } diff --git a/dbaccess/qa/unoapi/Test.java b/dbaccess/qa/unoapi/Test.java new file mode 100644 index 000000000000..4f2409fdc8bd --- /dev/null +++ b/dbaccess/qa/unoapi/Test.java @@ -0,0 +1,52 @@ +/************************************************************************* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +************************************************************************/ + +package org.openoffice.dbaccess.qa.unoapi; + +import org.openoffice.Runner; +import org.openoffice.test.OfficeConnection; +import static org.junit.Assert.*; + +public final class Test { + @org.junit.Before public void setUp() throws Exception { + connection.setUp(); + } + + @org.junit.After public void tearDown() + throws InterruptedException, com.sun.star.uno.Exception + { + connection.tearDown(); + } + + @org.junit.Test public void test() { + assertTrue( + Runner.run( + "-sce", "dbaccess.sce", "-xcl", "knownissues.xcl", "-ini", + "dbaccess.props", "-tdoc", "testdocuments", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/dbaccess/qa/unoapi/makefile.mk b/dbaccess/qa/unoapi/makefile.mk index 0429e8c3dd46..41ed9480f526 100644 --- a/dbaccess/qa/unoapi/makefile.mk +++ b/dbaccess/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2000, 2010 Oracle and/or its affiliates. # # OpenOffice.org - a multi-platform office productivity suite @@ -22,28 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=dbaccess -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = dbaccess +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/dbaccess/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk +ALLTAR : javatest -ALLTAR : UNOAPI_TEST - -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce dbaccess.sce -ini dbaccess.props -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments - @echo ======================================================================= - @echo In case of problems make sure that you put valid values in the dbaccess.props and added an appropriate jdbc-driver to your office installation - @echo ======================================================================= - @echo In case of problems with TableWindowAccessibility or JoinViewAccessibility this might be because of connection problems, just re-run the testcases - @echo ======================================================================= - -run_%: - +$(SOLARENV)$/bin$/checkapi -o dbaccess.$(@:s/run_//) -ini dbaccess.props -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/dbaccess/source/core/api/BookmarkSet.cxx b/dbaccess/source/core/api/BookmarkSet.cxx index e71a5187db64..b5b9ec0ec787 100644 --- a/dbaccess/source/core/api/BookmarkSet.cxx +++ b/dbaccess/source/core/api/BookmarkSet.cxx @@ -59,10 +59,10 @@ using namespace ::com::sun::star::lang; // using namespace ::cppu; using namespace ::osl; -void OBookmarkSet::construct(const Reference< XResultSet>& _xDriverSet) +void OBookmarkSet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::construct" ); - OCacheSet::construct(_xDriverSet); + OCacheSet::construct(_xDriverSet,i_sRowSetFilter); m_xRowLocate.set(_xDriverSet,UNO_QUERY); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/core/api/BookmarkSet.hxx b/dbaccess/source/core/api/BookmarkSet.hxx index c7beff64dbde..36d3c90c7969 100644 --- a/dbaccess/source/core/api/BookmarkSet.hxx +++ b/dbaccess/source/core/api/BookmarkSet.hxx @@ -51,7 +51,7 @@ namespace dbaccess m_xRowLocate = NULL; } - virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet); + virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); virtual void fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition); // ::com::sun::star::sdbcx::XRowLocate virtual ::com::sun::star::uno::Any SAL_CALL getBookmark() throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index b541bb7fd6fa..bedd873adc83 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -126,7 +126,7 @@ OCacheSet::OCacheSet() return sQuote; } // ------------------------------------------------------------------------- -void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet) +void OCacheSet::construct( const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& /*i_sRowSetFilter*/) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::construct" ); OSL_ENSURE(_xDriverSet.is(),"Invalid resultSet"); diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx index 63aa508478b2..658e2c9871bf 100644 --- a/dbaccess/source/core/api/CacheSet.hxx +++ b/dbaccess/source/core/api/CacheSet.hxx @@ -107,7 +107,7 @@ namespace dbaccess public: // late constructor - virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet); + virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); virtual void fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition); // ::com::sun::star::sdbc::XRow diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index f804c1c1cb34..04bef19278b1 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -148,6 +148,134 @@ namespace } } } + class OPrivateRow : public ::cppu::WeakImplHelper1<XRow> + { + ORowSetValueVector::Vector m_aRow; + sal_Int32 m_nPos; + public: + OPrivateRow(const ORowSetValueVector::Vector& i_aRow) : m_aRow(i_aRow),m_nPos(0) + { + } + virtual ::sal_Bool SAL_CALL wasNull( ) throw (SQLException, RuntimeException); + virtual ::rtl::OUString SAL_CALL getString( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::sal_Bool SAL_CALL getBoolean( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::sal_Int8 SAL_CALL getByte( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::sal_Int16 SAL_CALL getShort( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::sal_Int32 SAL_CALL getInt( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::sal_Int64 SAL_CALL getLong( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual float SAL_CALL getFloat( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual double SAL_CALL getDouble( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual Sequence< ::sal_Int8 > SAL_CALL getBytes( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::com::sun::star::util::Date SAL_CALL getDate( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::com::sun::star::util::Time SAL_CALL getTime( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual ::com::sun::star::util::DateTime SAL_CALL getTimestamp( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual Reference< ::com::sun::star::io::XInputStream > SAL_CALL getBinaryStream( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual Reference< ::com::sun::star::io::XInputStream > SAL_CALL getCharacterStream( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual Any SAL_CALL getObject( ::sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw (SQLException, RuntimeException); + virtual Reference< XRef > SAL_CALL getRef( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual Reference< XBlob > SAL_CALL getBlob( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual Reference< XClob > SAL_CALL getClob( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + virtual Reference< XArray > SAL_CALL getArray( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException); + }; + ::sal_Bool SAL_CALL OPrivateRow::wasNull( ) throw (SQLException, RuntimeException) + { + return m_aRow[m_nPos].isNull(); + } + ::rtl::OUString SAL_CALL OPrivateRow::getString( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::sal_Bool SAL_CALL OPrivateRow::getBoolean( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::sal_Int8 SAL_CALL OPrivateRow::getByte( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::sal_Int16 SAL_CALL OPrivateRow::getShort( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::sal_Int32 SAL_CALL OPrivateRow::getInt( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::sal_Int64 SAL_CALL OPrivateRow::getLong( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + float SAL_CALL OPrivateRow::getFloat( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + double SAL_CALL OPrivateRow::getDouble( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + Sequence< ::sal_Int8 > SAL_CALL OPrivateRow::getBytes( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::com::sun::star::util::Date SAL_CALL OPrivateRow::getDate( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::com::sun::star::util::Time SAL_CALL OPrivateRow::getTime( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + ::com::sun::star::util::DateTime SAL_CALL OPrivateRow::getTimestamp( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos]; + } + Reference< ::com::sun::star::io::XInputStream > SAL_CALL OPrivateRow::getBinaryStream( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return Reference< ::com::sun::star::io::XInputStream >(m_aRow[m_nPos].makeAny(),UNO_QUERY); + } + Reference< ::com::sun::star::io::XInputStream > SAL_CALL OPrivateRow::getCharacterStream( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return Reference< ::com::sun::star::io::XInputStream >(m_aRow[m_nPos].makeAny(),UNO_QUERY); + } + Any SAL_CALL OPrivateRow::getObject( ::sal_Int32 columnIndex, const Reference< ::com::sun::star::container::XNameAccess >& ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return m_aRow[m_nPos].makeAny(); + } + Reference< XRef > SAL_CALL OPrivateRow::getRef( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return Reference< XRef >(m_aRow[m_nPos].makeAny(),UNO_QUERY); + } + Reference< XBlob > SAL_CALL OPrivateRow::getBlob( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return Reference< XBlob >(m_aRow[m_nPos].makeAny(),UNO_QUERY); + } + Reference< XClob > SAL_CALL OPrivateRow::getClob( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return Reference< XClob >(m_aRow[m_nPos].makeAny(),UNO_QUERY); + } + Reference< XArray > SAL_CALL OPrivateRow::getArray( ::sal_Int32 columnIndex ) throw (SQLException, RuntimeException) + { + m_nPos = columnIndex; + return Reference< XArray >(m_aRow[m_nPos].makeAny(),UNO_QUERY); + } } DBG_NAME(OKeySet) // ------------------------------------------------------------------------- @@ -159,6 +287,7 @@ OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, :m_aParameterValueForCache(_aParameterValueForCache) ,m_pKeyColumnNames(NULL) ,m_pColumnNames(NULL) + ,m_pParameterNames(NULL) ,m_pForeignColumnNames(NULL) ,m_xTable(_xTable) ,m_xTableKeys(_xTableKeys) @@ -188,25 +317,38 @@ OKeySet::~OKeySet() m_xComposer = NULL; delete m_pKeyColumnNames; delete m_pColumnNames; + delete m_pParameterNames; delete m_pForeignColumnNames; DBG_DTOR(OKeySet,NULL); } // ----------------------------------------------------------------------------- -void OKeySet::construct(const Reference< XResultSet>& _xDriverSet) +void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::construct" ); - OCacheSet::construct(_xDriverSet); + OCacheSet::construct(_xDriverSet,i_sRowSetFilter); Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); bool bCase = (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers()) ? true : false; - m_pKeyColumnNames = new SelectColumnsMetaData(bCase); - m_pColumnNames = new SelectColumnsMetaData(bCase); - m_pForeignColumnNames = new SelectColumnsMetaData(bCase); + m_pKeyColumnNames = new SelectColumnsMetaData(bCase); + m_pColumnNames = new SelectColumnsMetaData(bCase); + m_pParameterNames = new SelectColumnsMetaData(bCase); + m_pForeignColumnNames = new SelectColumnsMetaData(bCase); Reference<XNameAccess> xKeyColumns = getKeyColumns(); Reference<XColumnsSupplier> xSup(m_xComposer,UNO_QUERY); Reference<XNameAccess> xSourceColumns = m_xTable->getColumns(); + // locate parameter in select columns + Reference<XParametersSupplier> xParaSup(m_xComposer,UNO_QUERY); + Reference<XIndexAccess> xQueryParameters = xParaSup->getParameters(); + const sal_Int32 nParaCount = xQueryParameters->getCount(); + Sequence< ::rtl::OUString> aParameterColumns(nParaCount); + for(sal_Int32 i = 0; i< nParaCount;++i) + { + Reference<XPropertySet> xPara(xQueryParameters->getByIndex(i),UNO_QUERY_THROW); + xPara->getPropertyValue(PROPERTY_REALNAME) >>= aParameterColumns[i]; + } + ::rtl::OUString sCatalog,sSchema,sTable; @@ -235,6 +377,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet) ::dbaccess::getColumnPositions(xSup->getColumns(),aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames)); ::dbaccess::getColumnPositions(xSup->getColumns(),xSourceColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames)); + ::dbaccess::getColumnPositions(xSup->getColumns(),aParameterColumns,m_sUpdateTableName,(*m_pParameterNames)); SelectColumnsMetaData::const_iterator aPosIter = (*m_pKeyColumnNames).begin(); SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); @@ -251,7 +394,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet) // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra varaible to be set - m_aKeyMap.insert(OKeySetMatrix::value_type(0,OKeySetValue(NULL,0))); + m_aKeyMap.insert(OKeySetMatrix::value_type(0,OKeySetValue(NULL,::std::pair<sal_Int32,Reference<XRow> >(0,NULL)))); m_aKeyIter = m_aKeyMap.begin(); @@ -281,9 +424,10 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet) aFilter.append(aAnd); } + Reference< XSingleSelectQueryComposer> xSourceComposer(m_xComposer,UNO_QUERY); Reference< XMultiServiceFactory > xFactory(m_xConnection, UNO_QUERY_THROW); Reference<XSingleSelectQueryComposer> xAnalyzer(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY); - xAnalyzer->setQuery(m_xComposer->getQuery()); + xAnalyzer->setElementaryQuery(xSourceComposer->getElementaryQuery()); Reference<XTablesSupplier> xTabSup(xAnalyzer,uno::UNO_QUERY); Reference<XNameAccess> xSelectTables(xTabSup->getTables(),uno::UNO_QUERY); const Sequence< ::rtl::OUString> aSeq = xSelectTables->getElementNames(); @@ -320,11 +464,10 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet) } } } // if ( aSeq.getLength() > 1 ) // special handling for join - const ::rtl::OUString sOldFilter = xAnalyzer->getFilter(); - if ( sOldFilter.getLength() ) + if ( i_sRowSetFilter.getLength() ) { FilterCreator aFilterCreator; - aFilterCreator.append( sOldFilter ); + aFilterCreator.append( i_sRowSetFilter ); aFilterCreator.append( aFilter.makeStringAndClear() ); aFilter = aFilterCreator.getComposedAndClear(); } @@ -587,13 +730,24 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow i = 1; // first the set values + bool bRefetch = true; aIter = m_pColumnNames->begin(); sal_uInt16 j = 0; + Reference<XRow> xRow; for(;aIter != aEnd;++aIter,++j) { sal_Int32 nPos = aIter->second.nPosition; if((_rInsertRow->get())[nPos].isModified()) { + if ( bRefetch ) + { + bRefetch = ::std::find(m_aFilterColumns.begin(),m_aFilterColumns.end(),aIter->first) == m_aFilterColumns.end(); + if ( !bRefetch ) + { + xRow = new OPrivateRow(_rInsertRow->get()); + } + } + impl_convertValue_throw(_rInsertRow,aIter->second); (_rInsertRow->get())[nPos].setSigned((_rOrginalRow->get())[nPos].isSigned()); setParameter(i++,xParameter,(_rInsertRow->get())[nPos],aIter->second.nType,aIter->second.nScale); @@ -621,10 +775,11 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow m_bUpdated = xPrep->executeUpdate() > 0; if(m_bUpdated) { - m_aKeyIter = m_aKeyMap.find(::comphelper::getINT32((_rInsertRow->get())[0].getAny())); - OSL_ENSURE(m_aKeyIter != m_aKeyMap.end(),"New inserted row not found!"); - m_aKeyIter->second.second = 2; - copyRowValue(_rInsertRow,m_aKeyIter->second.first); + const sal_Int32 nBookmark = ::comphelper::getINT32((_rInsertRow->get())[0].getAny()); + m_aKeyIter = m_aKeyMap.find(nBookmark); + m_aKeyIter->second.second.first = 2; + m_aKeyIter->second.second.second = xRow; + copyRowValue(_rInsertRow,m_aKeyIter->second.first,nBookmark); } } // ------------------------------------------------------------------------- @@ -785,21 +940,47 @@ void SAL_CALL OKeySet::insertRow( const ORowSetRow& _rInsertRow,const connectivi } if ( m_bInserted ) { - ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >((*m_pKeyColumnNames).size()); - copyRowValue(_rInsertRow,aKeyRow); - OKeySetMatrix::iterator aKeyIter = m_aKeyMap.end(); --aKeyIter; - m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(aKeyIter->first + 1,OKeySetValue(aKeyRow,1))).first; + ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >((*m_pKeyColumnNames).size()); + copyRowValue(_rInsertRow,aKeyRow,aKeyIter->first + 1); + + m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(aKeyIter->first + 1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(1,NULL)))).first; // now we set the bookmark for this row (_rInsertRow->get())[0] = makeAny((sal_Int32)m_aKeyIter->first); } } // ----------------------------------------------------------------------------- -void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow) +void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sal_Int32 i_nBookmark) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::copyRowValue" ); connectivity::ORowVector< ORowSetValue >::Vector::iterator aIter = _rKeyRow->get().begin(); + + // check the if the parameter values have been changed + OSL_ENSURE((m_aParameterValueForCache.get().size()-1) == m_pParameterNames->size(),"OKeySet::copyRowValue: Parameter values and names differ!"); + connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aParaValuesIter = m_aParameterValueForCache.get().begin() +1; + + bool bChanged = false; + SelectColumnsMetaData::const_iterator aParaIter = (*m_pParameterNames).begin(); + SelectColumnsMetaData::const_iterator aParaEnd = (*m_pParameterNames).end(); + for(sal_Int32 i = 1;aParaIter != aParaEnd;++aParaIter,++aParaValuesIter,++i) + { + ORowSetValue aValue(*aParaValuesIter); + aValue.setSigned(m_aSignedFlags[aParaIter->second.nPosition]); + if ( (_rInsertRow->get())[aParaIter->second.nPosition] != aValue ) + { + ORowSetValueVector aCopy(m_aParameterValueForCache); + (aCopy.get())[i] = (_rInsertRow->get())[aParaIter->second.nPosition]; + m_aUpdatedParameter[i_nBookmark] = aCopy; + bChanged = true; + } + } + if ( !bChanged ) + { + m_aUpdatedParameter.erase(i_nBookmark); + } + + // update the key values SelectColumnsMetaData::const_iterator aPosIter = (*m_pKeyColumnNames).begin(); SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); for(;aPosIter != aPosEnd;++aPosIter,++aIter) @@ -1149,9 +1330,23 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) Reference< XParameters > xParameter(m_xStatement,UNO_QUERY); OSL_ENSURE(xParameter.is(),"No Parameter interface!"); xParameter->clearParameters(); + sal_Int32 nPos=1; - connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aParaIter = m_aParameterValueForCache.get().begin(); - connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aParaEnd = m_aParameterValueForCache.get().end(); + connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aParaIter; + connectivity::ORowVector< ORowSetValue >::Vector::const_iterator aParaEnd; + OUpdatedParameter::iterator aUpdateFind = m_aUpdatedParameter.find(m_aKeyIter->first); + if ( aUpdateFind == m_aUpdatedParameter.end() ) + { + + aParaIter = m_aParameterValueForCache.get().begin(); + aParaEnd = m_aParameterValueForCache.get().end(); + } + else + { + aParaIter = aUpdateFind->second.get().begin(); + aParaEnd = aUpdateFind->second.get().end(); + } + for(++aParaIter;aParaIter != aParaEnd;++aParaIter,++nPos) { ::dbtools::setObjectWithInfo( xParameter, nPos, aParaIter->makeAny(), aParaIter->getTypeKind() ); @@ -1202,7 +1397,7 @@ sal_Bool OKeySet::fetchRow() const SelectColumnDescription& rColDesc = aPosIter->second; aIter->fill(rColDesc.nPosition,rColDesc.nType,rColDesc.bNullable,m_xDriverRow); } - m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,0))).first; + m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(0,NULL)))).first; } else m_bRowCountFinal = sal_True; @@ -1361,13 +1556,13 @@ Reference< XArray > SAL_CALL OKeySet::getArray( sal_Int32 columnIndex ) throw(SQ sal_Bool SAL_CALL OKeySet::rowUpdated( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::rowUpdated" ); - return m_aKeyIter != m_aKeyMap.begin() && m_aKeyIter != m_aKeyMap.end() && m_aKeyIter->second.second == 2; + return m_aKeyIter != m_aKeyMap.begin() && m_aKeyIter != m_aKeyMap.end() && m_aKeyIter->second.second.first == 2; } // ------------------------------------------------------------------------- sal_Bool SAL_CALL OKeySet::rowInserted( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OKeySet::rowInserted" ); - return m_aKeyIter != m_aKeyMap.begin() && m_aKeyIter != m_aKeyMap.end() && m_aKeyIter->second.second == 1; + return m_aKeyIter != m_aKeyMap.begin() && m_aKeyIter != m_aKeyMap.end() && m_aKeyIter->second.second.first == 1; } // ------------------------------------------------------------------------- sal_Bool SAL_CALL OKeySet::rowDeleted( ) throw(SQLException, RuntimeException) @@ -1413,20 +1608,22 @@ sal_Bool SAL_CALL OKeySet::rowDeleted( ) throw(SQLException, RuntimeException) // ----------------------------------------------------------------------------- namespace dbaccess { - void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns, - const Sequence< ::rtl::OUString>& _aColumnNames, + +void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rColumnNames, const ::rtl::OUString& _rsUpdateTableName, - SelectColumnsMetaData& _rColumnNames) + SelectColumnsMetaData& _rColumnAssignments) + { // get the real name of the columns Sequence< ::rtl::OUString> aSelNames(_rxQueryColumns->getElementNames()); const ::rtl::OUString* pSelBegin = aSelNames.getConstArray(); const ::rtl::OUString* pSelEnd = pSelBegin + aSelNames.getLength(); - const ::rtl::OUString* pColumnIter = _aColumnNames.getConstArray(); - const ::rtl::OUString* pColumnEnd = pColumnIter + _aColumnNames.getLength(); + const ::rtl::OUString* pColumnIter = _rColumnNames.getConstArray(); + const ::rtl::OUString* pColumnEnd = pColumnIter + _rColumnNames.getLength(); - ::comphelper::UStringMixLess aTmp(_rColumnNames.key_comp()); + ::comphelper::UStringMixLess aTmp(_rColumnAssignments.key_comp()); ::comphelper::UStringMixEqual bCase(static_cast< ::comphelper::UStringMixLess*>(&aTmp)->isCaseSensitive()); for(sal_Int32 nPos = 1;pSelBegin != pSelEnd;++pSelBegin,++nPos) @@ -1440,7 +1637,7 @@ namespace dbaccess for(;pColumnIter != pColumnEnd;++pColumnIter) { - if(bCase(sRealName,*pColumnIter) && bCase(_rsUpdateTableName,sTableName) && _rColumnNames.find(*pColumnIter) == _rColumnNames.end()) + if(bCase(sRealName,*pColumnIter) && bCase(_rsUpdateTableName,sTableName) && _rColumnAssignments.find(*pColumnIter) == _rColumnAssignments.end()) { sal_Int32 nType = 0; xColumnProp->getPropertyValue(PROPERTY_TYPE) >>= nType; @@ -1454,11 +1651,11 @@ namespace dbaccess xColumnProp->getPropertyValue(PROPERTY_ISNULLABLE) >>= bNullable; - _rColumnNames[sRealName] = SelectColumnDescription( nPos, nType,nScale,bNullable != sdbc::ColumnValue::NO_NULLS, sColumnDefault ); + _rColumnAssignments[sRealName] = SelectColumnDescription( nPos, nType,nScale,bNullable != sdbc::ColumnValue::NO_NULLS, sColumnDefault ); break; } } - pColumnIter = _aColumnNames.getConstArray(); + pColumnIter = _rColumnNames.getConstArray(); } } } @@ -1484,3 +1681,4 @@ void OKeySet::impl_convertValue_throw(const ORowSetRow& _rInsertRow,const Select } } // ----------------------------------------------------------------------------- + diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 5f92d8f4fa5b..169d8d4f65a6 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -80,12 +80,13 @@ namespace dbaccess // the elements of _rxQueryColumns must have the properties PROPERTY_REALNAME and PROPERTY_TABLENAME void getColumnPositions(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxQueryColumns, - const ::com::sun::star::uno::Sequence< ::rtl::OUString>& _aColumnNames, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rColumnNames, const ::rtl::OUString& _rsUpdateTableName, - SelectColumnsMetaData& _rColumnNames /* out */); + SelectColumnsMetaData& _rColumnAssignments /* out */); - typedef ::std::pair<ORowSetRow,sal_Int32> OKeySetValue; + typedef ::std::pair<ORowSetRow,::std::pair<sal_Int32,::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow> > > OKeySetValue; typedef ::std::map<sal_Int32,OKeySetValue > OKeySetMatrix; + typedef ::std::map<sal_Int32,ORowSetValueVector > OUpdatedParameter; // is used when the source supports keys class OKeySet : public OCacheSet { @@ -94,9 +95,11 @@ namespace dbaccess ::std::vector< ::rtl::OUString > m_aAutoColumns; // contains all columns which are autoincrement ones + OUpdatedParameter m_aUpdatedParameter; // contains all parameter which have been updated and are needed for refetching ORowSetValueVector m_aParameterValueForCache; SelectColumnsMetaData* m_pKeyColumnNames; // contains all key column names SelectColumnsMetaData* m_pColumnNames; // contains all column names + SelectColumnsMetaData* m_pParameterNames; // contains all parameter names SelectColumnsMetaData* m_pForeignColumnNames; // contains all column names of the rest connectivity::OSQLTable m_xTable; // reference to our table ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess> m_xTableKeys; @@ -106,6 +109,7 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryAnalyzer > m_xComposer; ::rtl::OUString m_sUpdateTableName; ::rtl::OUString m_aSelectComposedTableName; + ::std::vector< ::rtl::OUString > m_aFilterColumns; sal_Bool m_bRowCountFinal; @@ -125,8 +129,9 @@ namespace dbaccess * * \param _rInsertRow the row which was inserted * \param _rKeyRow The current key row of the row set. + + \param i_nBookmark The bookmark is used to update the parameter */ - void copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow); + void copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sal_Int32 i_nBookmark); ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getKeyColumns() const; void fillAllRows(); @@ -143,7 +148,7 @@ namespace dbaccess const ORowSetValueVector& _aParameterValueForCache); // late ctor which can throw exceptions - virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet); + virtual void construct(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter); // ::com::sun::star::sdbc::XRow virtual sal_Bool SAL_CALL wasNull( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 2d7bda3f29b4..156a3e21037b 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1775,7 +1775,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "frank.schoenheit@sun.com", "ORowSet::execute_NoApprove_NoNewConn: creating cache" ); - m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew,m_aParameterValueForCache ); + m_pCache = new ORowSetCache( xResultSet, m_xComposer.get(), m_aContext, aComposedUpdateTableName, m_bModified, m_bNew,m_aParameterValueForCache,m_aFilter ); if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) { m_nPrivileges = Privilege::SELECT; diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 94e6cf62e235..bd9de512e311 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -135,7 +135,8 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, const ::rtl::OUString& _rUpdateTableName, sal_Bool& _bModified, sal_Bool& _bNew, - const ORowSetValueVector& _aParameterValueForCache) + const ORowSetValueVector& _aParameterValueForCache, + const ::rtl::OUString& i_sRowSetFilter) :m_xSet(_xRs) ,m_xMetaData(Reference< XResultSetMetaDataSupplier >(_xRs,UNO_QUERY)->getMetaData()) ,m_aContext( _rContext ) @@ -257,7 +258,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, { m_pCacheSet = new OBookmarkSet(); m_xCacheSet = m_pCacheSet; - m_pCacheSet->construct(_xRs); + m_pCacheSet->construct(_xRs,i_sRowSetFilter); // check privileges m_nPrivileges = Privilege::SELECT; @@ -291,7 +292,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, { m_pCacheSet = new OStaticSet(); m_xCacheSet = m_pCacheSet; - m_pCacheSet->construct(_xRs); + m_pCacheSet->construct(_xRs,i_sRowSetFilter); m_nPrivileges = Privilege::SELECT; } else @@ -332,7 +333,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, { m_pCacheSet = pKeySet; m_xCacheSet = m_pCacheSet; - pKeySet->construct(_xRs); + pKeySet->construct(_xRs,i_sRowSetFilter); if(Reference<XResultSetUpdate>(_xRs,UNO_QUERY).is()) // this interface is optional so we have to check it { @@ -356,7 +357,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, m_xCacheSet = NULL; m_pCacheSet = new OStaticSet(); m_xCacheSet = m_pCacheSet; - m_pCacheSet->construct(_xRs); + m_pCacheSet->construct(_xRs,i_sRowSetFilter); m_nPrivileges = Privilege::SELECT; } } @@ -1281,8 +1282,7 @@ void ORowSetCache::updateRow( ORowSetMatrix::iterator& _rUpdateRow ) // refetch the whole row (*m_aMatrixIter) = NULL; - if ( !moveToBookmark(aBookmark) ) - m_aMatrixIter = m_pMatrix->end(); + moveToBookmark(aBookmark); // moveToBookmark((*(*m_aInsertRow))[0].makeAny()); // if(m_pCacheSet->rowUpdated()) diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx index 812cc3007e64..2153d84740bb 100644 --- a/dbaccess/source/core/api/RowSetCache.hxx +++ b/dbaccess/source/core/api/RowSetCache.hxx @@ -192,7 +192,8 @@ namespace dbaccess const ::rtl::OUString& _rUpdateTableName, sal_Bool& _bModified, sal_Bool& _bNew, - const ORowSetValueVector& _aParameterValueForCache); + const ORowSetValueVector& _aParameterValueForCache, + const ::rtl::OUString& i_sRowSetFilter); ~ORowSetCache(); diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index b14b4440275a..8bc9a665bc9d 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> +#include <com/sun/star/sdbc/XParameters.hpp> #include <com/sun/star/uno/XAggregation.hpp> #include <com/sun/star/util/XNumberFormatter.hpp> /** === end UNO includes === **/ @@ -708,13 +709,28 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr } catch( const Exception& ) { } - if ( !xResultSetMeta.is() ) + try + { + if ( !xResultSetMeta.is() ) + { + xStatement.reset( Reference< XStatement >( m_xConnection->createStatement(), UNO_QUERY_THROW ) ); + Reference< XPropertySet > xStatementProps( xStatement, UNO_QUERY_THROW ); + try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, makeAny( sal_False ) ); } + catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } + xResMetaDataSup.set( xStatement->executeQuery( sSQL ), UNO_QUERY_THROW ); + xResultSetMeta.set( xResMetaDataSup->getMetaData(), UNO_QUERY_THROW ); + } + } + catch( const Exception& ) { - xStatement.reset( Reference< XStatement >( m_xConnection->createStatement(), UNO_QUERY_THROW ) ); - Reference< XPropertySet > xStatementProps( xStatement, UNO_QUERY_THROW ); - try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, makeAny( sal_False ) ); } - catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - xResMetaDataSup.set( xStatement->executeQuery( sSQL ), UNO_QUERY_THROW ); + //@see issue http://qa.openoffice.org/issues/show_bug.cgi?id=110111 + // access returns a different order of column names when executing select * from + // and asking the columns from the metadata. + Reference< XParameters > xParameters( xPreparedStatement, UNO_QUERY_THROW ); + Reference< XIndexAccess > xPara = getParameters(); + for(sal_Int32 i = 1;i <= xPara->getCount();++i) + xParameters->setNull(i,DataType::VARCHAR); + xResMetaDataSup.set(xPreparedStatement->executeQuery(), UNO_QUERY_THROW ); xResultSetMeta.set( xResMetaDataSup->getMetaData(), UNO_QUERY_THROW ); } diff --git a/dbaccess/source/ext/adabas/adabasui.map b/dbaccess/source/ext/adabas/adabasui.map deleted file mode 100644 index 26ba4ca31813..000000000000 --- a/dbaccess/source/ext/adabas/adabasui.map +++ /dev/null @@ -1,8 +0,0 @@ -ADABASUI_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/dbaccess/source/ext/adabas/makefile.mk b/dbaccess/source/ext/adabas/makefile.mk index 72f5e8d511f3..e23310ac92f3 100644 --- a/dbaccess/source/ext/adabas/makefile.mk +++ b/dbaccess/source/ext/adabas/makefile.mk @@ -76,7 +76,7 @@ SHL1DEF=$(MISC)$/$(SHL1TARGET).def SHL1LIBS=$(SLB)$/$(TARGET).lib DEF1NAME=$(SHL1TARGET) DEF1EXPORTFILE=$(TARGET).dxp -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map # --- .res file ---------------------------------------------------------- RES1FILELIST=\ diff --git a/dbaccess/source/ext/macromigration/dbmm.map b/dbaccess/source/ext/macromigration/dbmm.map deleted file mode 100644 index 397b86886982..000000000000 --- a/dbaccess/source/ext/macromigration/dbmm.map +++ /dev/null @@ -1,8 +0,0 @@ -DBMM_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/dbaccess/source/ext/macromigration/makefile.mk b/dbaccess/source/ext/macromigration/makefile.mk index 8a17d9f18c36..41898091c26a 100644 --- a/dbaccess/source/ext/macromigration/makefile.mk +++ b/dbaccess/source/ext/macromigration/makefile.mk @@ -62,7 +62,7 @@ SLOFILES= $(SLO)$/macromigrationwizard.obj \ # --- library ----------------------------------- SHL1TARGET=$(TARGET)$(DLLPOSTFIX) -SHL1VERSIONMAP=$(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1STDLIBS= \ $(CPPULIB) \ diff --git a/dbaccess/source/filter/migration/exports.map b/dbaccess/source/filter/migration/exports.map deleted file mode 100644 index 8faa43a8aa07..000000000000 --- a/dbaccess/source/filter/migration/exports.map +++ /dev/null @@ -1,9 +0,0 @@ -DBACCESS_FLT_1_0 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -};
\ No newline at end of file diff --git a/dbaccess/source/filter/migration/makefile.mk b/dbaccess/source/filter/migration/makefile.mk index 71615d560f2a..7bb53208d9d0 100644 --- a/dbaccess/source/filter/migration/makefile.mk +++ b/dbaccess/source/filter/migration/makefile.mk @@ -64,7 +64,7 @@ SHL1DEPN= SHL1LIBS=$(LIB1TARGET) SHL1IMPLIB= i$(SHL1TARGET) # SHL1LIBS= $(SLB)$/$(TARGET).lib -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/dbaccess/source/filter/xml/exports.map b/dbaccess/source/filter/xml/exports.map deleted file mode 100644 index 8faa43a8aa07..000000000000 --- a/dbaccess/source/filter/xml/exports.map +++ /dev/null @@ -1,9 +0,0 @@ -DBACCESS_FLT_1_0 { - global: - component_getImplementationEnvironment; - component_getFactory; - component_writeInfo; - - local: - *; -};
\ No newline at end of file diff --git a/dbaccess/source/filter/xml/makefile.mk b/dbaccess/source/filter/xml/makefile.mk index 1f1bcbea65ab..6c6091c5f69e 100644 --- a/dbaccess/source/filter/xml/makefile.mk +++ b/dbaccess/source/filter/xml/makefile.mk @@ -104,7 +104,7 @@ SHL1DEPN= SHL1LIBS=$(LIB1TARGET) SHL1IMPLIB= i$(SHL1TARGET) # SHL1LIBS= $(SLB)$/$(TARGET).lib -SHL1VERSIONMAP=exports.map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 5dc8fe2ecba6..72db2ee129df 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -638,37 +638,45 @@ String OTableTreeListBox::getQualifiedTableName( SvLBoxEntry* _pEntry ) const { OSL_PRECOND( !isFolderEntry( _pEntry ), "OTableTreeListBox::getQualifiedTableName: folder entries not allowed here!" ); - Reference< XDatabaseMetaData > xMeta; - if ( !impl_getAndAssertMetaData( xMeta ) ) - return String(); + try + { + Reference< XDatabaseMetaData > xMeta; + if ( !impl_getAndAssertMetaData( xMeta ) ) + return String(); - ::rtl::OUString sCatalog; - ::rtl::OUString sSchema; - ::rtl::OUString sTable; + ::rtl::OUString sCatalog; + ::rtl::OUString sSchema; + ::rtl::OUString sTable; - SvLBoxEntry* pSchema = GetParent( _pEntry ); - if ( pSchema ) - { - SvLBoxEntry* pCatalog = GetParent( pSchema ); - if ( pCatalog - || ( xMeta->supportsCatalogsInDataManipulation() - && !xMeta->supportsSchemasInDataManipulation() - ) // here we support catalog but no schema - ) + SvLBoxEntry* pSchema = GetParent( _pEntry ); + if ( pSchema ) { - if ( pCatalog == NULL ) + SvLBoxEntry* pCatalog = GetParent( pSchema ); + if ( pCatalog + || ( xMeta->supportsCatalogsInDataManipulation() + && !xMeta->supportsSchemasInDataManipulation() + ) // here we support catalog but no schema + ) { - pCatalog = pSchema; - pSchema = NULL; + if ( pCatalog == NULL ) + { + pCatalog = pSchema; + pSchema = NULL; + } + sCatalog = GetEntryText( pCatalog ); } - sCatalog = GetEntryText( pCatalog ); + if ( pSchema ) + sSchema = GetEntryText(pSchema); } - if ( pSchema ) - sSchema = GetEntryText(pSchema); - } - sTable = GetEntryText( _pEntry ); + sTable = GetEntryText( _pEntry ); - return ::dbtools::composeTableName( xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); + return ::dbtools::composeTableName( xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return String(); } //------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 5670ff86b60e..f7c3daeb6543 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -1101,6 +1101,7 @@ void OCopyTableWizard::insertColumn(sal_Int32 _nPos,OFieldDescription* _pField) m_aDestVec.insert(m_aDestVec.begin() + _nPos, m_vDestColumns.insert(ODatabaseExport::TColumns::value_type(_pField->GetName(),_pField)).first); + m_mNameMapping[_pField->GetName()] = _pField->GetName(); } } // ----------------------------------------------------------------------------- @@ -1191,6 +1192,8 @@ void OCopyTableWizard::clearDestColumns() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OCopyTableWizard::clearDestColumns" ); clearColumns(m_vDestColumns,m_aDestVec); + m_bAddPKFirstTime = sal_True; + m_mNameMapping.clear(); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/util/dba.map b/dbaccess/util/dba.map deleted file mode 100644 index 9a3ed2329fc1..000000000000 --- a/dbaccess/util/dba.map +++ /dev/null @@ -1,8 +0,0 @@ -DBACCESS_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/dbaccess/util/dbu.map b/dbaccess/util/dbu.map deleted file mode 100644 index f5c9cb31fd3c..000000000000 --- a/dbaccess/util/dbu.map +++ /dev/null @@ -1,8 +0,0 @@ -DBACCESS_UI_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/dbaccess/util/makefile.mk b/dbaccess/util/makefile.mk index 94152b941476..8430b5edf8dc 100644 --- a/dbaccess/util/makefile.mk +++ b/dbaccess/util/makefile.mk @@ -79,7 +79,6 @@ DEF1NAME=$(SHL1TARGET) DEFLIB1NAME=$(TARGET) DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt \ $(SLB)$/$(TARGET).lib -# SHL1VERSIONMAP=$(TARGET).map SHL1USE_EXPORTS=name .ENDIF @@ -151,7 +150,6 @@ DEF2NAME=$(SHL2TARGET) DEFLIB2NAME=$(TARGET2) DEF2DEPN= $(MISC)$/$(SHL2TARGET).flt \ $(SLB)$/$(TARGET2).lib -# SHL2VERSIONMAP=$(TARGET2).map SHL2USE_EXPORTS=name ALL: \ @@ -207,7 +205,7 @@ SHL3STDLIBS= \ SHL3LIBS=$(LIB3TARGET) SHL3DEF=$(MISC)$/$(SHL3TARGET).def DEF3NAME=$(SHL3TARGET) -SHL3VERSIONMAP=$(TARGET3).map +SHL3VERSIONMAP=$(SOLARENV)/src/component.map .END diff --git a/dbaccess/util/sdbt.map b/dbaccess/util/sdbt.map deleted file mode 100644 index b2aca0c07ad0..000000000000 --- a/dbaccess/util/sdbt.map +++ /dev/null @@ -1,8 +0,0 @@ -DBACCESS_SDBTOOLS_1_0 { - global: - component_getImplementationEnvironment; - component_writeInfo; - component_getFactory; - local: - *; -}; diff --git a/reportdesign/util/makefile.mk b/reportdesign/util/makefile.mk index 3a0e89134ddf..32fe4eb2a5d6 100644 --- a/reportdesign/util/makefile.mk +++ b/reportdesign/util/makefile.mk @@ -164,7 +164,7 @@ SHL2DEPN=$(SHL1TARGETN) SHL2LIBS=$(LIB2TARGET) SHL2DEF=$(MISC)$/$(SHL2TARGET).def DEF2NAME=$(SHL2TARGET) -SHL2VERSIONMAP=$(TARGET2).map +SHL2VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF # --- .res file ---------------------------------------------------------- RES2FILELIST=\ @@ -219,7 +219,7 @@ SHL3STDLIBS+= \ SHL3DEPN=$(SHL1TARGETN) SHL3LIBS=$(LIB3TARGET) SHL3IMPLIB= i$(SHL3TARGET) -SHL3VERSIONMAP=rptui.map +SHL3VERSIONMAP=$(SOLARENV)/src/component.map SHL3DEF= $(MISC)$/$(SHL3TARGET).def DEF3NAME=$(SHL3TARGET) diff --git a/reportdesign/util/rpt.map b/reportdesign/util/rpt.map deleted file mode 100644 index 82864090dff7..000000000000 --- a/reportdesign/util/rpt.map +++ /dev/null @@ -1,9 +0,0 @@ -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - - local: - *; -}; diff --git a/reportdesign/util/rptui.map b/reportdesign/util/rptui.map deleted file mode 100644 index b34eff63c44f..000000000000 --- a/reportdesign/util/rptui.map +++ /dev/null @@ -1,8 +0,0 @@ -UDK_3_0_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; |