xref: /AOO41X/main/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx (revision 96de54900b79e13b861fbc62cbf36018b54e21b7)
1*96de5490SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*96de5490SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*96de5490SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*96de5490SAndrew Rist  * distributed with this work for additional information
6*96de5490SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*96de5490SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*96de5490SAndrew Rist  * "License"); you may not use this file except in compliance
9*96de5490SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*96de5490SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*96de5490SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*96de5490SAndrew Rist  * software distributed under the License is distributed on an
15*96de5490SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*96de5490SAndrew Rist  * KIND, either express or implied.  See the License for the
17*96de5490SAndrew Rist  * specific language governing permissions and limitations
18*96de5490SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*96de5490SAndrew Rist  *************************************************************/
21*96de5490SAndrew Rist 
22*96de5490SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_dbaccess.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir /**************************************************************************
28cdf0e10cSrcweir 								TODO
29cdf0e10cSrcweir  **************************************************************************
30cdf0e10cSrcweir 
31cdf0e10cSrcweir  *************************************************************************/
32cdf0e10cSrcweir 
33cdf0e10cSrcweir #include <vector>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #ifndef _UCBHELPER_CONTENTIDENTIFIER_HXX
36cdf0e10cSrcweir #include <ucbhelper/contentidentifier.hxx>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _UCBHELPER_PROVIDERHELPER_HXX
39cdf0e10cSrcweir #include <ucbhelper/providerhelper.hxx>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #ifndef DBA_DATASUPPLIER_HXX
43cdf0e10cSrcweir #include "myucp_datasupplier.hxx"
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #ifndef DBA_CONTENTHELPER_HXX
46cdf0e10cSrcweir #include "ContentHelper.hxx"
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMEACCESS_HPP_
49cdf0e10cSrcweir #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
50cdf0e10cSrcweir #endif
51cdf0e10cSrcweir #ifndef _TOOLS_DEBUG_HXX
52cdf0e10cSrcweir #include <tools/debug.hxx>
53cdf0e10cSrcweir #endif
54cdf0e10cSrcweir 
55cdf0e10cSrcweir using namespace ::com::sun::star::uno;
56cdf0e10cSrcweir using namespace ::com::sun::star::ucb;
57cdf0e10cSrcweir using namespace ::com::sun::star::beans;
58cdf0e10cSrcweir using namespace ::com::sun::star::lang;
59cdf0e10cSrcweir using namespace ::com::sun::star::sdbc;
60cdf0e10cSrcweir using namespace ::com::sun::star::io;
61cdf0e10cSrcweir using namespace ::com::sun::star::container;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir // @@@ Adjust namespace name.
64cdf0e10cSrcweir using namespace dbaccess;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir // @@@ Adjust namespace name.
67cdf0e10cSrcweir namespace dbaccess
68cdf0e10cSrcweir {
69cdf0e10cSrcweir 
70cdf0e10cSrcweir //=========================================================================
71cdf0e10cSrcweir //
72cdf0e10cSrcweir // struct ResultListEntry.
73cdf0e10cSrcweir //
74cdf0e10cSrcweir //=========================================================================
75cdf0e10cSrcweir 
76cdf0e10cSrcweir struct ResultListEntry
77cdf0e10cSrcweir {
78cdf0e10cSrcweir 	rtl::OUString						aId;
79cdf0e10cSrcweir 	Reference< XContentIdentifier >		xId;
80cdf0e10cSrcweir 	::rtl::Reference< OContentHelper > 	xContent;
81cdf0e10cSrcweir 	Reference< XRow > 					xRow;
82cdf0e10cSrcweir 	const ContentProperties& 			rData;
83cdf0e10cSrcweir 
ResultListEntrydbaccess::ResultListEntry84cdf0e10cSrcweir 	ResultListEntry( const ContentProperties& rEntry ) : rData( rEntry ) {}
85cdf0e10cSrcweir };
86cdf0e10cSrcweir 
87cdf0e10cSrcweir //=========================================================================
88cdf0e10cSrcweir //
89cdf0e10cSrcweir // ResultList.
90cdf0e10cSrcweir //
91cdf0e10cSrcweir //=========================================================================
92cdf0e10cSrcweir 
93cdf0e10cSrcweir typedef std::vector< ResultListEntry* > ResultList;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir //=========================================================================
96cdf0e10cSrcweir //
97cdf0e10cSrcweir // struct DataSupplier_Impl.
98cdf0e10cSrcweir //
99cdf0e10cSrcweir //=========================================================================
100cdf0e10cSrcweir 
101cdf0e10cSrcweir struct DataSupplier_Impl
102cdf0e10cSrcweir {
103cdf0e10cSrcweir 	osl::Mutex					                 m_aMutex;
104cdf0e10cSrcweir 	ResultList					                 m_aResults;
105cdf0e10cSrcweir 	rtl::Reference< ODocumentContainer >     	     m_xContent;
106cdf0e10cSrcweir 	Reference< XMultiServiceFactory >			 m_xSMgr;
107cdf0e10cSrcweir   	sal_Int32					                 m_nOpenMode;
108cdf0e10cSrcweir   	sal_Bool					                 m_bCountFinal;
109cdf0e10cSrcweir 
DataSupplier_Impldbaccess::DataSupplier_Impl110cdf0e10cSrcweir 	DataSupplier_Impl( const Reference< XMultiServiceFactory >& rxSMgr,
111cdf0e10cSrcweir 						const rtl::Reference< ODocumentContainer >& rContent,
112cdf0e10cSrcweir 					   sal_Int32 nOpenMode )
113cdf0e10cSrcweir 	: m_xContent(rContent)
114cdf0e10cSrcweir 	, m_xSMgr( rxSMgr )
115cdf0e10cSrcweir 	, m_nOpenMode( nOpenMode )
116cdf0e10cSrcweir 	, m_bCountFinal( sal_False ) {}
117cdf0e10cSrcweir 	~DataSupplier_Impl();
118cdf0e10cSrcweir };
119cdf0e10cSrcweir 
120cdf0e10cSrcweir //=========================================================================
~DataSupplier_Impl()121cdf0e10cSrcweir DataSupplier_Impl::~DataSupplier_Impl()
122cdf0e10cSrcweir {
123cdf0e10cSrcweir 	ResultList::const_iterator it  = m_aResults.begin();
124cdf0e10cSrcweir 	ResultList::const_iterator end = m_aResults.end();
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 	while ( it != end )
127cdf0e10cSrcweir 	{
128cdf0e10cSrcweir 		delete (*it);
129cdf0e10cSrcweir 		it++;
130cdf0e10cSrcweir 	}
131cdf0e10cSrcweir }
132cdf0e10cSrcweir 
133cdf0e10cSrcweir }
134cdf0e10cSrcweir 
135cdf0e10cSrcweir //=========================================================================
136cdf0e10cSrcweir //=========================================================================
137cdf0e10cSrcweir //
138cdf0e10cSrcweir // DataSupplier Implementation.
139cdf0e10cSrcweir //
140cdf0e10cSrcweir //=========================================================================
141cdf0e10cSrcweir //=========================================================================
DBG_NAME(DataSupplier)142cdf0e10cSrcweir DBG_NAME(DataSupplier)
143cdf0e10cSrcweir 
144cdf0e10cSrcweir DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& rxSMgr,
145cdf0e10cSrcweir 						   const rtl::Reference< ODocumentContainer >& rContent,
146cdf0e10cSrcweir 							sal_Int32 nOpenMode )
147cdf0e10cSrcweir : m_pImpl( new DataSupplier_Impl( rxSMgr, rContent,nOpenMode ) )
148cdf0e10cSrcweir {
149cdf0e10cSrcweir     DBG_CTOR(DataSupplier,NULL);
150cdf0e10cSrcweir 
151cdf0e10cSrcweir }
152cdf0e10cSrcweir 
153cdf0e10cSrcweir //=========================================================================
154cdf0e10cSrcweir // virtual
~DataSupplier()155cdf0e10cSrcweir DataSupplier::~DataSupplier()
156cdf0e10cSrcweir {
157cdf0e10cSrcweir 
158cdf0e10cSrcweir     DBG_DTOR(DataSupplier,NULL);
159cdf0e10cSrcweir }
160cdf0e10cSrcweir 
161cdf0e10cSrcweir //=========================================================================
162cdf0e10cSrcweir // virtual
queryContentIdentifierString(sal_uInt32 nIndex)163cdf0e10cSrcweir rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex )
164cdf0e10cSrcweir {
165cdf0e10cSrcweir 	osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
166cdf0e10cSrcweir 
167cdf0e10cSrcweir 	if ( (size_t)nIndex < m_pImpl->m_aResults.size() )
168cdf0e10cSrcweir 	{
169cdf0e10cSrcweir 		rtl::OUString aId = m_pImpl->m_aResults[ nIndex ]->aId;
170cdf0e10cSrcweir 		if ( aId.getLength() )
171cdf0e10cSrcweir 		{
172cdf0e10cSrcweir 			// Already cached.
173cdf0e10cSrcweir 			return aId;
174cdf0e10cSrcweir 		}
175cdf0e10cSrcweir 	}
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	if ( getResult( nIndex ) )
178cdf0e10cSrcweir 	{
179cdf0e10cSrcweir 		rtl::OUString aId
180cdf0e10cSrcweir 			= m_pImpl->m_xContent->getIdentifier()->getContentIdentifier();
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 		if ( aId.getLength() )
183cdf0e10cSrcweir 			aId += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 		aId += m_pImpl->m_aResults[ nIndex ]->rData.aTitle;
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 		m_pImpl->m_aResults[ nIndex ]->aId = aId;
188cdf0e10cSrcweir 		return aId;
189cdf0e10cSrcweir 	}
190cdf0e10cSrcweir 	return rtl::OUString();
191cdf0e10cSrcweir }
192cdf0e10cSrcweir 
193cdf0e10cSrcweir //=========================================================================
194cdf0e10cSrcweir // virtual
195cdf0e10cSrcweir Reference< XContentIdentifier >
queryContentIdentifier(sal_uInt32 nIndex)196cdf0e10cSrcweir DataSupplier::queryContentIdentifier( sal_uInt32 nIndex )
197cdf0e10cSrcweir {
198cdf0e10cSrcweir 	osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
199cdf0e10cSrcweir 
200cdf0e10cSrcweir 	if ( (size_t)nIndex < m_pImpl->m_aResults.size() )
201cdf0e10cSrcweir 	{
202cdf0e10cSrcweir 		Reference< XContentIdentifier > xId = m_pImpl->m_aResults[ nIndex ]->xId;
203cdf0e10cSrcweir 		if ( xId.is() )
204cdf0e10cSrcweir 		{
205cdf0e10cSrcweir 			// Already cached.
206cdf0e10cSrcweir 			return xId;
207cdf0e10cSrcweir 		}
208cdf0e10cSrcweir 	}
209cdf0e10cSrcweir 
210cdf0e10cSrcweir 	rtl::OUString aId = queryContentIdentifierString( nIndex );
211cdf0e10cSrcweir 	if ( aId.getLength() )
212cdf0e10cSrcweir 	{
213cdf0e10cSrcweir 		Reference< XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aId );
214cdf0e10cSrcweir 		m_pImpl->m_aResults[ nIndex ]->xId = xId;
215cdf0e10cSrcweir 		return xId;
216cdf0e10cSrcweir 	}
217cdf0e10cSrcweir 	return Reference< XContentIdentifier >();
218cdf0e10cSrcweir }
219cdf0e10cSrcweir 
220cdf0e10cSrcweir //=========================================================================
221cdf0e10cSrcweir // virtual
222cdf0e10cSrcweir Reference< XContent >
queryContent(sal_uInt32 _nIndex)223cdf0e10cSrcweir DataSupplier::queryContent( sal_uInt32 _nIndex )
224cdf0e10cSrcweir {
225cdf0e10cSrcweir 	osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
226cdf0e10cSrcweir 
227cdf0e10cSrcweir 	if ( (size_t)_nIndex < m_pImpl->m_aResults.size() )
228cdf0e10cSrcweir 	{
229cdf0e10cSrcweir 		Reference< XContent > xContent = m_pImpl->m_aResults[ _nIndex ]->xContent.get();
230cdf0e10cSrcweir 		if ( xContent.is() )
231cdf0e10cSrcweir 		{
232cdf0e10cSrcweir 			// Already cached.
233cdf0e10cSrcweir 			return xContent;
234cdf0e10cSrcweir 		}
235cdf0e10cSrcweir 	}
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 	Reference< XContentIdentifier > xId = queryContentIdentifier( _nIndex );
238cdf0e10cSrcweir 	if ( xId.is() )
239cdf0e10cSrcweir 	{
240cdf0e10cSrcweir 		try
241cdf0e10cSrcweir 		{
242cdf0e10cSrcweir 			Reference< XContent > xContent;
243cdf0e10cSrcweir 			::rtl::OUString sName = xId->getContentIdentifier();
244cdf0e10cSrcweir 			sal_Int32 nIndex = sName.lastIndexOf('/') + 1;
245cdf0e10cSrcweir 			sName = sName.getToken(0,'/',nIndex);
246cdf0e10cSrcweir 
247cdf0e10cSrcweir 			m_pImpl->m_aResults[ _nIndex ]->xContent = m_pImpl->m_xContent->getContent(sName);
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 			xContent = m_pImpl->m_aResults[ _nIndex ]->xContent.get();
250cdf0e10cSrcweir 			return xContent;
251cdf0e10cSrcweir 
252cdf0e10cSrcweir 		}
253cdf0e10cSrcweir 		catch ( IllegalIdentifierException& )
254cdf0e10cSrcweir 		{
255cdf0e10cSrcweir 		}
256cdf0e10cSrcweir 	}
257cdf0e10cSrcweir 	return Reference< XContent >();
258cdf0e10cSrcweir }
259cdf0e10cSrcweir 
260cdf0e10cSrcweir //=========================================================================
261cdf0e10cSrcweir // virtual
getResult(sal_uInt32 nIndex)262cdf0e10cSrcweir sal_Bool DataSupplier::getResult( sal_uInt32 nIndex )
263cdf0e10cSrcweir {
264cdf0e10cSrcweir 	osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
265cdf0e10cSrcweir 
266cdf0e10cSrcweir 	if ( (size_t)nIndex < m_pImpl->m_aResults.size() )
267cdf0e10cSrcweir 	{
268cdf0e10cSrcweir 		// Result already present.
269cdf0e10cSrcweir 		return sal_True;
270cdf0e10cSrcweir 	}
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	// Result not (yet) present.
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 	if ( m_pImpl->m_bCountFinal )
275cdf0e10cSrcweir 		return sal_False;
276cdf0e10cSrcweir 
277cdf0e10cSrcweir 	// Try to obtain result...
278cdf0e10cSrcweir 
279cdf0e10cSrcweir 	sal_uInt32 nOldCount = m_pImpl->m_aResults.size();
280cdf0e10cSrcweir 	sal_Bool bFound = sal_False;
281cdf0e10cSrcweir 	sal_uInt32 nPos = nOldCount;
282cdf0e10cSrcweir 
283cdf0e10cSrcweir 	// @@@ Obtain data and put it into result list...
284cdf0e10cSrcweir 	Sequence< ::rtl::OUString> aSeq = m_pImpl->m_xContent->getElementNames();
285cdf0e10cSrcweir 	if ( nIndex < sal::static_int_cast< sal_uInt32 >( aSeq.getLength() ) )
286cdf0e10cSrcweir 	{
287cdf0e10cSrcweir 		const ::rtl::OUString* pIter = aSeq.getConstArray();
288cdf0e10cSrcweir 		const ::rtl::OUString* pEnd	  = pIter + aSeq.getLength();
289cdf0e10cSrcweir 		for(pIter = pIter + nPos;pIter != pEnd;++pIter,++nPos)
290cdf0e10cSrcweir 		{
291cdf0e10cSrcweir 			m_pImpl->m_aResults.push_back(
292cdf0e10cSrcweir 							new ResultListEntry( m_pImpl->m_xContent->getContent(*pIter)->getContentProperties() ) );
293cdf0e10cSrcweir 
294cdf0e10cSrcweir 			if ( nPos == nIndex )
295cdf0e10cSrcweir 			{
296cdf0e10cSrcweir 				// Result obtained.
297cdf0e10cSrcweir 				bFound = sal_True;
298cdf0e10cSrcweir 				break;
299cdf0e10cSrcweir 			}
300cdf0e10cSrcweir 		}
301cdf0e10cSrcweir 	}
302cdf0e10cSrcweir 
303cdf0e10cSrcweir 	if ( !bFound )
304cdf0e10cSrcweir 		m_pImpl->m_bCountFinal = sal_True;
305cdf0e10cSrcweir 
306cdf0e10cSrcweir 	rtl::Reference< ::ucbhelper::ResultSet > xResultSet = getResultSet().get();
307cdf0e10cSrcweir 	if ( xResultSet.is() )
308cdf0e10cSrcweir 	{
309cdf0e10cSrcweir 		// Callbacks follow!
310cdf0e10cSrcweir 		aGuard.clear();
311cdf0e10cSrcweir 
312cdf0e10cSrcweir 		if ( (size_t)nOldCount < m_pImpl->m_aResults.size() )
313cdf0e10cSrcweir 			xResultSet->rowCountChanged(
314cdf0e10cSrcweir 									nOldCount, m_pImpl->m_aResults.size() );
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 		if ( m_pImpl->m_bCountFinal )
317cdf0e10cSrcweir 			xResultSet->rowCountFinal();
318cdf0e10cSrcweir 	}
319cdf0e10cSrcweir 
320cdf0e10cSrcweir 	return bFound;
321cdf0e10cSrcweir }
322cdf0e10cSrcweir 
323cdf0e10cSrcweir //=========================================================================
324cdf0e10cSrcweir // virtual
totalCount()325cdf0e10cSrcweir sal_uInt32 DataSupplier::totalCount()
326cdf0e10cSrcweir {
327cdf0e10cSrcweir 	osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 	if ( m_pImpl->m_bCountFinal )
330cdf0e10cSrcweir 		return m_pImpl->m_aResults.size();
331cdf0e10cSrcweir 
332cdf0e10cSrcweir 	sal_uInt32 nOldCount = m_pImpl->m_aResults.size();
333cdf0e10cSrcweir 
334cdf0e10cSrcweir 	// @@@ Obtain data and put it into result list...
335cdf0e10cSrcweir 	Sequence< ::rtl::OUString> aSeq = m_pImpl->m_xContent->getElementNames();
336cdf0e10cSrcweir 	const ::rtl::OUString* pIter = aSeq.getConstArray();
337cdf0e10cSrcweir 	const ::rtl::OUString* pEnd	  = pIter + aSeq.getLength();
338cdf0e10cSrcweir 	for(;pIter != pEnd;++pIter)
339cdf0e10cSrcweir 		m_pImpl->m_aResults.push_back(
340cdf0e10cSrcweir 						new ResultListEntry( m_pImpl->m_xContent->getContent(*pIter)->getContentProperties() ) );
341cdf0e10cSrcweir 
342cdf0e10cSrcweir 	m_pImpl->m_bCountFinal = sal_True;
343cdf0e10cSrcweir 
344cdf0e10cSrcweir 	rtl::Reference< ::ucbhelper::ResultSet > xResultSet = getResultSet().get();
345cdf0e10cSrcweir 	if ( xResultSet.is() )
346cdf0e10cSrcweir 	{
347cdf0e10cSrcweir 		// Callbacks follow!
348cdf0e10cSrcweir 		aGuard.clear();
349cdf0e10cSrcweir 
350cdf0e10cSrcweir 		if ( (size_t)nOldCount < m_pImpl->m_aResults.size() )
351cdf0e10cSrcweir 			xResultSet->rowCountChanged(
352cdf0e10cSrcweir 									nOldCount, m_pImpl->m_aResults.size() );
353cdf0e10cSrcweir 
354cdf0e10cSrcweir 		xResultSet->rowCountFinal();
355cdf0e10cSrcweir 	}
356cdf0e10cSrcweir 
357cdf0e10cSrcweir 	return m_pImpl->m_aResults.size();
358cdf0e10cSrcweir }
359cdf0e10cSrcweir 
360cdf0e10cSrcweir //=========================================================================
361cdf0e10cSrcweir // virtual
currentCount()362cdf0e10cSrcweir sal_uInt32 DataSupplier::currentCount()
363cdf0e10cSrcweir {
364cdf0e10cSrcweir 	return m_pImpl->m_aResults.size();
365cdf0e10cSrcweir }
366cdf0e10cSrcweir 
367cdf0e10cSrcweir //=========================================================================
368cdf0e10cSrcweir // virtual
isCountFinal()369cdf0e10cSrcweir sal_Bool DataSupplier::isCountFinal()
370cdf0e10cSrcweir {
371cdf0e10cSrcweir 	return m_pImpl->m_bCountFinal;
372cdf0e10cSrcweir }
373cdf0e10cSrcweir 
374cdf0e10cSrcweir //=========================================================================
375cdf0e10cSrcweir // virtual
376cdf0e10cSrcweir Reference< XRow >
queryPropertyValues(sal_uInt32 nIndex)377cdf0e10cSrcweir DataSupplier::queryPropertyValues( sal_uInt32 nIndex  )
378cdf0e10cSrcweir {
379cdf0e10cSrcweir 	osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
380cdf0e10cSrcweir 
381cdf0e10cSrcweir 	if ( (size_t)nIndex < m_pImpl->m_aResults.size() )
382cdf0e10cSrcweir 	{
383cdf0e10cSrcweir 		Reference< XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xRow;
384cdf0e10cSrcweir 		if ( xRow.is() )
385cdf0e10cSrcweir 		{
386cdf0e10cSrcweir 			// Already cached.
387cdf0e10cSrcweir 			return xRow;
388cdf0e10cSrcweir 		}
389cdf0e10cSrcweir 	}
390cdf0e10cSrcweir 
391cdf0e10cSrcweir 	if ( getResult( nIndex ) )
392cdf0e10cSrcweir 	{
393cdf0e10cSrcweir 		if ( !m_pImpl->m_aResults[ nIndex ]->xContent.is() )
394cdf0e10cSrcweir 			queryContent(nIndex);
395cdf0e10cSrcweir 
396cdf0e10cSrcweir 		Reference< XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xContent->getPropertyValues(getResultSet()->getProperties());
397cdf0e10cSrcweir 		m_pImpl->m_aResults[ nIndex ]->xRow = xRow;
398cdf0e10cSrcweir 		return xRow;
399cdf0e10cSrcweir 	}
400cdf0e10cSrcweir 
401cdf0e10cSrcweir 	return Reference< XRow >();
402cdf0e10cSrcweir }
403cdf0e10cSrcweir 
404cdf0e10cSrcweir //=========================================================================
405cdf0e10cSrcweir // virtual
releasePropertyValues(sal_uInt32 nIndex)406cdf0e10cSrcweir void DataSupplier::releasePropertyValues( sal_uInt32 nIndex )
407cdf0e10cSrcweir {
408cdf0e10cSrcweir 	osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
409cdf0e10cSrcweir 
410cdf0e10cSrcweir 	if ( (size_t)nIndex < m_pImpl->m_aResults.size() )
411cdf0e10cSrcweir 		m_pImpl->m_aResults[ nIndex ]->xRow = Reference< XRow >();
412cdf0e10cSrcweir }
413cdf0e10cSrcweir 
414cdf0e10cSrcweir //=========================================================================
415cdf0e10cSrcweir // virtual
close()416cdf0e10cSrcweir void DataSupplier::close()
417cdf0e10cSrcweir {
418cdf0e10cSrcweir }
419cdf0e10cSrcweir 
420cdf0e10cSrcweir //=========================================================================
421cdf0e10cSrcweir // virtual
validate()422cdf0e10cSrcweir void DataSupplier::validate()
423cdf0e10cSrcweir 	throw( ResultSetException )
424cdf0e10cSrcweir {
425cdf0e10cSrcweir }
426cdf0e10cSrcweir 
427