1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 /**************************************************************************
23 **************************************************************************
25 *************************************************************************/
26 #include <cppuhelper/interfacecontainer.hxx>
27 #include <com/sun/star/beans/PropertyAttribute.hpp>
28 #include <ucbhelper/getcomponentcontext.hxx>
29 #include <ucbhelper/resultset.hxx>
30 #include <ucbhelper/resultsetmetadata.hxx>
32 using namespace com::sun::star
;
36 namespace ucbhelper_impl
43 sal_Int16 nAttributes
;
44 const uno::Type
& (*pGetCppuType
)();
47 static const uno::Type
& sal_Int32_getCppuType()
49 return cppu::UnoType
<sal_Int32
>::get();
52 static const uno::Type
& sal_Bool_getCppuType()
54 return cppu::UnoType
<bool>::get();
57 static const PropertyInfo aPropertyTable
[] =
61 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
,
66 beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
,
67 &sal_Int32_getCppuType
76 #define RESULTSET_PROPERTY_COUNT 2
80 // class PropertySetInfo
84 class PropertySetInfo
:
85 public cppu::OWeakObject
,
86 public lang::XTypeProvider
,
87 public beans::XPropertySetInfo
89 uno::Sequence
< beans::Property
>* m_pProps
;
93 const OUString
& aName
, beans::Property
& rProp
);
97 const PropertyInfo
* pProps
,
99 virtual ~PropertySetInfo();
102 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
)
103 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
104 virtual void SAL_CALL
acquire()
105 throw() SAL_OVERRIDE
;
106 virtual void SAL_CALL
release()
107 throw() SAL_OVERRIDE
;
110 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId()
111 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes()
113 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 virtual uno::Sequence
< beans::Property
> SAL_CALL
getProperties()
117 throw( uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 virtual beans::Property SAL_CALL
getPropertyByName(
119 const OUString
& aName
)
120 throw( beans::UnknownPropertyException
, uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
121 virtual sal_Bool SAL_CALL
hasPropertyByName( const OUString
& Name
)
122 throw( uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
125 typedef cppu::OMultiTypeInterfaceContainerHelperVar
<OUString
>
126 PropertyChangeListenerContainer
;
128 class PropertyChangeListeners
: public PropertyChangeListenerContainer
131 PropertyChangeListeners( osl::Mutex
& rMtx
)
132 : PropertyChangeListenerContainer( rMtx
) {}
135 } // namespace ucbhelper_impl
137 using namespace ucbhelper_impl
;
144 // struct ResultSet_Impl.
148 struct ResultSet_Impl
150 uno::Reference
< uno::XComponentContext
> m_xContext
;
151 uno::Reference
< com::sun::star::ucb::XCommandEnvironment
> m_xEnv
;
152 uno::Reference
< beans::XPropertySetInfo
> m_xPropSetInfo
;
153 uno::Reference
< sdbc::XResultSetMetaData
> m_xMetaData
;
154 uno::Sequence
< beans::Property
> m_aProperties
;
155 rtl::Reference
< ResultSetDataSupplier
> m_xDataSupplier
;
157 cppu::OInterfaceContainerHelper
* m_pDisposeEventListeners
;
158 PropertyChangeListeners
* m_pPropertyChangeListeners
;
163 inline ResultSet_Impl(
164 const uno::Reference
< uno::XComponentContext
>& rxContext
,
165 const uno::Sequence
< beans::Property
>& rProperties
,
166 const rtl::Reference
< ResultSetDataSupplier
>& rDataSupplier
,
167 const uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>&
169 inline ~ResultSet_Impl();
172 inline ResultSet_Impl::ResultSet_Impl(
173 const uno::Reference
< uno::XComponentContext
>& rxContext
,
174 const uno::Sequence
< beans::Property
>& rProperties
,
175 const rtl::Reference
< ResultSetDataSupplier
>& rDataSupplier
,
176 const uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& rxEnv
)
177 : m_xContext( rxContext
),
179 m_aProperties( rProperties
),
180 m_xDataSupplier( rDataSupplier
),
181 m_pDisposeEventListeners( 0 ),
182 m_pPropertyChangeListeners( 0 ),
183 m_nPos( 0 ), // Position is one-based. Zero means: before first element.
185 m_bAfterLast( false )
190 inline ResultSet_Impl::~ResultSet_Impl()
192 delete m_pDisposeEventListeners
;
193 delete m_pPropertyChangeListeners
;
199 // ResultSet Implementation.
204 ResultSet::ResultSet(
205 const uno::Reference
< uno::XComponentContext
>& rxContext
,
206 const uno::Sequence
< beans::Property
>& rProperties
,
207 const rtl::Reference
< ResultSetDataSupplier
>& rDataSupplier
)
208 : m_pImpl( new ResultSet_Impl(
212 uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>() ) )
214 rDataSupplier
->m_pResultSet
= this;
218 ResultSet::ResultSet(
219 const uno::Reference
< uno::XComponentContext
>& rxContext
,
220 const uno::Sequence
< beans::Property
>& rProperties
,
221 const rtl::Reference
< ResultSetDataSupplier
>& rDataSupplier
,
222 const uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>& rxEnv
)
223 : m_pImpl( new ResultSet_Impl( rxContext
, rProperties
, rDataSupplier
, rxEnv
) )
225 rDataSupplier
->m_pResultSet
= this;
230 ResultSet::~ResultSet()
237 // XInterface methods.
239 void SAL_CALL
ResultSet::acquire()
242 OWeakObject::acquire();
245 void SAL_CALL
ResultSet::release()
248 OWeakObject::release();
251 css::uno::Any SAL_CALL
ResultSet::queryInterface( const css::uno::Type
& rType
)
252 throw( css::uno::RuntimeException
, std::exception
)
254 css::uno::Any aRet
= cppu::queryInterface( rType
,
255 (static_cast< lang::XTypeProvider
* >(this)),
256 (static_cast< lang::XServiceInfo
* >(this)),
257 (static_cast< lang::XComponent
* >(this)),
258 (static_cast< css::ucb::XContentAccess
* >(this)),
259 (static_cast< sdbc::XResultSet
* >(this)),
260 (static_cast< sdbc::XResultSetMetaDataSupplier
* >(this)),
261 (static_cast< sdbc::XRow
* >(this)),
262 (static_cast< sdbc::XCloseable
* >(this)),
263 (static_cast< beans::XPropertySet
* >(this))
265 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
268 // XTypeProvider methods.
272 XTYPEPROVIDER_IMPL_9( ResultSet
,
276 com::sun::star::ucb::XContentAccess
,
278 sdbc::XResultSetMetaDataSupplier
,
281 beans::XPropertySet
);
285 // XServiceInfo methods.
289 XSERVICEINFO_NOFACTORY_IMPL_1( ResultSet
,
290 OUString("ResultSet"),
291 RESULTSET_SERVICE_NAME
);
295 // XComponent methods.
300 void SAL_CALL
ResultSet::dispose()
301 throw( uno::RuntimeException
, std::exception
)
303 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
305 if ( m_pImpl
->m_pDisposeEventListeners
&&
306 m_pImpl
->m_pDisposeEventListeners
->getLength() )
308 lang::EventObject aEvt
;
309 aEvt
.Source
= static_cast< lang::XComponent
* >( this );
310 m_pImpl
->m_pDisposeEventListeners
->disposeAndClear( aEvt
);
313 if ( m_pImpl
->m_pPropertyChangeListeners
)
315 lang::EventObject aEvt
;
316 aEvt
.Source
= static_cast< beans::XPropertySet
* >( this );
317 m_pImpl
->m_pPropertyChangeListeners
->disposeAndClear( aEvt
);
320 m_pImpl
->m_xDataSupplier
->close();
325 void SAL_CALL
ResultSet::addEventListener(
326 const uno::Reference
< lang::XEventListener
>& Listener
)
327 throw( uno::RuntimeException
, std::exception
)
329 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
331 if ( !m_pImpl
->m_pDisposeEventListeners
)
332 m_pImpl
->m_pDisposeEventListeners
=
333 new cppu::OInterfaceContainerHelper( m_pImpl
->m_aMutex
);
335 m_pImpl
->m_pDisposeEventListeners
->addInterface( Listener
);
340 void SAL_CALL
ResultSet::removeEventListener(
341 const uno::Reference
< lang::XEventListener
>& Listener
)
342 throw( uno::RuntimeException
, std::exception
)
344 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
346 if ( m_pImpl
->m_pDisposeEventListeners
)
347 m_pImpl
->m_pDisposeEventListeners
->removeInterface( Listener
);
352 // XResultSetMetaDataSupplier methods.
357 uno::Reference
< sdbc::XResultSetMetaData
> SAL_CALL
ResultSet::getMetaData()
358 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
360 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
362 if ( !m_pImpl
->m_xMetaData
.is() )
363 m_pImpl
->m_xMetaData
= new ResultSetMetaData( m_pImpl
->m_xContext
,
364 m_pImpl
->m_aProperties
);
366 return m_pImpl
->m_xMetaData
;
371 // XResultSet methods.
376 sal_Bool SAL_CALL
ResultSet::next()
377 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
379 // Note: Cursor is initially positioned before the first row.
380 // First call to 'next()' moves it to first row.
382 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
384 if ( m_pImpl
->m_bAfterLast
)
386 m_pImpl
->m_xDataSupplier
->validate();
390 // getResult works zero-based!
391 if ( !m_pImpl
->m_xDataSupplier
->getResult( m_pImpl
->m_nPos
) )
393 m_pImpl
->m_bAfterLast
= true;
394 m_pImpl
->m_xDataSupplier
->validate();
399 m_pImpl
->m_xDataSupplier
->validate();
405 sal_Bool SAL_CALL
ResultSet::isBeforeFirst()
406 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
408 if ( m_pImpl
->m_bAfterLast
)
410 m_pImpl
->m_xDataSupplier
->validate();
414 // getResult works zero-based!
415 if ( !m_pImpl
->m_xDataSupplier
->getResult( 0 ) )
417 m_pImpl
->m_xDataSupplier
->validate();
421 m_pImpl
->m_xDataSupplier
->validate();
422 return ( m_pImpl
->m_nPos
== 0 );
427 sal_Bool SAL_CALL
ResultSet::isAfterLast()
428 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
430 m_pImpl
->m_xDataSupplier
->validate();
431 return m_pImpl
->m_bAfterLast
;
436 sal_Bool SAL_CALL
ResultSet::isFirst()
437 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
439 if ( m_pImpl
->m_bAfterLast
)
441 m_pImpl
->m_xDataSupplier
->validate();
445 m_pImpl
->m_xDataSupplier
->validate();
446 return ( m_pImpl
->m_nPos
== 1 );
451 sal_Bool SAL_CALL
ResultSet::isLast()
452 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
454 if ( m_pImpl
->m_bAfterLast
)
456 m_pImpl
->m_xDataSupplier
->validate();
460 sal_Int32 nCount
= m_pImpl
->m_xDataSupplier
->totalCount();
463 m_pImpl
->m_xDataSupplier
->validate();
467 m_pImpl
->m_xDataSupplier
->validate();
468 return ( m_pImpl
->m_nPos
== nCount
);
473 void SAL_CALL
ResultSet::beforeFirst()
474 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
476 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
477 m_pImpl
->m_bAfterLast
= false;
479 m_pImpl
->m_xDataSupplier
->validate();
484 void SAL_CALL
ResultSet::afterLast()
485 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
487 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
488 m_pImpl
->m_bAfterLast
= true;
489 m_pImpl
->m_xDataSupplier
->validate();
494 sal_Bool SAL_CALL
ResultSet::first()
495 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
497 // getResult works zero-based!
498 if ( m_pImpl
->m_xDataSupplier
->getResult( 0 ) )
500 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
501 m_pImpl
->m_bAfterLast
= false;
503 m_pImpl
->m_xDataSupplier
->validate();
507 m_pImpl
->m_xDataSupplier
->validate();
513 sal_Bool SAL_CALL
ResultSet::last()
514 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
516 sal_Int32 nCount
= m_pImpl
->m_xDataSupplier
->totalCount();
519 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
520 m_pImpl
->m_bAfterLast
= false;
521 m_pImpl
->m_nPos
= nCount
;
522 m_pImpl
->m_xDataSupplier
->validate();
526 m_pImpl
->m_xDataSupplier
->validate();
532 sal_Int32 SAL_CALL
ResultSet::getRow()
533 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
535 if ( m_pImpl
->m_bAfterLast
)
537 m_pImpl
->m_xDataSupplier
->validate();
541 m_pImpl
->m_xDataSupplier
->validate();
542 return m_pImpl
->m_nPos
;
547 sal_Bool SAL_CALL
ResultSet::absolute( sal_Int32 row
)
548 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
551 If the row number is positive, the cursor moves to the given row number
552 with respect to the beginning of the result set. The first row is row 1,
553 the second is row 2, and so on.
555 If the given row number is negative, the cursor moves to an absolute row
556 position with respect to the end of the result set. For example, calling
557 absolaute( -1 ) positions the cursor on the last row, absolaute( -2 )
558 indicates the next-to-last row, and so on.
560 An attempt to position the cursor beyond the first/last row in the result
561 set leaves the cursor before/after the first/last row, respectively.
563 Calling absolute( 1 ) is the same as calling first().
565 Calling absolute( -1 ) is the same as calling last().
569 sal_Int32 nCount
= m_pImpl
->m_xDataSupplier
->totalCount();
571 if ( ( row
* -1 ) > nCount
)
573 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
574 m_pImpl
->m_bAfterLast
= false;
576 m_pImpl
->m_xDataSupplier
->validate();
579 else // |row| <= nCount
581 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
582 m_pImpl
->m_bAfterLast
= false;
583 m_pImpl
->m_nPos
= ( nCount
+ row
+ 1 );
584 m_pImpl
->m_xDataSupplier
->validate();
590 // @throws SQLException
591 // ... if row is 0 ...
592 throw sdbc::SQLException();
596 sal_Int32 nCount
= m_pImpl
->m_xDataSupplier
->totalCount();
600 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
601 m_pImpl
->m_bAfterLast
= false;
602 m_pImpl
->m_nPos
= row
;
603 m_pImpl
->m_xDataSupplier
->validate();
608 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
609 m_pImpl
->m_bAfterLast
= true;
610 m_pImpl
->m_xDataSupplier
->validate();
620 sal_Bool SAL_CALL
ResultSet::relative( sal_Int32 rows
)
621 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
624 Attempting to move beyond the first/last row in the result set
625 positions the cursor before/after the first/last row.
627 Calling relative( 0 ) is valid, but does not change the cursor position.
629 Calling relative( 1 ) is different from calling next() because it makes
630 sense to call next() when there is no current row, for example, when
631 the cursor is positioned before the first row or after the last row of
634 if ( m_pImpl
->m_bAfterLast
|| ( m_pImpl
->m_nPos
== 0 ) )
637 throw sdbc::SQLException();
642 if ( ( m_pImpl
->m_nPos
+ rows
) > 0 )
644 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
645 m_pImpl
->m_bAfterLast
= false;
646 m_pImpl
->m_nPos
= ( m_pImpl
->m_nPos
+ rows
);
647 m_pImpl
->m_xDataSupplier
->validate();
652 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
653 m_pImpl
->m_bAfterLast
= false;
655 m_pImpl
->m_xDataSupplier
->validate();
659 else if ( rows
== 0 )
662 m_pImpl
->m_xDataSupplier
->validate();
667 sal_Int32 nCount
= m_pImpl
->m_xDataSupplier
->totalCount();
668 if ( ( m_pImpl
->m_nPos
+ rows
) <= nCount
)
670 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
671 m_pImpl
->m_bAfterLast
= false;
672 m_pImpl
->m_nPos
= ( m_pImpl
->m_nPos
+ rows
);
673 m_pImpl
->m_xDataSupplier
->validate();
678 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
679 m_pImpl
->m_bAfterLast
= true;
680 m_pImpl
->m_xDataSupplier
->validate();
690 sal_Bool SAL_CALL
ResultSet::previous()
691 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
694 previous() is not the same as relative( -1 ) because it makes sense
695 to call previous() when there is no current row.
697 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
699 if ( m_pImpl
->m_bAfterLast
)
701 m_pImpl
->m_bAfterLast
= false;
702 sal_Int32 nCount
= m_pImpl
->m_xDataSupplier
->totalCount();
703 m_pImpl
->m_nPos
= nCount
;
705 else if ( m_pImpl
->m_nPos
)
708 if ( m_pImpl
->m_nPos
)
710 m_pImpl
->m_xDataSupplier
->validate();
714 m_pImpl
->m_xDataSupplier
->validate();
720 void SAL_CALL
ResultSet::refreshRow()
721 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
723 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
724 if ( m_pImpl
->m_bAfterLast
|| ( m_pImpl
->m_nPos
== 0 ) )
727 m_pImpl
->m_xDataSupplier
->releasePropertyValues( m_pImpl
->m_nPos
);
728 m_pImpl
->m_xDataSupplier
->validate();
733 sal_Bool SAL_CALL
ResultSet::rowUpdated()
734 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
736 m_pImpl
->m_xDataSupplier
->validate();
742 sal_Bool SAL_CALL
ResultSet::rowInserted()
743 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
745 m_pImpl
->m_xDataSupplier
->validate();
751 sal_Bool SAL_CALL
ResultSet::rowDeleted()
752 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
754 m_pImpl
->m_xDataSupplier
->validate();
760 uno::Reference
< uno::XInterface
> SAL_CALL
ResultSet::getStatement()
761 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
764 returns the Statement that produced this ResultSet object. If the
765 result set was generated some other way, ... this method returns null.
767 m_pImpl
->m_xDataSupplier
->validate();
768 return uno::Reference
< uno::XInterface
>();
778 sal_Bool SAL_CALL
ResultSet::wasNull()
779 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
781 // This method can not be implemented correctly!!! Imagine different
782 // threads doing a getXYZ - wasNull calling sequence on the same
783 // implementation object...
785 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
787 uno::Reference
< sdbc::XRow
> xValues
788 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
789 m_pImpl
->m_nPos
- 1 );
792 m_pImpl
->m_xDataSupplier
->validate();
793 return xValues
->wasNull();
797 m_pImpl
->m_xDataSupplier
->validate();
798 return m_pImpl
->m_bWasNull
;
803 OUString SAL_CALL
ResultSet::getString( sal_Int32 columnIndex
)
804 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
806 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
808 uno::Reference
< sdbc::XRow
> xValues
809 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
810 m_pImpl
->m_nPos
- 1 );
813 m_pImpl
->m_bWasNull
= false;
814 m_pImpl
->m_xDataSupplier
->validate();
815 return xValues
->getString( columnIndex
);
819 m_pImpl
->m_bWasNull
= true;
820 m_pImpl
->m_xDataSupplier
->validate();
826 sal_Bool SAL_CALL
ResultSet::getBoolean( sal_Int32 columnIndex
)
827 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
829 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
831 uno::Reference
< sdbc::XRow
> xValues
832 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
833 m_pImpl
->m_nPos
- 1 );
836 m_pImpl
->m_bWasNull
= false;
837 m_pImpl
->m_xDataSupplier
->validate();
838 return xValues
->getBoolean( columnIndex
);
842 m_pImpl
->m_bWasNull
= true;
843 m_pImpl
->m_xDataSupplier
->validate();
849 sal_Int8 SAL_CALL
ResultSet::getByte( sal_Int32 columnIndex
)
850 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
852 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
854 uno::Reference
< sdbc::XRow
> xValues
855 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
856 m_pImpl
->m_nPos
- 1 );
859 m_pImpl
->m_bWasNull
= false;
860 m_pImpl
->m_xDataSupplier
->validate();
861 return xValues
->getByte( columnIndex
);
865 m_pImpl
->m_bWasNull
= true;
866 m_pImpl
->m_xDataSupplier
->validate();
872 sal_Int16 SAL_CALL
ResultSet::getShort( sal_Int32 columnIndex
)
873 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
875 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
877 uno::Reference
< sdbc::XRow
> xValues
878 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
879 m_pImpl
->m_nPos
- 1 );
882 m_pImpl
->m_bWasNull
= false;
883 m_pImpl
->m_xDataSupplier
->validate();
884 return xValues
->getShort( columnIndex
);
888 m_pImpl
->m_bWasNull
= true;
889 m_pImpl
->m_xDataSupplier
->validate();
895 sal_Int32 SAL_CALL
ResultSet::getInt( sal_Int32 columnIndex
)
896 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
898 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
900 uno::Reference
< sdbc::XRow
> xValues
901 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
902 m_pImpl
->m_nPos
- 1 );
905 m_pImpl
->m_bWasNull
= false;
906 m_pImpl
->m_xDataSupplier
->validate();
907 return xValues
->getInt( columnIndex
);
911 m_pImpl
->m_bWasNull
= true;
912 m_pImpl
->m_xDataSupplier
->validate();
918 sal_Int64 SAL_CALL
ResultSet::getLong( sal_Int32 columnIndex
)
919 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
921 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
923 uno::Reference
< sdbc::XRow
> xValues
924 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
925 m_pImpl
->m_nPos
- 1 );
928 m_pImpl
->m_bWasNull
= false;
929 m_pImpl
->m_xDataSupplier
->validate();
930 return xValues
->getLong( columnIndex
);
934 m_pImpl
->m_bWasNull
= true;
935 m_pImpl
->m_xDataSupplier
->validate();
941 float SAL_CALL
ResultSet::getFloat( sal_Int32 columnIndex
)
942 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
944 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
946 uno::Reference
< sdbc::XRow
> xValues
947 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
948 m_pImpl
->m_nPos
- 1 );
951 m_pImpl
->m_bWasNull
= false;
952 m_pImpl
->m_xDataSupplier
->validate();
953 return xValues
->getFloat( columnIndex
);
957 m_pImpl
->m_bWasNull
= true;
958 m_pImpl
->m_xDataSupplier
->validate();
964 double SAL_CALL
ResultSet::getDouble( sal_Int32 columnIndex
)
965 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
967 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
969 uno::Reference
< sdbc::XRow
> xValues
970 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
971 m_pImpl
->m_nPos
- 1 );
974 m_pImpl
->m_bWasNull
= false;
975 m_pImpl
->m_xDataSupplier
->validate();
976 return xValues
->getDouble( columnIndex
);
980 m_pImpl
->m_bWasNull
= true;
981 m_pImpl
->m_xDataSupplier
->validate();
987 uno::Sequence
< sal_Int8
> SAL_CALL
988 ResultSet::getBytes( sal_Int32 columnIndex
)
989 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
991 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
993 uno::Reference
< sdbc::XRow
> xValues
994 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
995 m_pImpl
->m_nPos
- 1 );
998 m_pImpl
->m_bWasNull
= false;
999 m_pImpl
->m_xDataSupplier
->validate();
1000 return xValues
->getBytes( columnIndex
);
1004 m_pImpl
->m_bWasNull
= true;
1005 m_pImpl
->m_xDataSupplier
->validate();
1006 return uno::Sequence
< sal_Int8
>();
1011 util::Date SAL_CALL
ResultSet::getDate( sal_Int32 columnIndex
)
1012 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1014 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1016 uno::Reference
< sdbc::XRow
> xValues
1017 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1018 m_pImpl
->m_nPos
- 1 );
1021 m_pImpl
->m_bWasNull
= false;
1022 m_pImpl
->m_xDataSupplier
->validate();
1023 return xValues
->getDate( columnIndex
);
1027 m_pImpl
->m_bWasNull
= true;
1028 m_pImpl
->m_xDataSupplier
->validate();
1029 return util::Date();
1034 util::Time SAL_CALL
ResultSet::getTime( sal_Int32 columnIndex
)
1035 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1037 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1039 uno::Reference
< sdbc::XRow
> xValues
1040 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1041 m_pImpl
->m_nPos
- 1 );
1044 m_pImpl
->m_bWasNull
= false;
1045 m_pImpl
->m_xDataSupplier
->validate();
1046 return xValues
->getTime( columnIndex
);
1050 m_pImpl
->m_bWasNull
= true;
1051 m_pImpl
->m_xDataSupplier
->validate();
1052 return util::Time();
1057 util::DateTime SAL_CALL
1058 ResultSet::getTimestamp( sal_Int32 columnIndex
)
1059 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1061 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1063 uno::Reference
< sdbc::XRow
> xValues
1064 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1065 m_pImpl
->m_nPos
- 1 );
1068 m_pImpl
->m_bWasNull
= false;
1069 m_pImpl
->m_xDataSupplier
->validate();
1070 return xValues
->getTimestamp( columnIndex
);
1074 m_pImpl
->m_bWasNull
= true;
1075 m_pImpl
->m_xDataSupplier
->validate();
1076 return util::DateTime();
1081 uno::Reference
< io::XInputStream
> SAL_CALL
1082 ResultSet::getBinaryStream( sal_Int32 columnIndex
)
1083 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1085 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1087 uno::Reference
< sdbc::XRow
> xValues
1088 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1089 m_pImpl
->m_nPos
- 1 );
1092 m_pImpl
->m_bWasNull
= false;
1093 m_pImpl
->m_xDataSupplier
->validate();
1094 return xValues
->getBinaryStream( columnIndex
);
1098 m_pImpl
->m_bWasNull
= true;
1099 m_pImpl
->m_xDataSupplier
->validate();
1100 return uno::Reference
< io::XInputStream
>();
1105 uno::Reference
< io::XInputStream
> SAL_CALL
1106 ResultSet::getCharacterStream( sal_Int32 columnIndex
)
1107 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1109 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1111 uno::Reference
< sdbc::XRow
> xValues
1112 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1113 m_pImpl
->m_nPos
- 1 );
1116 m_pImpl
->m_bWasNull
= false;
1117 m_pImpl
->m_xDataSupplier
->validate();
1118 return xValues
->getCharacterStream( columnIndex
);
1122 m_pImpl
->m_bWasNull
= true;
1123 m_pImpl
->m_xDataSupplier
->validate();
1124 return uno::Reference
< io::XInputStream
>();
1129 uno::Any SAL_CALL
ResultSet::getObject(
1130 sal_Int32 columnIndex
,
1131 const uno::Reference
< container::XNameAccess
>& typeMap
)
1132 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1134 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1136 uno::Reference
< sdbc::XRow
> xValues
1137 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1138 m_pImpl
->m_nPos
- 1 );
1141 m_pImpl
->m_bWasNull
= false;
1142 m_pImpl
->m_xDataSupplier
->validate();
1143 return xValues
->getObject( columnIndex
, typeMap
);
1147 m_pImpl
->m_bWasNull
= true;
1148 m_pImpl
->m_xDataSupplier
->validate();
1154 uno::Reference
< sdbc::XRef
> SAL_CALL
1155 ResultSet::getRef( sal_Int32 columnIndex
)
1156 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1158 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1160 uno::Reference
< sdbc::XRow
> xValues
1161 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1162 m_pImpl
->m_nPos
- 1 );
1165 m_pImpl
->m_bWasNull
= false;
1166 m_pImpl
->m_xDataSupplier
->validate();
1167 return xValues
->getRef( columnIndex
);
1171 m_pImpl
->m_bWasNull
= true;
1172 m_pImpl
->m_xDataSupplier
->validate();
1173 return uno::Reference
< sdbc::XRef
>();
1178 uno::Reference
< sdbc::XBlob
> SAL_CALL
1179 ResultSet::getBlob( sal_Int32 columnIndex
)
1180 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1182 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1184 uno::Reference
< sdbc::XRow
> xValues
1185 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1186 m_pImpl
->m_nPos
- 1 );
1189 m_pImpl
->m_bWasNull
= false;
1190 m_pImpl
->m_xDataSupplier
->validate();
1191 return xValues
->getBlob( columnIndex
);
1195 m_pImpl
->m_bWasNull
= true;
1196 m_pImpl
->m_xDataSupplier
->validate();
1197 return uno::Reference
< sdbc::XBlob
>();
1202 uno::Reference
< sdbc::XClob
> SAL_CALL
1203 ResultSet::getClob( sal_Int32 columnIndex
)
1204 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1206 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1208 uno::Reference
< sdbc::XRow
> xValues
1209 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1210 m_pImpl
->m_nPos
- 1 );
1213 m_pImpl
->m_bWasNull
= false;
1214 m_pImpl
->m_xDataSupplier
->validate();
1215 return xValues
->getClob( columnIndex
);
1219 m_pImpl
->m_bWasNull
= true;
1220 m_pImpl
->m_xDataSupplier
->validate();
1221 return uno::Reference
< sdbc::XClob
>();
1226 uno::Reference
< sdbc::XArray
> SAL_CALL
1227 ResultSet::getArray( sal_Int32 columnIndex
)
1228 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1230 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1232 uno::Reference
< sdbc::XRow
> xValues
1233 = m_pImpl
->m_xDataSupplier
->queryPropertyValues(
1234 m_pImpl
->m_nPos
- 1 );
1237 m_pImpl
->m_bWasNull
= false;
1238 m_pImpl
->m_xDataSupplier
->validate();
1239 return xValues
->getArray( columnIndex
);
1243 m_pImpl
->m_bWasNull
= true;
1244 m_pImpl
->m_xDataSupplier
->validate();
1245 return uno::Reference
< sdbc::XArray
>();
1250 // XCloseable methods.
1255 void SAL_CALL
ResultSet::close()
1256 throw( sdbc::SQLException
, uno::RuntimeException
, std::exception
)
1258 m_pImpl
->m_xDataSupplier
->close();
1259 m_pImpl
->m_xDataSupplier
->validate();
1264 // XContentAccess methods.
1269 OUString SAL_CALL
ResultSet::queryContentIdentifierString()
1270 throw( uno::RuntimeException
, std::exception
)
1272 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1273 return m_pImpl
->m_xDataSupplier
->queryContentIdentifierString(
1274 m_pImpl
->m_nPos
- 1 );
1281 uno::Reference
< com::sun::star::ucb::XContentIdentifier
> SAL_CALL
1282 ResultSet::queryContentIdentifier()
1283 throw( uno::RuntimeException
, std::exception
)
1285 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1286 return m_pImpl
->m_xDataSupplier
->queryContentIdentifier(
1287 m_pImpl
->m_nPos
- 1 );
1289 return uno::Reference
< com::sun::star::ucb::XContentIdentifier
>();
1294 uno::Reference
< com::sun::star::ucb::XContent
> SAL_CALL
1295 ResultSet::queryContent()
1296 throw( uno::RuntimeException
, std::exception
)
1298 if ( m_pImpl
->m_nPos
&& !m_pImpl
->m_bAfterLast
)
1299 return m_pImpl
->m_xDataSupplier
->queryContent( m_pImpl
->m_nPos
- 1 );
1301 return uno::Reference
< com::sun::star::ucb::XContent
>();
1306 // XPropertySet methods.
1311 uno::Reference
< beans::XPropertySetInfo
> SAL_CALL
1312 ResultSet::getPropertySetInfo()
1313 throw( uno::RuntimeException
, std::exception
)
1315 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
1317 if ( !m_pImpl
->m_xPropSetInfo
.is() )
1318 m_pImpl
->m_xPropSetInfo
1319 = new PropertySetInfo( aPropertyTable
,
1320 RESULTSET_PROPERTY_COUNT
);
1321 return m_pImpl
->m_xPropSetInfo
;
1326 void SAL_CALL
ResultSet::setPropertyValue( const OUString
& aPropertyName
,
1328 throw( beans::UnknownPropertyException
,
1329 beans::PropertyVetoException
,
1330 lang::IllegalArgumentException
,
1331 lang::WrappedTargetException
,
1332 uno::RuntimeException
, std::exception
)
1334 if ( aPropertyName
.isEmpty() )
1335 throw beans::UnknownPropertyException();
1337 if ( aPropertyName
== "RowCount" )
1339 // property is read-only.
1340 throw lang::IllegalArgumentException();
1342 else if ( aPropertyName
== "IsRowCountFinal" )
1344 // property is read-only.
1345 throw lang::IllegalArgumentException();
1349 throw beans::UnknownPropertyException();
1355 uno::Any SAL_CALL
ResultSet::getPropertyValue(
1356 const OUString
& PropertyName
)
1357 throw( beans::UnknownPropertyException
,
1358 lang::WrappedTargetException
,
1359 uno::RuntimeException
, std::exception
)
1361 if ( PropertyName
.isEmpty() )
1362 throw beans::UnknownPropertyException();
1366 if ( PropertyName
== "RowCount" )
1368 aValue
<<= m_pImpl
->m_xDataSupplier
->currentCount();
1370 else if ( PropertyName
== "IsRowCountFinal" )
1372 aValue
<<= m_pImpl
->m_xDataSupplier
->isCountFinal();
1376 throw beans::UnknownPropertyException();
1384 void SAL_CALL
ResultSet::addPropertyChangeListener(
1385 const OUString
& aPropertyName
,
1386 const uno::Reference
< beans::XPropertyChangeListener
>& xListener
)
1387 throw( beans::UnknownPropertyException
,
1388 lang::WrappedTargetException
,
1389 uno::RuntimeException
, std::exception
)
1391 // Note: An empty property name means a listener for "all" properties.
1393 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
1395 if ( !aPropertyName
.isEmpty() &&
1396 aPropertyName
!= "RowCount" &&
1397 aPropertyName
!= "IsRowCountFinal" )
1398 throw beans::UnknownPropertyException();
1400 if ( !m_pImpl
->m_pPropertyChangeListeners
)
1401 m_pImpl
->m_pPropertyChangeListeners
1402 = new PropertyChangeListeners( m_pImpl
->m_aMutex
);
1404 m_pImpl
->m_pPropertyChangeListeners
->addInterface(
1405 aPropertyName
, xListener
);
1410 void SAL_CALL
ResultSet::removePropertyChangeListener(
1411 const OUString
& aPropertyName
,
1412 const uno::Reference
< beans::XPropertyChangeListener
>& xListener
)
1413 throw( beans::UnknownPropertyException
,
1414 lang::WrappedTargetException
,
1415 uno::RuntimeException
, std::exception
)
1417 osl::MutexGuard
aGuard( m_pImpl
->m_aMutex
);
1419 if ( !aPropertyName
.isEmpty() &&
1420 aPropertyName
!= "RowCount" &&
1421 aPropertyName
!= "IsRowCountFinal" )
1422 throw beans::UnknownPropertyException();
1424 if ( m_pImpl
->m_pPropertyChangeListeners
)
1425 m_pImpl
->m_pPropertyChangeListeners
->removeInterface(
1426 aPropertyName
, xListener
);
1432 void SAL_CALL
ResultSet::addVetoableChangeListener(
1434 const uno::Reference
< beans::XVetoableChangeListener
>& )
1435 throw( beans::UnknownPropertyException
,
1436 lang::WrappedTargetException
,
1437 uno::RuntimeException
, std::exception
)
1439 // No constrained props, at the moment.
1444 void SAL_CALL
ResultSet::removeVetoableChangeListener(
1446 const uno::Reference
< beans::XVetoableChangeListener
>& )
1447 throw( beans::UnknownPropertyException
,
1448 lang::WrappedTargetException
,
1449 uno::RuntimeException
, std::exception
)
1451 // No constrained props, at the moment.
1456 // Non-interface methods.
1460 void ResultSet::propertyChanged( const beans::PropertyChangeEvent
& rEvt
)
1462 if ( !m_pImpl
->m_pPropertyChangeListeners
)
1465 // Notify listeners interested especially in the changed property.
1466 cppu::OInterfaceContainerHelper
* pPropsContainer
1467 = m_pImpl
->m_pPropertyChangeListeners
->getContainer(
1468 rEvt
.PropertyName
);
1469 if ( pPropsContainer
)
1471 cppu::OInterfaceIteratorHelper
aIter( *pPropsContainer
);
1472 while ( aIter
.hasMoreElements() )
1474 uno::Reference
< beans::XPropertyChangeListener
> xListener(
1475 aIter
.next(), uno::UNO_QUERY
);
1476 if ( xListener
.is() )
1477 xListener
->propertyChange( rEvt
);
1481 // Notify listeners interested in all properties.
1483 = m_pImpl
->m_pPropertyChangeListeners
->getContainer( OUString() );
1484 if ( pPropsContainer
)
1486 cppu::OInterfaceIteratorHelper
aIter( *pPropsContainer
);
1487 while ( aIter
.hasMoreElements() )
1489 uno::Reference
< beans::XPropertyChangeListener
> xListener(
1490 aIter
.next(), uno::UNO_QUERY
);
1491 if ( xListener
.is() )
1492 xListener
->propertyChange( rEvt
);
1498 void ResultSet::rowCountChanged( sal_uInt32 nOld
, sal_uInt32 nNew
)
1500 OSL_ENSURE( nOld
< nNew
, "ResultSet::rowCountChanged - nOld >= nNew!" );
1502 if ( !m_pImpl
->m_pPropertyChangeListeners
)
1506 beans::PropertyChangeEvent(
1507 static_cast< cppu::OWeakObject
* >( this ),
1508 OUString("RowCount"),
1511 uno::makeAny( nOld
), // old value
1512 uno::makeAny( nNew
) ) ); // new value
1516 void ResultSet::rowCountFinal()
1518 if ( !m_pImpl
->m_pPropertyChangeListeners
)
1522 beans::PropertyChangeEvent(
1523 static_cast< cppu::OWeakObject
* >( this ),
1524 OUString("IsRowCountFinal"),
1527 uno:: makeAny( sal_False
), // old value
1528 uno::makeAny( sal_True
) ) ); // new value
1532 const uno::Sequence
< beans::Property
>& ResultSet::getProperties()
1534 return m_pImpl
->m_aProperties
;
1538 const uno::Reference
< com::sun::star::ucb::XCommandEnvironment
>&
1539 ResultSet::getEnvironment()
1541 return m_pImpl
->m_xEnv
;
1544 } // namespace ucbhelper
1546 namespace ucbhelper_impl
{
1551 // PropertySetInfo Implementation.
1556 PropertySetInfo::PropertySetInfo(
1557 const PropertyInfo
* pProps
,
1560 m_pProps
= new uno::Sequence
< beans::Property
>( nProps
);
1564 const PropertyInfo
* pEntry
= pProps
;
1565 beans::Property
* pProperties
= m_pProps
->getArray();
1567 for ( sal_Int32 n
= 0; n
< nProps
; ++n
)
1569 beans::Property
& rProp
= pProperties
[ n
];
1571 rProp
.Name
= OUString::createFromAscii( pEntry
->pName
);
1572 rProp
.Handle
= pEntry
->nHandle
;
1573 rProp
.Type
= pEntry
->pGetCppuType();
1574 rProp
.Attributes
= pEntry
->nAttributes
;
1583 PropertySetInfo::~PropertySetInfo()
1590 // XInterface methods.
1591 void SAL_CALL
PropertySetInfo::acquire()
1594 OWeakObject::acquire();
1597 void SAL_CALL
PropertySetInfo::release()
1600 OWeakObject::release();
1603 css::uno::Any SAL_CALL
PropertySetInfo::queryInterface(
1604 const css::uno::Type
& rType
)
1605 throw( css::uno::RuntimeException
, std::exception
)
1607 css::uno::Any aRet
= cppu::queryInterface( rType
,
1608 (static_cast< lang::XTypeProvider
* >(this)),
1609 (static_cast< beans::XPropertySetInfo
* >(this))
1611 return aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
);
1614 // XTypeProvider methods.
1618 XTYPEPROVIDER_IMPL_2( PropertySetInfo
,
1619 lang::XTypeProvider
,
1620 beans::XPropertySetInfo
);
1624 // XPropertySetInfo methods.
1629 uno::Sequence
< beans::Property
> SAL_CALL
PropertySetInfo::getProperties()
1630 throw( uno::RuntimeException
, std::exception
)
1632 return uno::Sequence
< beans::Property
>( *m_pProps
);
1637 beans::Property SAL_CALL
PropertySetInfo::getPropertyByName(
1638 const OUString
& aName
)
1639 throw( beans::UnknownPropertyException
, uno::RuntimeException
, std::exception
)
1641 beans::Property aProp
;
1642 if ( queryProperty( aName
, aProp
) )
1645 throw beans::UnknownPropertyException();
1650 sal_Bool SAL_CALL
PropertySetInfo::hasPropertyByName(
1651 const OUString
& Name
)
1652 throw( uno::RuntimeException
, std::exception
)
1654 beans::Property aProp
;
1655 return queryProperty( Name
, aProp
);
1659 bool PropertySetInfo::queryProperty(
1660 const OUString
& aName
, beans::Property
& rProp
)
1662 sal_Int32 nCount
= m_pProps
->getLength();
1663 const beans::Property
* pProps
= m_pProps
->getConstArray();
1664 for ( sal_Int32 n
= 0; n
< nCount
; ++n
)
1666 const beans::Property
& rCurr
= pProps
[ n
];
1667 if ( rCurr
.Name
== aName
)
1677 } // namespace ucbhelper_impl
1679 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */