Tag: cws_src680_dba25 User: oj Date: 05/03/02 01:45:54 Modified: /dba/dbaccess/source/core/api/ CRowSetDataColumn.cxx, KeySet.cxx, RowSetBase.cxx
Log: #i43849# fix events when moving File Changes: Directory: /dba/dbaccess/source/core/api/ ========================================= File [changed]: CRowSetDataColumn.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/CRowSetDataColumn.cxx?r1=1.26&r2=1.26.102.1 Delta lines: +11 -3 -------------------- --- CRowSetDataColumn.cxx 2 Aug 2004 14:59:11 -0000 1.26 +++ CRowSetDataColumn.cxx 2 Mar 2005 09:45:33 -0000 1.26.102.1 @@ -2,9 +2,9 @@ * * $RCSfile: CRowSetDataColumn.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.26.102.1 $ * - * last change: $Author: hr $ $Date: 2004/08/02 14:59:11 $ + * last change: $Author: oj $ $Date: 2005/03/02 09:45:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -269,6 +269,14 @@ fire(&nHandle, &aNew, &m_aOldValue, 1, sal_False ); } + else if ( !m_aColumnValue.isNull() && m_aColumnValue == m_rEnd && !_rOldValue.isNull() ) + { + sal_Int32 nHandle = PROPERTY_ID_VALUE; + m_aOldValue = _rOldValue.makeAny(); + Any aNew; + + fire(&nHandle, &aNew, &m_aOldValue, 1, sal_False ); + } } // ----------------------------------------------------------------------------- DBG_NAME(ORowSetDataColumns ) File [changed]: KeySet.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/KeySet.cxx?r1=1.55&r2=1.55.4.1 Delta lines: +18 -13 --------------------- --- KeySet.cxx 16 Feb 2005 15:57:54 -0000 1.55 +++ KeySet.cxx 2 Mar 2005 09:45:33 -0000 1.55.4.1 @@ -2,9 +2,9 @@ * * $RCSfile: KeySet.cxx,v $ * - * $Revision: 1.55 $ + * $Revision: 1.55.4.1 $ * - * last change: $Author: vg $ $Date: 2005/02/16 15:57:54 $ + * last change: $Author: oj $ $Date: 2005/03/02 09:45:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -265,11 +265,12 @@ aFilter += aAnd; } - ::rtl::OUString sOldFilter = m_xComposer->getFilter(); - Reference<XSingleSelectQueryComposer> xQu(m_xComposer,UNO_QUERY); - xQu->setFilter(aFilter); - m_xStatement = m_xConnection->prepareStatement(m_xComposer->getQuery()); - xQu->setFilter(sOldFilter); + Reference< XMultiServiceFactory > xFactory(m_xConnection, UNO_QUERY_THROW); + Reference<XSingleSelectQueryComposer> xAnalyzer(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY); + xAnalyzer->setQuery(m_xComposer->getQuery()); + xAnalyzer->setFilter(aFilter); + m_xStatement = m_xConnection->prepareStatement(xAnalyzer->getQuery()); + ::comphelper::disposeComponent(xAnalyzer); } // ------------------------------------------------------------------------- Any SAL_CALL OKeySet::getBookmark( const ORowSetRow& _rRow ) throw(SQLException, RuntimeException) @@ -481,7 +482,7 @@ aSql += sSetValues; } else - throw SQLException(DBACORE_RESSTRING(RID_STR_NO_VALUE_CHANGED),m_xConnection,::rtl::OUString::createFromAscii("HY0000"),1000,Any()); + throw SQLException(DBACORE_RESSTRING(RID_STR_NO_VALUE_CHANGED),m_xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HY0000")),1000,Any()); if(sKeyCondition.getLength() || sIndexCondition.getLength()) { @@ -505,7 +506,7 @@ aSql += aCondition; } else - throw SQLException(DBACORE_RESSTRING(RID_STR_NO_CONDITION_FOR_PK),m_xConnection,::rtl::OUString::createFromAscii("HY0000"),1000,Any()); + throw SQLException(DBACORE_RESSTRING(RID_STR_NO_CONDITION_FOR_PK),m_xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HY0000")),1000,Any()); // now create end execute the prepared statement @@ -566,13 +567,14 @@ aSql += m_aComposedTableName; aSql += ::rtl::OUString::createFromAscii(" ( "); // set values and column names - ::rtl::OUString aValues = ::rtl::OUString::createFromAscii(" VALUES ( "); - static ::rtl::OUString aPara = ::rtl::OUString::createFromAscii("?,"); + ::rtl::OUString aValues(RTL_CONSTASCII_USTRINGPARAM(" VALUES ( ")); + static ::rtl::OUString aPara(RTL_CONSTASCII_USTRINGPARAM("?,")); ::rtl::OUString aQuote = getIdentifierQuoteString(); - static ::rtl::OUString aComma = ::rtl::OUString::createFromAscii(","); + static ::rtl::OUString aComma(RTL_CONSTASCII_USTRINGPARAM(",")); OColumnNamePos::const_iterator aIter = m_pColumnNames->begin(); sal_Int32 j = 1; + sal_Bool bModified = sal_False; for(;aIter != m_pColumnNames->end();++aIter,++j) { if((*_rInsertRow)[aIter->second.first].isModified()) @@ -580,8 +582,11 @@ aSql += ::dbtools::quoteName( aQuote,aIter->first); aSql += aComma; aValues += aPara; + bModified = sal_True; } } + if ( !bModified ) + throw SQLException(DBACORE_RESSTRING(RID_STR_NO_VALUE_CHANGED),m_xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HY0000")),1000,Any()); aSql = aSql.replaceAt(aSql.getLength()-1,1,::rtl::OUString::createFromAscii(")")); aValues = aValues.replaceAt(aValues.getLength()-1,1,::rtl::OUString::createFromAscii(")")); File [changed]: RowSetBase.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/RowSetBase.cxx?r1=1.73&r2=1.73.50.1 Delta lines: +16 -16 --------------------- --- RowSetBase.cxx 17 Nov 2004 14:42:24 -0000 1.73 +++ RowSetBase.cxx 2 Mar 2005 09:45:33 -0000 1.73.50.1 @@ -2,9 +2,9 @@ * * $RCSfile: RowSetBase.cxx,v $ * - * $Revision: 1.73 $ + * $Revision: 1.73.50.1 $ * - * last change: $Author: obo $ $Date: 2004/11/17 14:42:24 $ + * last change: $Author: oj $ $Date: 2005/03/02 09:45:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -622,9 +622,11 @@ if ( m_aBookmark.hasValue() ) // #104474# OJ positionCache(); + sal_Bool bAfterLast = m_pCache->isAfterLast(); bRet = m_pCache->next(); - if ( bRet ) + + if ( bRet || bAfterLast != m_pCache->isAfterLast() ) { // notification order // - column values @@ -734,25 +736,23 @@ ORowSetNotifier aNotifier( this ); // this will call cancelRowModification on the cache if necessary - ORowSetRow aOldValues = getOldRow(bWasNew); - - if(!m_bBeforeFirst) + if ( !m_bBeforeFirst ) { + ORowSetRow aOldValues = getOldRow(bWasNew); m_pCache->beforeFirst(); - m_aBookmark = Any(); - m_aCurrentRow = m_pCache->getEnd(); - m_aCurrentRow.setBookmark(m_aBookmark); - m_bBeforeFirst = !(m_bAfterLast = sal_False); // notification order // - column values // - cursorMoved setCurrentRow(sal_True,aOldValues,aGuard); - } // - IsModified - // - IsNew + // - Isnew aNotifier.fire(); + + // - RowCount/IsRowCountFinal + fireRowcount(); + } // to be done _after_ the notifications! m_aOldRow->clearRow(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
