Commits

Anonymous committed 8d493b0

DEV300 masterfix: #i10000#: dbaccess: KeySet.[ch]xx: merge/build fixes

  • Participants
  • Parent commits 20b8370

Comments (0)

Files changed (2)

File dbaccess/source/core/api/KeySet.cxx

 			}
 		}
 	}
+    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)
 // -------------------------------------------------------------------------
 
 	// 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();
 
 	{
         const sal_Int32 nBookmark = ::comphelper::getINT32((_rInsertRow->get())[0].getAny());
 		m_aKeyIter = m_aKeyMap.find(nBookmark);
-	    m_aKeyIter->second.second = 2;
+	    m_aKeyIter->second.second.first = 2;
+        m_aKeyIter->second.second.second = xRow;
         copyRowValue(_rInsertRow,m_aKeyIter->second.first,nBookmark);
 	}
 }
 		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,1))).first;
+        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);
 	}
             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;
 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)
 // -----------------------------------------------------------------------------
 namespace dbaccess
 {
-	void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns,
-							const Sequence< ::rtl::OUString>& _aColumnNames,
-							const ::rtl::OUString& _rsUpdateTableName,
-							SelectColumnsMetaData& _rColumnNames,
-                            SelectColumnsMetaData& _rColumnAssignments)
-{
-    getColumnPositions( _rxQueryColumns, _rxColumns->getElementNames(), _rsUpdateTableName, _rColumnAssignments );
-}
 
 void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns,
 							const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rColumnNames,
     }
 }
 // -----------------------------------------------------------------------------
+

File dbaccess/source/core/api/KeySet.hxx

 
 	// 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 ::rtl::OUString& _rsUpdateTableName,
-							SelectColumnsMetaData& _rColumnAssignments /* out */);
-	void getColumnPositions(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxQueryColumns,
                             const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rColumnNames,
 							const ::rtl::OUString& _rsUpdateTableName,
 							SelectColumnsMetaData& _rColumnAssignments /* out */);