1*9b5730f6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9b5730f6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9b5730f6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9b5730f6SAndrew Rist  * distributed with this work for additional information
6*9b5730f6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9b5730f6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9b5730f6SAndrew Rist  * "License"); you may not use this file except in compliance
9*9b5730f6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9b5730f6SAndrew Rist  *
11*9b5730f6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9b5730f6SAndrew Rist  *
13*9b5730f6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9b5730f6SAndrew Rist  * software distributed under the License is distributed on an
15*9b5730f6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9b5730f6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9b5730f6SAndrew Rist  * specific language governing permissions and limitations
18*9b5730f6SAndrew Rist  * under the License.
19*9b5730f6SAndrew Rist  *
20*9b5730f6SAndrew Rist  *************************************************************/
21*9b5730f6SAndrew Rist 
22*9b5730f6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_connectivity.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "MacabResultSet.hxx"
28cdf0e10cSrcweir #include "MacabAddressBook.hxx"
29cdf0e10cSrcweir #include "MacabRecords.hxx"
30cdf0e10cSrcweir #include "macabutilities.hxx"
31cdf0e10cSrcweir #include "MacabResultSetMetaData.hxx"
32cdf0e10cSrcweir #include "MacabConnection.hxx"
33cdf0e10cSrcweir #include "macabcondition.hxx"
34cdf0e10cSrcweir #include "macaborder.hxx"
35cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
36cdf0e10cSrcweir #include <com/sun/star/sdbcx/CompareBookmark.hpp>
37cdf0e10cSrcweir #include "TConnection.hxx"
38cdf0e10cSrcweir #include <connectivity/dbexception.hxx>
39cdf0e10cSrcweir #include "resource/sharedresources.hxx"
40cdf0e10cSrcweir #include "resource/macab_res.hrc"
41cdf0e10cSrcweir 
42cdf0e10cSrcweir using namespace connectivity::macab;
43cdf0e10cSrcweir using namespace cppu;
44cdf0e10cSrcweir using namespace com::sun::star::uno;
45cdf0e10cSrcweir using namespace com::sun::star::lang;
46cdf0e10cSrcweir using namespace com::sun::star::beans;
47cdf0e10cSrcweir using namespace com::sun::star::sdbc;
48cdf0e10cSrcweir using namespace com::sun::star::sdbcx;
49cdf0e10cSrcweir using namespace com::sun::star::io;
50cdf0e10cSrcweir using namespace com::sun::star::util;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir IMPLEMENT_SERVICE_INFO(MacabResultSet, "com.sun.star.sdbc.drivers.MacabResultSet", "com.sun.star.sdbc.ResultSet");
53cdf0e10cSrcweir // -------------------------------------------------------------------------
MacabResultSet(MacabCommonStatement * pStmt)54cdf0e10cSrcweir MacabResultSet::MacabResultSet(MacabCommonStatement* pStmt)
55cdf0e10cSrcweir 	: MacabResultSet_BASE(m_aMutex),
56cdf0e10cSrcweir 	  OPropertySetHelper(MacabResultSet_BASE::rBHelper),
57cdf0e10cSrcweir 	  m_xStatement(pStmt),
58cdf0e10cSrcweir 	  m_xMetaData(NULL),
59cdf0e10cSrcweir 	  m_aMacabRecords(),
60cdf0e10cSrcweir 	  m_nRowPos(-1),
61cdf0e10cSrcweir 	  m_bWasNull(sal_True)
62cdf0e10cSrcweir {
63cdf0e10cSrcweir 	m_sTableName = MacabAddressBook::getDefaultTableName();
64cdf0e10cSrcweir }
65cdf0e10cSrcweir // -------------------------------------------------------------------------
~MacabResultSet()66cdf0e10cSrcweir MacabResultSet::~MacabResultSet()
67cdf0e10cSrcweir {
68cdf0e10cSrcweir }
69cdf0e10cSrcweir // -------------------------------------------------------------------------
allMacabRecords()70cdf0e10cSrcweir void MacabResultSet::allMacabRecords()
71cdf0e10cSrcweir {
72cdf0e10cSrcweir 	MacabConnection* pConnection = static_cast< MacabConnection *>(m_xStatement->getConnection().get());
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	m_aMacabRecords = pConnection->getAddressBook()->getMacabRecords(m_sTableName);
75cdf0e10cSrcweir }
76cdf0e10cSrcweir // -------------------------------------------------------------------------
someMacabRecords(const MacabCondition * pCondition)77cdf0e10cSrcweir void MacabResultSet::someMacabRecords(const MacabCondition *pCondition)
78cdf0e10cSrcweir {
79cdf0e10cSrcweir 	MacabConnection* pConnection = static_cast< MacabConnection *>(m_xStatement->getConnection().get());
80cdf0e10cSrcweir 	MacabRecords* allRecords;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	allRecords = pConnection->getAddressBook()->getMacabRecords(m_sTableName);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	// Bad table!! Throw exception?
85cdf0e10cSrcweir 	if(allRecords == NULL)
86cdf0e10cSrcweir 		return;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir 	if(m_aMacabRecords != NULL && m_aMacabRecords != allRecords)
89cdf0e10cSrcweir 		delete m_aMacabRecords;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 	// The copy constructor copies everything but records (including the
92cdf0e10cSrcweir 	// maximum alloted size, which means that we'll never have to resize)
93cdf0e10cSrcweir 	m_aMacabRecords = new MacabRecords(allRecords);
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	MacabRecords::iterator iterator;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	for (iterator = allRecords->begin();
98cdf0e10cSrcweir 	     iterator != allRecords->end();
99cdf0e10cSrcweir 	     ++iterator)
100cdf0e10cSrcweir 	{
101cdf0e10cSrcweir 		if (pCondition->eval(*iterator))
102cdf0e10cSrcweir 			m_aMacabRecords->insertRecord(*iterator);
103cdf0e10cSrcweir 	}
104cdf0e10cSrcweir }
105cdf0e10cSrcweir // -------------------------------------------------------------------------
sortMacabRecords(const MacabOrder * pOrder)106cdf0e10cSrcweir void MacabResultSet::sortMacabRecords(const MacabOrder *pOrder)
107cdf0e10cSrcweir {
108cdf0e10cSrcweir 	// I do this with ints rather than an iterator because the ids will
109cdf0e10cSrcweir 	// be changing when we change the order and ints are easier to deal
110cdf0e10cSrcweir 	// with (for me).
111cdf0e10cSrcweir 	sal_Int32 i, j, size, smallest;
112cdf0e10cSrcweir 	size = m_aMacabRecords->size();
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	for(i = 0; i < size; i++)
115cdf0e10cSrcweir 	{
116cdf0e10cSrcweir 		smallest = i;
117cdf0e10cSrcweir 		for( j = i + 1; j < size; j++)
118cdf0e10cSrcweir 		{
119cdf0e10cSrcweir 			// if smallest > j
120cdf0e10cSrcweir 			if(pOrder->compare(m_aMacabRecords->getRecord(smallest),
121cdf0e10cSrcweir 						m_aMacabRecords->getRecord(j) ) > 0)
122cdf0e10cSrcweir 			{
123cdf0e10cSrcweir 				smallest = j;
124cdf0e10cSrcweir 			}
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 		}
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 		if(smallest != i)
129cdf0e10cSrcweir 		{
130cdf0e10cSrcweir 			m_aMacabRecords->swap(i,smallest);
131cdf0e10cSrcweir 		}
132cdf0e10cSrcweir 	}
133cdf0e10cSrcweir 
134cdf0e10cSrcweir }
135cdf0e10cSrcweir // -------------------------------------------------------------------------
setTableName(::rtl::OUString _sTableName)136cdf0e10cSrcweir void MacabResultSet::setTableName(::rtl::OUString _sTableName)
137cdf0e10cSrcweir {
138cdf0e10cSrcweir 	m_sTableName = _sTableName;
139cdf0e10cSrcweir }
140cdf0e10cSrcweir // -------------------------------------------------------------------------
disposing()141cdf0e10cSrcweir void MacabResultSet::disposing()
142cdf0e10cSrcweir {
143cdf0e10cSrcweir 	OPropertySetHelper::disposing();
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 	::osl::MutexGuard aGuard(m_aMutex);
146cdf0e10cSrcweir 
147cdf0e10cSrcweir m_xStatement.clear();
148cdf0e10cSrcweir m_xMetaData.clear();
149cdf0e10cSrcweir }
150cdf0e10cSrcweir // -------------------------------------------------------------------------
queryInterface(const Type & rType)151cdf0e10cSrcweir Any SAL_CALL MacabResultSet::queryInterface(const Type & rType) throw(RuntimeException)
152cdf0e10cSrcweir {
153cdf0e10cSrcweir 	Any aRet = OPropertySetHelper::queryInterface(rType);
154cdf0e10cSrcweir 	if (!aRet.hasValue())
155cdf0e10cSrcweir 		aRet = MacabResultSet_BASE::queryInterface(rType);
156cdf0e10cSrcweir 	return aRet;
157cdf0e10cSrcweir }
158cdf0e10cSrcweir // -------------------------------------------------------------------------
acquire()159cdf0e10cSrcweir void SAL_CALL MacabResultSet::acquire() throw()
160cdf0e10cSrcweir {
161cdf0e10cSrcweir 	MacabResultSet_BASE::acquire();
162cdf0e10cSrcweir }
163cdf0e10cSrcweir // -------------------------------------------------------------------------
release()164cdf0e10cSrcweir void SAL_CALL MacabResultSet::release() throw()
165cdf0e10cSrcweir {
166cdf0e10cSrcweir 	MacabResultSet_BASE::release();
167cdf0e10cSrcweir }
168cdf0e10cSrcweir // -------------------------------------------------------------------------
getTypes()169cdf0e10cSrcweir Sequence<  Type > SAL_CALL MacabResultSet::getTypes() throw(RuntimeException)
170cdf0e10cSrcweir {
171cdf0e10cSrcweir 	OTypeCollection aTypes(
172cdf0e10cSrcweir 		::getCppuType( (const Reference< ::com::sun::star::beans::XMultiPropertySet >*) 0),
173cdf0e10cSrcweir 		::getCppuType( (const Reference< ::com::sun::star::beans::XFastPropertySet >*) 0),
174cdf0e10cSrcweir 		::getCppuType( (const Reference< ::com::sun::star::beans::XPropertySet >*) 0));
175cdf0e10cSrcweir 
176cdf0e10cSrcweir 	return comphelper::concatSequences(aTypes.getTypes(), MacabResultSet_BASE::getTypes());
177cdf0e10cSrcweir }
178cdf0e10cSrcweir // -------------------------------------------------------------------------
getPropertySetInfo()179cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL MacabResultSet::getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException)
180cdf0e10cSrcweir {
181cdf0e10cSrcweir 	return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
182cdf0e10cSrcweir }
183cdf0e10cSrcweir // -------------------------------------------------------------------------
findColumn(const::rtl::OUString & columnName)184cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::findColumn(const ::rtl::OUString& columnName) throw(SQLException, RuntimeException)
185cdf0e10cSrcweir {
186cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
187cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
188cdf0e10cSrcweir 
189cdf0e10cSrcweir 	// find the first column with the name columnName
190cdf0e10cSrcweir 	Reference< XResultSetMetaData > xMeta = getMetaData();
191cdf0e10cSrcweir 	sal_Int32 nLen = xMeta->getColumnCount();
192cdf0e10cSrcweir 
193cdf0e10cSrcweir 	for (sal_Int32 i = 1; i <= nLen; ++i)
194cdf0e10cSrcweir 		if (xMeta->isCaseSensitive(i) ?
195cdf0e10cSrcweir 			columnName == xMeta->getColumnName(i) :
196cdf0e10cSrcweir 			columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
197cdf0e10cSrcweir 				return i;
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     ::connectivity::SharedResources aResources;
200cdf0e10cSrcweir     const ::rtl::OUString sError( aResources.getResourceStringWithSubstitution(
201cdf0e10cSrcweir             STR_NO_ELEMENT_NAME,
202cdf0e10cSrcweir             "$name$", columnName
203cdf0e10cSrcweir          ) );
204cdf0e10cSrcweir 	::dbtools::throwGenericSQLException(sError , *this);
205cdf0e10cSrcweir     // Unreachable:
206cdf0e10cSrcweir     OSL_ASSERT(false);
207cdf0e10cSrcweir     return 0;
208cdf0e10cSrcweir }
209cdf0e10cSrcweir // -------------------------------------------------------------------------
getString(sal_Int32 columnIndex)210cdf0e10cSrcweir ::rtl::OUString SAL_CALL MacabResultSet::getString(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
211cdf0e10cSrcweir {
212cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
213cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
214cdf0e10cSrcweir 
215cdf0e10cSrcweir 	::rtl::OUString aRet;
216cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
217cdf0e10cSrcweir 	m_bWasNull = true;
218cdf0e10cSrcweir 
219cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
220cdf0e10cSrcweir 	{
221cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
222cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
223cdf0e10cSrcweir 		if(aField != NULL)
224cdf0e10cSrcweir 		{
225cdf0e10cSrcweir 			if(aField->type == kABStringProperty)
226cdf0e10cSrcweir 			{
227cdf0e10cSrcweir 				aRet = CFStringToOUString( (CFStringRef) aField->value);
228cdf0e10cSrcweir 				m_bWasNull = false;
229cdf0e10cSrcweir 			}
230cdf0e10cSrcweir 		}
231cdf0e10cSrcweir 	}
232cdf0e10cSrcweir 
233cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
234cdf0e10cSrcweir 	return aRet;
235cdf0e10cSrcweir }
236cdf0e10cSrcweir // -------------------------------------------------------------------------
getBoolean(sal_Int32)237cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::getBoolean(sal_Int32) throw(SQLException, RuntimeException)
238cdf0e10cSrcweir {
239cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
240cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
241cdf0e10cSrcweir 
242cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBoolean", NULL);
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 	return sal_False;
245cdf0e10cSrcweir }
246cdf0e10cSrcweir // -------------------------------------------------------------------------
getByte(sal_Int32)247cdf0e10cSrcweir sal_Int8 SAL_CALL MacabResultSet::getByte(sal_Int32) throw(SQLException, RuntimeException)
248cdf0e10cSrcweir {
249cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
250cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
251cdf0e10cSrcweir 
252cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getByte", NULL);
253cdf0e10cSrcweir 
254cdf0e10cSrcweir 	sal_Int8 nRet = 0;
255cdf0e10cSrcweir 	return nRet;
256cdf0e10cSrcweir }
257cdf0e10cSrcweir // -------------------------------------------------------------------------
getShort(sal_Int32)258cdf0e10cSrcweir sal_Int16 SAL_CALL MacabResultSet::getShort(sal_Int32) throw(SQLException, RuntimeException)
259cdf0e10cSrcweir {
260cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
261cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
262cdf0e10cSrcweir 
263cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getShort", NULL);
264cdf0e10cSrcweir 
265cdf0e10cSrcweir 	sal_Int16 nRet = 0;
266cdf0e10cSrcweir 	return nRet;
267cdf0e10cSrcweir }
268cdf0e10cSrcweir // -------------------------------------------------------------------------
getInt(sal_Int32 columnIndex)269cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::getInt(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
270cdf0e10cSrcweir {
271cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
272cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 	sal_Int32 nRet = 0;
275cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
276cdf0e10cSrcweir 	m_bWasNull = true;
277cdf0e10cSrcweir 
278cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
279cdf0e10cSrcweir 	{
280cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
281cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
282cdf0e10cSrcweir 		if(aField != NULL)
283cdf0e10cSrcweir 		{
284cdf0e10cSrcweir 			if(aField->type == kABIntegerProperty)
285cdf0e10cSrcweir 			{
286cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
287cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
288cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., a float or a 64 bit int?
289cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
290cdf0e10cSrcweir 			}
291cdf0e10cSrcweir 		}
292cdf0e10cSrcweir 	}
293cdf0e10cSrcweir 
294cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
295cdf0e10cSrcweir 	return nRet;
296cdf0e10cSrcweir }
297cdf0e10cSrcweir // -------------------------------------------------------------------------
getLong(sal_Int32 columnIndex)298cdf0e10cSrcweir sal_Int64 SAL_CALL MacabResultSet::getLong(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
299cdf0e10cSrcweir {
300cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
301cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
302cdf0e10cSrcweir 
303cdf0e10cSrcweir 	sal_Int64 nRet = 0;
304cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
305cdf0e10cSrcweir 	m_bWasNull = true;
306cdf0e10cSrcweir 
307cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
308cdf0e10cSrcweir 	{
309cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
310cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
311cdf0e10cSrcweir 		if(aField != NULL)
312cdf0e10cSrcweir 		{
313cdf0e10cSrcweir 			if(aField->type == kABIntegerProperty)
314cdf0e10cSrcweir 			{
315cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
316cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
317cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., a float or a 32 bit int?
318cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nRet);
319cdf0e10cSrcweir 			}
320cdf0e10cSrcweir 		}
321cdf0e10cSrcweir 	}
322cdf0e10cSrcweir 
323cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
324cdf0e10cSrcweir 	return nRet;
325cdf0e10cSrcweir }
326cdf0e10cSrcweir // -------------------------------------------------------------------------
getFloat(sal_Int32 columnIndex)327cdf0e10cSrcweir float SAL_CALL MacabResultSet::getFloat(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
328cdf0e10cSrcweir {
329cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
330cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 	float nVal = 0;
333cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
334cdf0e10cSrcweir 	m_bWasNull = true;
335cdf0e10cSrcweir 
336cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
337cdf0e10cSrcweir 	{
338cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
339cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
340cdf0e10cSrcweir 		if(aField != NULL)
341cdf0e10cSrcweir 		{
342cdf0e10cSrcweir 			if(aField->type == kABRealProperty)
343cdf0e10cSrcweir 			{
344cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
345cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
346cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., an int or a double?
347cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
348cdf0e10cSrcweir 			}
349cdf0e10cSrcweir 		}
350cdf0e10cSrcweir 	}
351cdf0e10cSrcweir 
352cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
353cdf0e10cSrcweir 	return nVal;
354cdf0e10cSrcweir }
355cdf0e10cSrcweir // -------------------------------------------------------------------------
getDouble(sal_Int32 columnIndex)356cdf0e10cSrcweir double SAL_CALL MacabResultSet::getDouble(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
357cdf0e10cSrcweir {
358cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
359cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
360cdf0e10cSrcweir 
361cdf0e10cSrcweir 	double nVal = 0;
362cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
363cdf0e10cSrcweir 	m_bWasNull = true;
364cdf0e10cSrcweir 
365cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
366cdf0e10cSrcweir 	{
367cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
368cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
369cdf0e10cSrcweir 		if(aField != NULL)
370cdf0e10cSrcweir 		{
371cdf0e10cSrcweir 			if(aField->type == kABRealProperty)
372cdf0e10cSrcweir 			{
373cdf0e10cSrcweir 				CFNumberType numberType = CFNumberGetType( (CFNumberRef) aField->value );
374cdf0e10cSrcweir 				// m_bWasNull now becomes whether getting the value was successful
375cdf0e10cSrcweir 				// Should we check for the wrong type here, e.g., an int or a float?
376cdf0e10cSrcweir 				m_bWasNull = !CFNumberGetValue((CFNumberRef) aField->value, numberType, &nVal);
377cdf0e10cSrcweir 			}
378cdf0e10cSrcweir 		}
379cdf0e10cSrcweir 	}
380cdf0e10cSrcweir 
381cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
382cdf0e10cSrcweir 	return nVal;
383cdf0e10cSrcweir }
384cdf0e10cSrcweir // -------------------------------------------------------------------------
getBytes(sal_Int32)385cdf0e10cSrcweir Sequence< sal_Int8 > SAL_CALL MacabResultSet::getBytes(sal_Int32) throw(SQLException, RuntimeException)
386cdf0e10cSrcweir {
387cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
388cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
389cdf0e10cSrcweir 
390cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBytes", NULL);
391cdf0e10cSrcweir 
392cdf0e10cSrcweir 	return Sequence< sal_Int8 >();
393cdf0e10cSrcweir }
394cdf0e10cSrcweir // -------------------------------------------------------------------------
getDate(sal_Int32)395cdf0e10cSrcweir Date SAL_CALL MacabResultSet::getDate(sal_Int32) throw(SQLException, RuntimeException)
396cdf0e10cSrcweir {
397cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
398cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
399cdf0e10cSrcweir 
400cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getDate", NULL);
401cdf0e10cSrcweir 
402cdf0e10cSrcweir 	Date aRet;
403cdf0e10cSrcweir 	return aRet;
404cdf0e10cSrcweir }
405cdf0e10cSrcweir // -------------------------------------------------------------------------
getTime(sal_Int32)406cdf0e10cSrcweir Time SAL_CALL MacabResultSet::getTime(sal_Int32) throw(SQLException, RuntimeException)
407cdf0e10cSrcweir {
408cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
409cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
410cdf0e10cSrcweir 
411cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getTime", NULL);
412cdf0e10cSrcweir 
413cdf0e10cSrcweir 	Time nRet;
414cdf0e10cSrcweir 	return nRet;
415cdf0e10cSrcweir }
416cdf0e10cSrcweir // -------------------------------------------------------------------------
getTimestamp(sal_Int32 columnIndex)417cdf0e10cSrcweir DateTime SAL_CALL MacabResultSet::getTimestamp(sal_Int32 columnIndex) throw(SQLException, RuntimeException)
418cdf0e10cSrcweir {
419cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
420cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
421cdf0e10cSrcweir 
422cdf0e10cSrcweir 	DateTime nRet;
423cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
424cdf0e10cSrcweir 	m_bWasNull = true;
425cdf0e10cSrcweir 
426cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords && m_xMetaData.is())
427cdf0e10cSrcweir 	{
428cdf0e10cSrcweir 		sal_Int32 nFieldNumber = m_xMetaData->fieldAtColumn(columnIndex);
429cdf0e10cSrcweir 		macabfield *aField = m_aMacabRecords->getField(m_nRowPos,nFieldNumber);
430cdf0e10cSrcweir 		if(aField != NULL)
431cdf0e10cSrcweir 		{
432cdf0e10cSrcweir 			if(aField->type == kABDateProperty)
433cdf0e10cSrcweir 			{
434cdf0e10cSrcweir 				nRet = CFDateToDateTime((CFDateRef) aField->value);
435cdf0e10cSrcweir 				m_bWasNull = false;
436cdf0e10cSrcweir 			}
437cdf0e10cSrcweir 		}
438cdf0e10cSrcweir 	}
439cdf0e10cSrcweir 
440cdf0e10cSrcweir // Trigger an exception if m_bWasNull is true?
441cdf0e10cSrcweir 	return nRet;
442cdf0e10cSrcweir }
443cdf0e10cSrcweir // -------------------------------------------------------------------------
getBinaryStream(sal_Int32)444cdf0e10cSrcweir Reference< XInputStream > SAL_CALL MacabResultSet::getBinaryStream(sal_Int32) throw(SQLException, RuntimeException)
445cdf0e10cSrcweir {
446cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
447cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
448cdf0e10cSrcweir 
449cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBinaryStream", NULL);
450cdf0e10cSrcweir 
451cdf0e10cSrcweir 	return NULL;
452cdf0e10cSrcweir }
453cdf0e10cSrcweir // -------------------------------------------------------------------------
getCharacterStream(sal_Int32)454cdf0e10cSrcweir Reference< XInputStream > SAL_CALL MacabResultSet::getCharacterStream(sal_Int32) throw(SQLException, RuntimeException)
455cdf0e10cSrcweir {
456cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
457cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
458cdf0e10cSrcweir 
459cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getCharacterStream", NULL);
460cdf0e10cSrcweir 
461cdf0e10cSrcweir 	return NULL;
462cdf0e10cSrcweir }
463cdf0e10cSrcweir // -------------------------------------------------------------------------
getObject(sal_Int32,const Reference<::com::sun::star::container::XNameAccess> &)464cdf0e10cSrcweir Any SAL_CALL MacabResultSet::getObject(sal_Int32, const Reference< ::com::sun::star::container::XNameAccess >&) throw(SQLException, RuntimeException)
465cdf0e10cSrcweir {
466cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
467cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
468cdf0e10cSrcweir 
469cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getObject", NULL);
470cdf0e10cSrcweir 
471cdf0e10cSrcweir 	return Any();
472cdf0e10cSrcweir }
473cdf0e10cSrcweir // -------------------------------------------------------------------------
getRef(sal_Int32)474cdf0e10cSrcweir Reference< XRef > SAL_CALL MacabResultSet::getRef(sal_Int32) throw(SQLException, RuntimeException)
475cdf0e10cSrcweir {
476cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
477cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
478cdf0e10cSrcweir 
479cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getRef", NULL);
480cdf0e10cSrcweir 
481cdf0e10cSrcweir 	return NULL;
482cdf0e10cSrcweir }
483cdf0e10cSrcweir // -------------------------------------------------------------------------
getBlob(sal_Int32)484cdf0e10cSrcweir Reference< XBlob > SAL_CALL MacabResultSet::getBlob(sal_Int32) throw(SQLException, RuntimeException)
485cdf0e10cSrcweir {
486cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
487cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
488cdf0e10cSrcweir 
489cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getBlob", NULL);
490cdf0e10cSrcweir 
491cdf0e10cSrcweir 	return NULL;
492cdf0e10cSrcweir }
493cdf0e10cSrcweir // -------------------------------------------------------------------------
getClob(sal_Int32)494cdf0e10cSrcweir Reference< XClob > SAL_CALL MacabResultSet::getClob(sal_Int32) throw(SQLException, RuntimeException)
495cdf0e10cSrcweir {
496cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
497cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
498cdf0e10cSrcweir 
499cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getClob", NULL);
500cdf0e10cSrcweir 
501cdf0e10cSrcweir 	return NULL;
502cdf0e10cSrcweir }
503cdf0e10cSrcweir // -------------------------------------------------------------------------
getArray(sal_Int32)504cdf0e10cSrcweir Reference< XArray > SAL_CALL MacabResultSet::getArray(sal_Int32) throw(SQLException, RuntimeException)
505cdf0e10cSrcweir {
506cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
507cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
508cdf0e10cSrcweir 
509cdf0e10cSrcweir ::dbtools::throwFunctionNotSupportedException("getArray", NULL);
510cdf0e10cSrcweir 
511cdf0e10cSrcweir 	return NULL;
512cdf0e10cSrcweir }
513cdf0e10cSrcweir // -------------------------------------------------------------------------
getMetaData()514cdf0e10cSrcweir Reference< XResultSetMetaData > SAL_CALL MacabResultSet::getMetaData() throw(SQLException, RuntimeException)
515cdf0e10cSrcweir {
516cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
517cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
518cdf0e10cSrcweir 
519cdf0e10cSrcweir 	if (!m_xMetaData.is())
520cdf0e10cSrcweir 		m_xMetaData = new MacabResultSetMetaData(m_xStatement->getOwnConnection(), m_sTableName);
521cdf0e10cSrcweir 
522cdf0e10cSrcweir 	Reference< XResultSetMetaData > xMetaData = m_xMetaData.get();
523cdf0e10cSrcweir 	return xMetaData;
524cdf0e10cSrcweir }
525cdf0e10cSrcweir // -------------------------------------------------------------------------
isBeforeFirst()526cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isBeforeFirst() throw(SQLException, RuntimeException)
527cdf0e10cSrcweir {
528cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
529cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
530cdf0e10cSrcweir 
531cdf0e10cSrcweir 	if (m_nRowPos == -1)
532cdf0e10cSrcweir 		return sal_True;
533cdf0e10cSrcweir 
534cdf0e10cSrcweir 	return sal_False;
535cdf0e10cSrcweir }
536cdf0e10cSrcweir // -------------------------------------------------------------------------
isAfterLast()537cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isAfterLast() throw(SQLException, RuntimeException)
538cdf0e10cSrcweir {
539cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
540cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
541cdf0e10cSrcweir 
542cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
543cdf0e10cSrcweir 	if (m_nRowPos == nRecords)
544cdf0e10cSrcweir 		return sal_True;
545cdf0e10cSrcweir 
546cdf0e10cSrcweir 	return sal_False;
547cdf0e10cSrcweir }
548cdf0e10cSrcweir // -------------------------------------------------------------------------
isFirst()549cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isFirst() throw(SQLException, RuntimeException)
550cdf0e10cSrcweir {
551cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
552cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
553cdf0e10cSrcweir 
554cdf0e10cSrcweir 	if (m_nRowPos == 0)
555cdf0e10cSrcweir 		return sal_True;
556cdf0e10cSrcweir 
557cdf0e10cSrcweir 	return sal_False;
558cdf0e10cSrcweir }
559cdf0e10cSrcweir // -------------------------------------------------------------------------
isLast()560cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::isLast() throw(SQLException, RuntimeException)
561cdf0e10cSrcweir {
562cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
563cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
564cdf0e10cSrcweir 
565cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
566cdf0e10cSrcweir 	if (m_nRowPos == nRecords - 1)
567cdf0e10cSrcweir 		return sal_True;
568cdf0e10cSrcweir 
569cdf0e10cSrcweir 	return sal_False;
570cdf0e10cSrcweir }
571cdf0e10cSrcweir // -------------------------------------------------------------------------
beforeFirst()572cdf0e10cSrcweir void SAL_CALL MacabResultSet::beforeFirst() throw(SQLException, RuntimeException)
573cdf0e10cSrcweir {
574cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
575cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
576cdf0e10cSrcweir 
577cdf0e10cSrcweir 	// move before the first row
578cdf0e10cSrcweir 	m_nRowPos = -1;
579cdf0e10cSrcweir }
580cdf0e10cSrcweir // -------------------------------------------------------------------------
afterLast()581cdf0e10cSrcweir void SAL_CALL MacabResultSet::afterLast() throw(SQLException, RuntimeException)
582cdf0e10cSrcweir {
583cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
584cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
585cdf0e10cSrcweir 
586cdf0e10cSrcweir 	// move after the last row
587cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
588cdf0e10cSrcweir 	m_nRowPos = nRecords;
589cdf0e10cSrcweir }
590cdf0e10cSrcweir // -------------------------------------------------------------------------
close()591cdf0e10cSrcweir void SAL_CALL MacabResultSet::close() throw(SQLException, RuntimeException)
592cdf0e10cSrcweir {
593cdf0e10cSrcweir 	{
594cdf0e10cSrcweir 		::osl::MutexGuard aGuard( m_aMutex );
595cdf0e10cSrcweir 		checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
596cdf0e10cSrcweir 	}
597cdf0e10cSrcweir 	dispose();
598cdf0e10cSrcweir }
599cdf0e10cSrcweir // -------------------------------------------------------------------------
first()600cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::first() throw(SQLException, RuntimeException)
601cdf0e10cSrcweir {
602cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
603cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
604cdf0e10cSrcweir 
605cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
606cdf0e10cSrcweir 	if (nRecords == 0)
607cdf0e10cSrcweir 		return sal_False;
608cdf0e10cSrcweir 
609cdf0e10cSrcweir 	m_nRowPos = 0;
610cdf0e10cSrcweir 	return sal_True;
611cdf0e10cSrcweir }
612cdf0e10cSrcweir // -------------------------------------------------------------------------
last()613cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::last() throw(SQLException, RuntimeException)
614cdf0e10cSrcweir {
615cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
616cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
617cdf0e10cSrcweir 
618cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
619cdf0e10cSrcweir 	if (nRecords == 0)
620cdf0e10cSrcweir 		return sal_False;
621cdf0e10cSrcweir 
622cdf0e10cSrcweir 	m_nRowPos = nRecords - 1;
623cdf0e10cSrcweir 	return sal_True;
624cdf0e10cSrcweir }
625cdf0e10cSrcweir // -------------------------------------------------------------------------
getRow()626cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::getRow() throw(SQLException, RuntimeException)
627cdf0e10cSrcweir {
628cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
629cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
630cdf0e10cSrcweir 
631cdf0e10cSrcweir 	return m_nRowPos;
632cdf0e10cSrcweir }
633cdf0e10cSrcweir // -------------------------------------------------------------------------
absolute(sal_Int32 row)634cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::absolute(sal_Int32 row) throw(SQLException, RuntimeException)
635cdf0e10cSrcweir {
636cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
637cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
638cdf0e10cSrcweir 
639cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
640cdf0e10cSrcweir 	if (row <= -1 ||
641cdf0e10cSrcweir 	    row >= nRecords)
642cdf0e10cSrcweir 		return sal_False;
643cdf0e10cSrcweir 
644cdf0e10cSrcweir 	m_nRowPos = row;
645cdf0e10cSrcweir 	return sal_True;
646cdf0e10cSrcweir }
647cdf0e10cSrcweir // -------------------------------------------------------------------------
relative(sal_Int32 row)648cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::relative(sal_Int32 row) throw(SQLException, RuntimeException)
649cdf0e10cSrcweir {
650cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
651cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
652cdf0e10cSrcweir 
653cdf0e10cSrcweir 	return absolute(m_nRowPos + row);
654cdf0e10cSrcweir }
655cdf0e10cSrcweir // -------------------------------------------------------------------------
next()656cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::next() throw(SQLException, RuntimeException)
657cdf0e10cSrcweir {
658cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
659cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
660cdf0e10cSrcweir 
661cdf0e10cSrcweir 	return absolute(m_nRowPos + 1);
662cdf0e10cSrcweir }
663cdf0e10cSrcweir // -------------------------------------------------------------------------
previous()664cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::previous() throw(SQLException, RuntimeException)
665cdf0e10cSrcweir {
666cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
667cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
668cdf0e10cSrcweir 
669cdf0e10cSrcweir 	return absolute(m_nRowPos - 1);
670cdf0e10cSrcweir }
671cdf0e10cSrcweir // -------------------------------------------------------------------------
getStatement()672cdf0e10cSrcweir Reference< XInterface > SAL_CALL MacabResultSet::getStatement() throw(SQLException, RuntimeException)
673cdf0e10cSrcweir {
674cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
675cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
676cdf0e10cSrcweir 
677cdf0e10cSrcweir 	Reference< XStatement > xStatement = m_xStatement.get();
678cdf0e10cSrcweir 	return xStatement;
679cdf0e10cSrcweir }
680cdf0e10cSrcweir // -------------------------------------------------------------------------
rowDeleted()681cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::rowDeleted() throw(SQLException, RuntimeException)
682cdf0e10cSrcweir {
683cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
684cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
685cdf0e10cSrcweir 
686cdf0e10cSrcweir 	return sal_False;
687cdf0e10cSrcweir }
688cdf0e10cSrcweir // -------------------------------------------------------------------------
rowInserted()689cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::rowInserted() throw(SQLException, RuntimeException)
690cdf0e10cSrcweir {
691cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
692cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
693cdf0e10cSrcweir 
694cdf0e10cSrcweir 	return sal_False;
695cdf0e10cSrcweir }
696cdf0e10cSrcweir // -------------------------------------------------------------------------
rowUpdated()697cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::rowUpdated() throw(SQLException, RuntimeException)
698cdf0e10cSrcweir {
699cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
700cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
701cdf0e10cSrcweir 
702cdf0e10cSrcweir 	return sal_False;
703cdf0e10cSrcweir }
704cdf0e10cSrcweir // -------------------------------------------------------------------------
wasNull()705cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::wasNull() throw(SQLException, RuntimeException)
706cdf0e10cSrcweir {
707cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
708cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
709cdf0e10cSrcweir 
710cdf0e10cSrcweir 	return m_bWasNull;
711cdf0e10cSrcweir }
712cdf0e10cSrcweir // -------------------------------------------------------------------------
cancel()713cdf0e10cSrcweir void SAL_CALL MacabResultSet::cancel() throw(RuntimeException)
714cdf0e10cSrcweir {
715cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
716cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
717cdf0e10cSrcweir }
718cdf0e10cSrcweir // -------------------------------------------------------------------------
clearWarnings()719cdf0e10cSrcweir void SAL_CALL MacabResultSet::clearWarnings() throw(SQLException, RuntimeException)
720cdf0e10cSrcweir {
721cdf0e10cSrcweir }
722cdf0e10cSrcweir // -------------------------------------------------------------------------
getWarnings()723cdf0e10cSrcweir Any SAL_CALL MacabResultSet::getWarnings() throw(SQLException, RuntimeException)
724cdf0e10cSrcweir {
725cdf0e10cSrcweir 	return Any();
726cdf0e10cSrcweir }
727cdf0e10cSrcweir // -------------------------------------------------------------------------
insertRow()728cdf0e10cSrcweir void SAL_CALL MacabResultSet::insertRow() throw(SQLException, RuntimeException)
729cdf0e10cSrcweir {
730cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
731cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
732cdf0e10cSrcweir 
733cdf0e10cSrcweir 	// you only have to implement this if you want to insert new rows
734cdf0e10cSrcweir }
735cdf0e10cSrcweir // -------------------------------------------------------------------------
updateRow()736cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateRow() throw(SQLException, RuntimeException)
737cdf0e10cSrcweir {
738cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
739cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
740cdf0e10cSrcweir 
741cdf0e10cSrcweir 	// only when you allow updates
742cdf0e10cSrcweir }
743cdf0e10cSrcweir // -------------------------------------------------------------------------
deleteRow()744cdf0e10cSrcweir void SAL_CALL MacabResultSet::deleteRow() throw(SQLException, RuntimeException)
745cdf0e10cSrcweir {
746cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
747cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
748cdf0e10cSrcweir }
749cdf0e10cSrcweir // -------------------------------------------------------------------------
cancelRowUpdates()750cdf0e10cSrcweir void SAL_CALL MacabResultSet::cancelRowUpdates() throw(SQLException, RuntimeException)
751cdf0e10cSrcweir {
752cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
753cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
754cdf0e10cSrcweir }
755cdf0e10cSrcweir // -------------------------------------------------------------------------
moveToInsertRow()756cdf0e10cSrcweir void SAL_CALL MacabResultSet::moveToInsertRow() throw(SQLException, RuntimeException)
757cdf0e10cSrcweir {
758cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
759cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
760cdf0e10cSrcweir 
761cdf0e10cSrcweir 	// only when you allow inserts
762cdf0e10cSrcweir }
763cdf0e10cSrcweir // -------------------------------------------------------------------------
moveToCurrentRow()764cdf0e10cSrcweir void SAL_CALL MacabResultSet::moveToCurrentRow() throw(SQLException, RuntimeException)
765cdf0e10cSrcweir {
766cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
767cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
768cdf0e10cSrcweir }
769cdf0e10cSrcweir // -------------------------------------------------------------------------
updateNull(sal_Int32)770cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateNull(sal_Int32) throw(SQLException, RuntimeException)
771cdf0e10cSrcweir {
772cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
773cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
774cdf0e10cSrcweir }
775cdf0e10cSrcweir // -------------------------------------------------------------------------
updateBoolean(sal_Int32,sal_Bool)776cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateBoolean(sal_Int32, sal_Bool) throw(SQLException, RuntimeException)
777cdf0e10cSrcweir {
778cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
779cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
780cdf0e10cSrcweir }
781cdf0e10cSrcweir // -------------------------------------------------------------------------
updateByte(sal_Int32,sal_Int8)782cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateByte(sal_Int32, sal_Int8) throw(SQLException, RuntimeException)
783cdf0e10cSrcweir {
784cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
785cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
786cdf0e10cSrcweir }
787cdf0e10cSrcweir // -------------------------------------------------------------------------
updateShort(sal_Int32,sal_Int16)788cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateShort(sal_Int32, sal_Int16) throw(SQLException, RuntimeException)
789cdf0e10cSrcweir {
790cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
791cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
792cdf0e10cSrcweir }
793cdf0e10cSrcweir // -------------------------------------------------------------------------
updateInt(sal_Int32,sal_Int32)794cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateInt(sal_Int32, sal_Int32) throw(SQLException, RuntimeException)
795cdf0e10cSrcweir {
796cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
797cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
798cdf0e10cSrcweir }
799cdf0e10cSrcweir // -------------------------------------------------------------------------
updateLong(sal_Int32,sal_Int64)800cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateLong(sal_Int32, sal_Int64) throw(SQLException, RuntimeException)
801cdf0e10cSrcweir {
802cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
803cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
804cdf0e10cSrcweir }
805cdf0e10cSrcweir // -----------------------------------------------------------------------
updateFloat(sal_Int32,float)806cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateFloat(sal_Int32, float) throw(SQLException, RuntimeException)
807cdf0e10cSrcweir {
808cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
809cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
810cdf0e10cSrcweir }
811cdf0e10cSrcweir // -------------------------------------------------------------------------
updateDouble(sal_Int32,double)812cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateDouble(sal_Int32, double) throw(SQLException, RuntimeException)
813cdf0e10cSrcweir {
814cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
815cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
816cdf0e10cSrcweir }
817cdf0e10cSrcweir // -------------------------------------------------------------------------
updateString(sal_Int32,const::rtl::OUString &)818cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateString(sal_Int32, const ::rtl::OUString&) throw(SQLException, RuntimeException)
819cdf0e10cSrcweir {
820cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
821cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
822cdf0e10cSrcweir }
823cdf0e10cSrcweir // -------------------------------------------------------------------------
updateBytes(sal_Int32,const Sequence<sal_Int8> &)824cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateBytes(sal_Int32, const Sequence< sal_Int8 >&) throw(SQLException, RuntimeException)
825cdf0e10cSrcweir {
826cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
827cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
828cdf0e10cSrcweir }
829cdf0e10cSrcweir // -------------------------------------------------------------------------
updateDate(sal_Int32,const Date &)830cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateDate(sal_Int32, const Date&) throw(SQLException, RuntimeException)
831cdf0e10cSrcweir {
832cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
833cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
834cdf0e10cSrcweir }
835cdf0e10cSrcweir // -------------------------------------------------------------------------
updateTime(sal_Int32,const Time &)836cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateTime(sal_Int32, const Time&) throw(SQLException, RuntimeException)
837cdf0e10cSrcweir {
838cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
839cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
840cdf0e10cSrcweir }
841cdf0e10cSrcweir // -------------------------------------------------------------------------
updateTimestamp(sal_Int32,const DateTime &)842cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateTimestamp(sal_Int32, const DateTime&) throw(SQLException, RuntimeException)
843cdf0e10cSrcweir {
844cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
845cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
846cdf0e10cSrcweir }
847cdf0e10cSrcweir // -------------------------------------------------------------------------
updateBinaryStream(sal_Int32,const Reference<XInputStream> &,sal_Int32)848cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateBinaryStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
849cdf0e10cSrcweir {
850cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
851cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
852cdf0e10cSrcweir }
853cdf0e10cSrcweir // -------------------------------------------------------------------------
updateCharacterStream(sal_Int32,const Reference<XInputStream> &,sal_Int32)854cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateCharacterStream(sal_Int32, const Reference< XInputStream >&, sal_Int32) throw(SQLException, RuntimeException)
855cdf0e10cSrcweir {
856cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
857cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
858cdf0e10cSrcweir }
859cdf0e10cSrcweir // -------------------------------------------------------------------------
refreshRow()860cdf0e10cSrcweir void SAL_CALL MacabResultSet::refreshRow() throw(SQLException, RuntimeException)
861cdf0e10cSrcweir {
862cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
863cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
864cdf0e10cSrcweir }
865cdf0e10cSrcweir // -------------------------------------------------------------------------
updateObject(sal_Int32,const Any &)866cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateObject(sal_Int32, const Any&) throw(SQLException, RuntimeException)
867cdf0e10cSrcweir {
868cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
869cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
870cdf0e10cSrcweir }
871cdf0e10cSrcweir // -------------------------------------------------------------------------
updateNumericObject(sal_Int32,const Any &,sal_Int32)872cdf0e10cSrcweir void SAL_CALL MacabResultSet::updateNumericObject(sal_Int32, const Any&, sal_Int32) throw(SQLException, RuntimeException)
873cdf0e10cSrcweir {
874cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
875cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
876cdf0e10cSrcweir }
877cdf0e10cSrcweir // -------------------------------------------------------------------------
878cdf0e10cSrcweir // XRowLocate
getBookmark()879cdf0e10cSrcweir Any SAL_CALL MacabResultSet::getBookmark() throw( SQLException,  RuntimeException)
880cdf0e10cSrcweir {
881cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
882cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
883cdf0e10cSrcweir 
884cdf0e10cSrcweir 	sal_Int32 nRecords = m_aMacabRecords->size();
885cdf0e10cSrcweir 
886cdf0e10cSrcweir 	if (m_nRowPos != -1 && m_nRowPos != nRecords)
887cdf0e10cSrcweir 	{
888cdf0e10cSrcweir 		macabfield *uidField = m_aMacabRecords->getField(m_nRowPos,::rtl::OUString::createFromAscii("UID"));
889cdf0e10cSrcweir 		if(uidField != NULL)
890cdf0e10cSrcweir 		{
891cdf0e10cSrcweir 			if(uidField->type == kABStringProperty)
892cdf0e10cSrcweir 			{
893cdf0e10cSrcweir 				return makeAny(CFStringToOUString( (CFStringRef) uidField->value ));
894cdf0e10cSrcweir 			}
895cdf0e10cSrcweir 		}
896cdf0e10cSrcweir 	}
897cdf0e10cSrcweir 	return Any();
898cdf0e10cSrcweir }
899cdf0e10cSrcweir // -------------------------------------------------------------------------
moveToBookmark(const Any & bookmark)900cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::moveToBookmark(const  Any& bookmark) throw( SQLException,  RuntimeException)
901cdf0e10cSrcweir {
902cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
903cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
904cdf0e10cSrcweir 
905cdf0e10cSrcweir 	::rtl::OUString sBookmark = comphelper::getString(bookmark);
906cdf0e10cSrcweir         sal_Int32 nRecords = m_aMacabRecords->size();
907cdf0e10cSrcweir 
908cdf0e10cSrcweir 	for (sal_Int32 nRow = 0; nRow < nRecords; nRow++)
909cdf0e10cSrcweir 	{
910cdf0e10cSrcweir 		macabfield *uidField = m_aMacabRecords->getField(m_nRowPos,::rtl::OUString::createFromAscii("UID"));
911cdf0e10cSrcweir 		if(uidField != NULL)
912cdf0e10cSrcweir 		{
913cdf0e10cSrcweir 			if(uidField->type == kABStringProperty)
914cdf0e10cSrcweir 			{
915cdf0e10cSrcweir 				::rtl::OUString sUniqueIdentifier = CFStringToOUString( (CFStringRef) uidField->value );
916cdf0e10cSrcweir 				if (sUniqueIdentifier == sBookmark)
917cdf0e10cSrcweir 				{
918cdf0e10cSrcweir 					m_nRowPos = nRow;
919cdf0e10cSrcweir 					return sal_True;
920cdf0e10cSrcweir 				}
921cdf0e10cSrcweir 			}
922cdf0e10cSrcweir 		}
923cdf0e10cSrcweir 	}
924cdf0e10cSrcweir 	return sal_False;
925cdf0e10cSrcweir }
926cdf0e10cSrcweir // -------------------------------------------------------------------------
moveRelativeToBookmark(const Any & bookmark,sal_Int32 rows)927cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::moveRelativeToBookmark(const  Any& bookmark, sal_Int32 rows) throw( SQLException,  RuntimeException)
928cdf0e10cSrcweir {
929cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
930cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
931cdf0e10cSrcweir 
932cdf0e10cSrcweir 	sal_Int32 nRowSave = m_nRowPos;
933cdf0e10cSrcweir 
934cdf0e10cSrcweir 	if (moveToBookmark(bookmark))
935cdf0e10cSrcweir 	{
936cdf0e10cSrcweir 		sal_Int32 nRecords = m_aMacabRecords->size();
937cdf0e10cSrcweir 
938cdf0e10cSrcweir 		m_nRowPos += rows;
939cdf0e10cSrcweir 
940cdf0e10cSrcweir 		if (-1 < m_nRowPos && m_nRowPos < nRecords)
941cdf0e10cSrcweir 			return sal_True;
942cdf0e10cSrcweir 	}
943cdf0e10cSrcweir 
944cdf0e10cSrcweir 	m_nRowPos = nRowSave;
945cdf0e10cSrcweir 	return sal_False;
946cdf0e10cSrcweir }
947cdf0e10cSrcweir // -------------------------------------------------------------------------
compareBookmarks(const Any & firstItem,const Any & secondItem)948cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::compareBookmarks(const  Any& firstItem, const  Any& secondItem) throw( SQLException,  RuntimeException)
949cdf0e10cSrcweir {
950cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
951cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
952cdf0e10cSrcweir 
953cdf0e10cSrcweir 	::rtl::OUString sFirst = comphelper::getString(firstItem);
954cdf0e10cSrcweir 	::rtl::OUString sSecond = comphelper::getString(secondItem);
955cdf0e10cSrcweir 
956cdf0e10cSrcweir 	if (sFirst < sSecond)
957cdf0e10cSrcweir 		return CompareBookmark::LESS;
958cdf0e10cSrcweir 	if (sFirst > sSecond)
959cdf0e10cSrcweir 		return CompareBookmark::GREATER;
960cdf0e10cSrcweir 	return CompareBookmark::EQUAL;
961cdf0e10cSrcweir }
962cdf0e10cSrcweir // -------------------------------------------------------------------------
hasOrderedBookmarks()963cdf0e10cSrcweir sal_Bool SAL_CALL MacabResultSet::hasOrderedBookmarks() throw( SQLException,  RuntimeException)
964cdf0e10cSrcweir {
965cdf0e10cSrcweir 	return sal_False;
966cdf0e10cSrcweir }
967cdf0e10cSrcweir // -------------------------------------------------------------------------
hashBookmark(const Any & bookmark)968cdf0e10cSrcweir sal_Int32 SAL_CALL MacabResultSet::hashBookmark(const  Any& bookmark) throw( SQLException,  RuntimeException)
969cdf0e10cSrcweir {
970cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
971cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
972cdf0e10cSrcweir 
973cdf0e10cSrcweir 	::rtl::OUString sBookmark = comphelper::getString(bookmark);
974cdf0e10cSrcweir 
975cdf0e10cSrcweir 	return sBookmark.hashCode();
976cdf0e10cSrcweir }
977cdf0e10cSrcweir // -------------------------------------------------------------------------
978cdf0e10cSrcweir // XDeleteRows
deleteRows(const Sequence<Any> &)979cdf0e10cSrcweir Sequence< sal_Int32 > SAL_CALL MacabResultSet::deleteRows(const  Sequence<  Any >&) throw( SQLException,  RuntimeException)
980cdf0e10cSrcweir {
981cdf0e10cSrcweir 	::osl::MutexGuard aGuard( m_aMutex );
982cdf0e10cSrcweir 	checkDisposed(MacabResultSet_BASE::rBHelper.bDisposed);
983cdf0e10cSrcweir 
984cdf0e10cSrcweir 	return Sequence< sal_Int32 >();
985cdf0e10cSrcweir }
986cdf0e10cSrcweir // -------------------------------------------------------------------------
createArrayHelper() const987cdf0e10cSrcweir IPropertyArrayHelper* MacabResultSet::createArrayHelper() const
988cdf0e10cSrcweir {
989cdf0e10cSrcweir 	Sequence< Property > aProps(6);
990cdf0e10cSrcweir 	Property* pProperties = aProps.getArray();
991cdf0e10cSrcweir 	sal_Int32 nPos = 0;
992cdf0e10cSrcweir 	DECL_PROP1IMPL(CURSORNAME,			::rtl::OUString) PropertyAttribute::READONLY);
993cdf0e10cSrcweir 	DECL_PROP0(FETCHDIRECTION,			sal_Int32);
994cdf0e10cSrcweir 	DECL_PROP0(FETCHSIZE,				sal_Int32);
995cdf0e10cSrcweir 	DECL_BOOL_PROP1IMPL(ISBOOKMARKABLE) PropertyAttribute::READONLY);
996cdf0e10cSrcweir 	DECL_PROP1IMPL(RESULTSETCONCURRENCY,sal_Int32) PropertyAttribute::READONLY);
997cdf0e10cSrcweir 	DECL_PROP1IMPL(RESULTSETTYPE,		sal_Int32) PropertyAttribute::READONLY);
998cdf0e10cSrcweir 
999cdf0e10cSrcweir 	return new OPropertyArrayHelper(aProps);
1000cdf0e10cSrcweir }
1001cdf0e10cSrcweir // -------------------------------------------------------------------------
getInfoHelper()1002cdf0e10cSrcweir IPropertyArrayHelper & MacabResultSet::getInfoHelper()
1003cdf0e10cSrcweir {
1004cdf0e10cSrcweir 	return *static_cast<MacabResultSet*>(this)->getArrayHelper();
1005cdf0e10cSrcweir }
1006cdf0e10cSrcweir // -------------------------------------------------------------------------
convertFastPropertyValue(Any &,Any &,sal_Int32 nHandle,const Any &)1007cdf0e10cSrcweir sal_Bool MacabResultSet::convertFastPropertyValue(
1008cdf0e10cSrcweir 			Any &,
1009cdf0e10cSrcweir 			Any &,
1010cdf0e10cSrcweir 			sal_Int32 nHandle,
1011cdf0e10cSrcweir 			const Any& )
1012cdf0e10cSrcweir 				throw (::com::sun::star::lang::IllegalArgumentException)
1013cdf0e10cSrcweir {
1014cdf0e10cSrcweir 	switch (nHandle)
1015cdf0e10cSrcweir 	{
1016cdf0e10cSrcweir 		case PROPERTY_ID_ISBOOKMARKABLE:
1017cdf0e10cSrcweir 		case PROPERTY_ID_CURSORNAME:
1018cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETCONCURRENCY:
1019cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETTYPE:
1020cdf0e10cSrcweir 			throw ::com::sun::star::lang::IllegalArgumentException();
1021cdf0e10cSrcweir 			break;
1022cdf0e10cSrcweir 		case PROPERTY_ID_FETCHDIRECTION:
1023cdf0e10cSrcweir 		case PROPERTY_ID_FETCHSIZE:
1024cdf0e10cSrcweir 		default:
1025cdf0e10cSrcweir 			;
1026cdf0e10cSrcweir 	}
1027cdf0e10cSrcweir 	return sal_False;
1028cdf0e10cSrcweir }
1029cdf0e10cSrcweir // -------------------------------------------------------------------------
setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any &)1030cdf0e10cSrcweir void MacabResultSet::setFastPropertyValue_NoBroadcast(
1031cdf0e10cSrcweir 			sal_Int32 nHandle,
1032cdf0e10cSrcweir 			const Any& )
1033cdf0e10cSrcweir 				 throw (Exception)
1034cdf0e10cSrcweir {
1035cdf0e10cSrcweir 	switch (nHandle)
1036cdf0e10cSrcweir 	{
1037cdf0e10cSrcweir 		case PROPERTY_ID_ISBOOKMARKABLE:
1038cdf0e10cSrcweir 		case PROPERTY_ID_CURSORNAME:
1039cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETCONCURRENCY:
1040cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETTYPE:
1041cdf0e10cSrcweir 			throw Exception();
1042cdf0e10cSrcweir 			break;
1043cdf0e10cSrcweir 		case PROPERTY_ID_FETCHDIRECTION:
1044cdf0e10cSrcweir 			break;
1045cdf0e10cSrcweir 		case PROPERTY_ID_FETCHSIZE:
1046cdf0e10cSrcweir 			break;
1047cdf0e10cSrcweir 		default:
1048cdf0e10cSrcweir 			;
1049cdf0e10cSrcweir 	}
1050cdf0e10cSrcweir }
1051cdf0e10cSrcweir // -------------------------------------------------------------------------
getFastPropertyValue(Any & _rValue,sal_Int32 nHandle) const1052cdf0e10cSrcweir void MacabResultSet::getFastPropertyValue(
1053cdf0e10cSrcweir 			Any& _rValue,
1054cdf0e10cSrcweir 			sal_Int32 nHandle) const
1055cdf0e10cSrcweir {
1056cdf0e10cSrcweir 	switch (nHandle)
1057cdf0e10cSrcweir 	{
1058cdf0e10cSrcweir 		case PROPERTY_ID_ISBOOKMARKABLE:
1059cdf0e10cSrcweir             _rValue <<= (sal_Bool)sal_False;
1060cdf0e10cSrcweir             break;
1061cdf0e10cSrcweir 		case PROPERTY_ID_CURSORNAME:
1062cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETCONCURRENCY:
1063cdf0e10cSrcweir 		case PROPERTY_ID_RESULTSETTYPE:
1064cdf0e10cSrcweir 		case PROPERTY_ID_FETCHDIRECTION:
1065cdf0e10cSrcweir 		case PROPERTY_ID_FETCHSIZE:
1066cdf0e10cSrcweir 			;
1067cdf0e10cSrcweir 	}
1068cdf0e10cSrcweir }
1069cdf0e10cSrcweir // -----------------------------------------------------------------------------
1070