LibreOffice Module ucbhelper (master) 1
resultset.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <memory>
21#include <mutex>
25#include <com/sun/star/beans/PropertyAttribute.hpp>
26#include <com/sun/star/sdbc/SQLException.hpp>
29#include <ucbhelper/macros.hxx>
30#include <utility>
31#include <osl/diagnose.h>
32
33using namespace com::sun::star;
34
35
36namespace ucbhelper_impl
37{
38
39namespace {
40
41struct PropertyInfo
42{
43 const char* pName;
44 sal_Int32 nHandle;
45 sal_Int16 nAttributes;
46 const uno::Type& (*pGetCppuType)();
47};
48
49}
50
52{
54}
55
57{
59}
60
61const PropertyInfo aPropertyTable[] =
62{
63 { "IsRowCountFinal",
64 1000,
65 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY,
67 },
68 { "RowCount",
69 1001,
70 beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY,
72 },
73 { nullptr,
74 0,
75 0,
76 nullptr
77 }
78};
79
80#define RESULTSET_PROPERTY_COUNT 2
81
82
83
84namespace {
85
86class PropertySetInfo :
87 public cppu::OWeakObject,
88 public lang::XTypeProvider,
89 public beans::XPropertySetInfo
90{
91 uno::Sequence< beans::Property > m_aProps;
92
93private:
94 bool queryProperty(
95 std::u16string_view aName, beans::Property& rProp ) const;
96
97public:
98 PropertySetInfo(
99 const PropertyInfo* pProps,
100 sal_Int32 nProps );
101
102 // XInterface
103 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
104 virtual void SAL_CALL acquire()
105 noexcept override;
106 virtual void SAL_CALL release()
107 noexcept override;
108
109 // XTypeProvider
110 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
111 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
112
113 // XPropertySetInfo
114 virtual uno::Sequence< beans::Property > SAL_CALL getProperties() override;
115 virtual beans::Property SAL_CALL getPropertyByName(
116 const OUString& aName ) override;
117 virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override;
118};
119
120}
121
122typedef comphelper::OMultiTypeInterfaceContainerHelperVar4<OUString, css::beans::XPropertyChangeListener>
124
125} // namespace ucbhelper_impl
126
127using namespace ucbhelper_impl;
128
129namespace ucbhelper
130{
131
132
133// struct ResultSet_Impl.
134
135
137{
138 uno::Reference< uno::XComponentContext > m_xContext;
139 uno::Reference< css::ucb::XCommandEnvironment > m_xEnv;
140 uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo;
141 uno::Reference< sdbc::XResultSetMetaData > m_xMetaData;
142 uno::Sequence< beans::Property > m_aProperties;
144 std::mutex m_aMutex;
146 std::unique_ptr<PropertyChangeListeners> m_pPropertyChangeListeners;
147 sal_Int32 m_nPos;
150
151 inline ResultSet_Impl(
152 uno::Reference< uno::XComponentContext > xContext,
153 const uno::Sequence< beans::Property >& rProperties,
155 uno::Reference< css::ucb::XCommandEnvironment > xEnv );
156};
157
158inline ResultSet_Impl::ResultSet_Impl(
159 uno::Reference< uno::XComponentContext > xContext,
160 const uno::Sequence< beans::Property >& rProperties,
162 uno::Reference< css::ucb::XCommandEnvironment > xEnv )
163: m_xContext(std::move( xContext )),
164 m_xEnv(std::move( xEnv )),
165 m_aProperties( rProperties ),
166 m_xDataSupplier(std::move( xDataSupplier )),
167 m_nPos( 0 ), // Position is one-based. Zero means: before first element.
168 m_bWasNull( false ),
169 m_bAfterLast( false )
170{
171}
172
173
174// ResultSet Implementation.
175
176
178 const uno::Reference< uno::XComponentContext >& rxContext,
179 const uno::Sequence< beans::Property >& rProperties,
180 const rtl::Reference< ResultSetDataSupplier >& rDataSupplier )
182 rxContext,
183 rProperties,
184 rDataSupplier,
185 uno::Reference< css::ucb::XCommandEnvironment >() ) )
186{
187 rDataSupplier->m_pResultSet = this;
188}
189
190
192 const uno::Reference< uno::XComponentContext >& rxContext,
193 const uno::Sequence< beans::Property >& rProperties,
194 const rtl::Reference< ResultSetDataSupplier >& rDataSupplier,
195 const uno::Reference< css::ucb::XCommandEnvironment >& rxEnv )
196: m_pImpl( new ResultSet_Impl( rxContext, rProperties, rDataSupplier, rxEnv ) )
197{
198 rDataSupplier->m_pResultSet = this;
199}
200
201
202// virtual
204{
205}
206
207
208// XServiceInfo methods.
209
211{
212 return "ResultSet";
213}
214
215sal_Bool SAL_CALL ResultSet::supportsService( const OUString& ServiceName )
216{
217 return cppu::supportsService( this, ServiceName );
218}
219
220css::uno::Sequence< OUString > SAL_CALL ResultSet::getSupportedServiceNames()
221{
222 return { RESULTSET_SERVICE_NAME };
223}
224
225
226// XComponent methods.
227
228
229// virtual
230void SAL_CALL ResultSet::dispose()
231{
232 std::unique_lock aGuard( m_pImpl->m_aMutex );
233
234 if ( m_pImpl->m_aDisposeEventListeners.getLength(aGuard) )
235 {
236 lang::EventObject aEvt;
237 aEvt.Source = static_cast< lang::XComponent * >( this );
238 m_pImpl->m_aDisposeEventListeners.disposeAndClear( aGuard, aEvt );
239 }
240
241 if ( m_pImpl->m_pPropertyChangeListeners )
242 {
243 lang::EventObject aEvt;
244 aEvt.Source = static_cast< beans::XPropertySet * >( this );
245 m_pImpl->m_pPropertyChangeListeners->disposeAndClear( aGuard, aEvt );
246 }
247
248 m_pImpl->m_xDataSupplier->close();
249}
250
251
252// virtual
254 const uno::Reference< lang::XEventListener >& Listener )
255{
256 std::unique_lock aGuard( m_pImpl->m_aMutex );
257
258 m_pImpl->m_aDisposeEventListeners.addInterface( aGuard, Listener );
259}
260
261
262// virtual
264 const uno::Reference< lang::XEventListener >& Listener )
265{
266 std::unique_lock aGuard( m_pImpl->m_aMutex );
267
268 m_pImpl->m_aDisposeEventListeners.removeInterface( aGuard, Listener );
269}
270
271
272// XResultSetMetaDataSupplier methods.
273
274
275// virtual
276uno::Reference< sdbc::XResultSetMetaData > SAL_CALL ResultSet::getMetaData()
277{
278 std::unique_lock aGuard( m_pImpl->m_aMutex );
279
280 if ( !m_pImpl->m_xMetaData.is() )
281 m_pImpl->m_xMetaData = new ResultSetMetaData( m_pImpl->m_xContext,
282 m_pImpl->m_aProperties );
283
284 return m_pImpl->m_xMetaData;
285}
286
287
288// XResultSet methods.
289
290
291// virtual
293{
294 // Note: Cursor is initially positioned before the first row.
295 // First call to 'next()' moves it to first row.
296
297 std::unique_lock aGuard( m_pImpl->m_aMutex );
298
299 if ( m_pImpl->m_bAfterLast )
300 {
301 m_pImpl->m_xDataSupplier->validate();
302 return false;
303 }
304
305 // getResult works zero-based!
306 if ( !m_pImpl->m_xDataSupplier->getResult( m_pImpl->m_nPos ) )
307 {
308 m_pImpl->m_bAfterLast = true;
309 m_pImpl->m_xDataSupplier->validate();
310 return false;
311 }
312
313 m_pImpl->m_nPos++;
314 m_pImpl->m_xDataSupplier->validate();
315 return true;
316}
317
318
319// virtual
321{
322 if ( m_pImpl->m_bAfterLast )
323 {
324 m_pImpl->m_xDataSupplier->validate();
325 return false;
326 }
327
328 // getResult works zero-based!
329 if ( !m_pImpl->m_xDataSupplier->getResult( 0 ) )
330 {
331 m_pImpl->m_xDataSupplier->validate();
332 return false;
333 }
334
335 m_pImpl->m_xDataSupplier->validate();
336 return ( m_pImpl->m_nPos == 0 );
337}
338
339
340// virtual
342{
343 m_pImpl->m_xDataSupplier->validate();
344 return m_pImpl->m_bAfterLast;
345}
346
347
348// virtual
350{
351 if ( m_pImpl->m_bAfterLast )
352 {
353 m_pImpl->m_xDataSupplier->validate();
354 return false;
355 }
356
357 m_pImpl->m_xDataSupplier->validate();
358 return ( m_pImpl->m_nPos == 1 );
359}
360
361
362// virtual
364{
365 if ( m_pImpl->m_bAfterLast )
366 {
367 m_pImpl->m_xDataSupplier->validate();
368 return false;
369 }
370
371 sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
372 if ( !nCount )
373 {
374 m_pImpl->m_xDataSupplier->validate();
375 return false;
376 }
377
378 m_pImpl->m_xDataSupplier->validate();
379 return ( m_pImpl->m_nPos == nCount );
380}
381
382
383// virtual
385{
386 std::unique_lock aGuard( m_pImpl->m_aMutex );
387 m_pImpl->m_bAfterLast = false;
388 m_pImpl->m_nPos = 0;
389 m_pImpl->m_xDataSupplier->validate();
390}
391
392
393// virtual
394void SAL_CALL ResultSet::afterLast()
395{
396 std::unique_lock aGuard( m_pImpl->m_aMutex );
397 m_pImpl->m_bAfterLast = true;
398 m_pImpl->m_xDataSupplier->validate();
399}
400
401
402// virtual
404{
405 // getResult works zero-based!
406 if ( m_pImpl->m_xDataSupplier->getResult( 0 ) )
407 {
408 std::unique_lock aGuard( m_pImpl->m_aMutex );
409 m_pImpl->m_bAfterLast = false;
410 m_pImpl->m_nPos = 1;
411 m_pImpl->m_xDataSupplier->validate();
412 return true;
413 }
414
415 m_pImpl->m_xDataSupplier->validate();
416 return false;
417}
418
419
420// virtual
422{
423 sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
424 if ( nCount )
425 {
426 std::unique_lock aGuard( m_pImpl->m_aMutex );
427 m_pImpl->m_bAfterLast = false;
428 m_pImpl->m_nPos = nCount;
429 m_pImpl->m_xDataSupplier->validate();
430 return true;
431 }
432
433 m_pImpl->m_xDataSupplier->validate();
434 return false;
435}
436
437
438// virtual
439sal_Int32 SAL_CALL ResultSet::getRow()
440{
441 if ( m_pImpl->m_bAfterLast )
442 {
443 m_pImpl->m_xDataSupplier->validate();
444 return 0;
445 }
446
447 m_pImpl->m_xDataSupplier->validate();
448 return m_pImpl->m_nPos;
449}
450
451
452// virtual
453sal_Bool SAL_CALL ResultSet::absolute( sal_Int32 row )
454{
455/*
456 If the row number is positive, the cursor moves to the given row number
457 with respect to the beginning of the result set. The first row is row 1,
458 the second is row 2, and so on.
459
460 If the given row number is negative, the cursor moves to an absolute row
461 position with respect to the end of the result set. For example, calling
462 absolute( -1 ) positions the cursor on the last row, absolute( -2 )
463 indicates the next-to-last row, and so on.
464
465 An attempt to position the cursor beyond the first/last row in the result
466 set leaves the cursor before/after the first/last row, respectively.
467
468 Calling absolute( 1 ) is the same as calling first().
469
470 Calling absolute( -1 ) is the same as calling last().
471*/
472 if ( row < 0 )
473 {
474 sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
475
476 if ( ( row * -1 ) > nCount )
477 {
478 std::unique_lock aGuard( m_pImpl->m_aMutex );
479 m_pImpl->m_bAfterLast = false;
480 m_pImpl->m_nPos = 0;
481 m_pImpl->m_xDataSupplier->validate();
482 return false;
483 }
484 else // |row| <= nCount
485 {
486 std::unique_lock aGuard( m_pImpl->m_aMutex );
487 m_pImpl->m_bAfterLast = false;
488 m_pImpl->m_nPos = ( nCount + row + 1 );
489 m_pImpl->m_xDataSupplier->validate();
490 return true;
491 }
492 }
493 else if ( row == 0 )
494 {
495 // @throws SQLException
496 // ... if row is 0 ...
497 throw sdbc::SQLException();
498 }
499 else // row > 0
500 {
501 sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
502
503 if ( row <= nCount )
504 {
505 std::unique_lock aGuard( m_pImpl->m_aMutex );
506 m_pImpl->m_bAfterLast = false;
507 m_pImpl->m_nPos = row;
508 m_pImpl->m_xDataSupplier->validate();
509 return true;
510 }
511 else // row > nCount
512 {
513 std::unique_lock aGuard( m_pImpl->m_aMutex );
514 m_pImpl->m_bAfterLast = true;
515 m_pImpl->m_xDataSupplier->validate();
516 return false;
517 }
518 }
519
520 // unreachable...
521}
522
523
524// virtual
525sal_Bool SAL_CALL ResultSet::relative( sal_Int32 rows )
526{
527/*
528 Attempting to move beyond the first/last row in the result set
529 positions the cursor before/after the first/last row.
530
531 Calling relative( 0 ) is valid, but does not change the cursor position.
532
533 Calling relative( 1 ) is different from calling next() because it makes
534 sense to call next() when there is no current row, for example, when
535 the cursor is positioned before the first row or after the last row of
536 the result set.
537*/
538 if ( m_pImpl->m_bAfterLast || ( m_pImpl->m_nPos == 0 ) )
539 {
540 // "No current row".
541 throw sdbc::SQLException();
542 }
543
544 if ( rows < 0 )
545 {
546 if ( ( m_pImpl->m_nPos + rows ) > 0 )
547 {
548 std::unique_lock aGuard( m_pImpl->m_aMutex );
549 m_pImpl->m_bAfterLast = false;
550 m_pImpl->m_nPos = ( m_pImpl->m_nPos + rows );
551 m_pImpl->m_xDataSupplier->validate();
552 return true;
553 }
554 else
555 {
556 std::unique_lock aGuard( m_pImpl->m_aMutex );
557 m_pImpl->m_bAfterLast = false;
558 m_pImpl->m_nPos = 0;
559 m_pImpl->m_xDataSupplier->validate();
560 return false;
561 }
562 }
563 else if ( rows == 0 )
564 {
565 // nop.
566 m_pImpl->m_xDataSupplier->validate();
567 return true;
568 }
569 else // rows > 0
570 {
571 sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
572 if ( ( m_pImpl->m_nPos + rows ) <= nCount )
573 {
574 std::unique_lock aGuard( m_pImpl->m_aMutex );
575 m_pImpl->m_bAfterLast = false;
576 m_pImpl->m_nPos = ( m_pImpl->m_nPos + rows );
577 m_pImpl->m_xDataSupplier->validate();
578 return true;
579 }
580 else
581 {
582 std::unique_lock aGuard( m_pImpl->m_aMutex );
583 m_pImpl->m_bAfterLast = true;
584 m_pImpl->m_xDataSupplier->validate();
585 return false;
586 }
587 }
588
589 // unreachable...
590}
591
592
593// virtual
595{
596/*
597 previous() is not the same as relative( -1 ) because it makes sense
598 to call previous() when there is no current row.
599*/
600 std::unique_lock aGuard( m_pImpl->m_aMutex );
601
602 if ( m_pImpl->m_bAfterLast )
603 {
604 m_pImpl->m_bAfterLast = false;
605 sal_Int32 nCount = m_pImpl->m_xDataSupplier->totalCount();
606 m_pImpl->m_nPos = nCount;
607 }
608 else if ( m_pImpl->m_nPos )
609 m_pImpl->m_nPos--;
610
611 if ( m_pImpl->m_nPos )
612 {
613 m_pImpl->m_xDataSupplier->validate();
614 return true;
615 }
616
617 m_pImpl->m_xDataSupplier->validate();
618 return false;
619}
620
621
622// virtual
624{
625 std::unique_lock aGuard( m_pImpl->m_aMutex );
626 if ( m_pImpl->m_bAfterLast || ( m_pImpl->m_nPos == 0 ) )
627 return;
628
629 m_pImpl->m_xDataSupplier->releasePropertyValues( m_pImpl->m_nPos );
630 m_pImpl->m_xDataSupplier->validate();
631}
632
633
634// virtual
636{
637 m_pImpl->m_xDataSupplier->validate();
638 return false;
639}
640
641
642// virtual
644{
645 m_pImpl->m_xDataSupplier->validate();
646 return false;
647}
648
649
650// virtual
652{
653 m_pImpl->m_xDataSupplier->validate();
654 return false;
655}
656
657
658// virtual
659uno::Reference< uno::XInterface > SAL_CALL ResultSet::getStatement()
660{
661/*
662 returns the Statement that produced this ResultSet object. If the
663 result set was generated some other way, ... this method returns null.
664*/
665 m_pImpl->m_xDataSupplier->validate();
666 return uno::Reference< uno::XInterface >();
667}
668
669
670// XRow methods.
671
672
673// virtual
675{
676 // This method can not be implemented correctly!!! Imagine different
677 // threads doing a getXYZ - wasNull calling sequence on the same
678 // implementation object...
679
680 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
681 {
682 uno::Reference< sdbc::XRow > xValues
683 = m_pImpl->m_xDataSupplier->queryPropertyValues(
684 m_pImpl->m_nPos - 1 );
685 if ( xValues.is() )
686 {
687 m_pImpl->m_xDataSupplier->validate();
688 return xValues->wasNull();
689 }
690 }
691
692 m_pImpl->m_xDataSupplier->validate();
693 return m_pImpl->m_bWasNull;
694}
695
696
697// virtual
698OUString SAL_CALL ResultSet::getString( sal_Int32 columnIndex )
699{
700 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
701 {
702 uno::Reference< sdbc::XRow > xValues
703 = m_pImpl->m_xDataSupplier->queryPropertyValues(
704 m_pImpl->m_nPos - 1 );
705 if ( xValues.is() )
706 {
707 m_pImpl->m_bWasNull = false;
708 m_pImpl->m_xDataSupplier->validate();
709 return xValues->getString( columnIndex );
710 }
711 }
712
713 m_pImpl->m_bWasNull = true;
714 m_pImpl->m_xDataSupplier->validate();
715 return OUString();
716}
717
718
719// virtual
720sal_Bool SAL_CALL ResultSet::getBoolean( sal_Int32 columnIndex )
721{
722 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
723 {
724 uno::Reference< sdbc::XRow > xValues
725 = m_pImpl->m_xDataSupplier->queryPropertyValues(
726 m_pImpl->m_nPos - 1 );
727 if ( xValues.is() )
728 {
729 m_pImpl->m_bWasNull = false;
730 m_pImpl->m_xDataSupplier->validate();
731 return xValues->getBoolean( columnIndex );
732 }
733 }
734
735 m_pImpl->m_bWasNull = true;
736 m_pImpl->m_xDataSupplier->validate();
737 return false;
738}
739
740
741// virtual
742sal_Int8 SAL_CALL ResultSet::getByte( sal_Int32 columnIndex )
743{
744 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
745 {
746 uno::Reference< sdbc::XRow > xValues
747 = m_pImpl->m_xDataSupplier->queryPropertyValues(
748 m_pImpl->m_nPos - 1 );
749 if ( xValues.is() )
750 {
751 m_pImpl->m_bWasNull = false;
752 m_pImpl->m_xDataSupplier->validate();
753 return xValues->getByte( columnIndex );
754 }
755 }
756
757 m_pImpl->m_bWasNull = true;
758 m_pImpl->m_xDataSupplier->validate();
759 return 0;
760}
761
762
763// virtual
764sal_Int16 SAL_CALL ResultSet::getShort( sal_Int32 columnIndex )
765{
766 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
767 {
768 uno::Reference< sdbc::XRow > xValues
769 = m_pImpl->m_xDataSupplier->queryPropertyValues(
770 m_pImpl->m_nPos - 1 );
771 if ( xValues.is() )
772 {
773 m_pImpl->m_bWasNull = false;
774 m_pImpl->m_xDataSupplier->validate();
775 return xValues->getShort( columnIndex );
776 }
777 }
778
779 m_pImpl->m_bWasNull = true;
780 m_pImpl->m_xDataSupplier->validate();
781 return 0;
782}
783
784
785// virtual
786sal_Int32 SAL_CALL ResultSet::getInt( sal_Int32 columnIndex )
787{
788 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
789 {
790 uno::Reference< sdbc::XRow > xValues
791 = m_pImpl->m_xDataSupplier->queryPropertyValues(
792 m_pImpl->m_nPos - 1 );
793 if ( xValues.is() )
794 {
795 m_pImpl->m_bWasNull = false;
796 m_pImpl->m_xDataSupplier->validate();
797 return xValues->getInt( columnIndex );
798 }
799 }
800
801 m_pImpl->m_bWasNull = true;
802 m_pImpl->m_xDataSupplier->validate();
803 return 0;
804}
805
806
807// virtual
808sal_Int64 SAL_CALL ResultSet::getLong( sal_Int32 columnIndex )
809{
810 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
811 {
812 uno::Reference< sdbc::XRow > xValues
813 = m_pImpl->m_xDataSupplier->queryPropertyValues(
814 m_pImpl->m_nPos - 1 );
815 if ( xValues.is() )
816 {
817 m_pImpl->m_bWasNull = false;
818 m_pImpl->m_xDataSupplier->validate();
819 return xValues->getLong( columnIndex );
820 }
821 }
822
823 m_pImpl->m_bWasNull = true;
824 m_pImpl->m_xDataSupplier->validate();
825 return 0;
826}
827
828
829// virtual
830float SAL_CALL ResultSet::getFloat( sal_Int32 columnIndex )
831{
832 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
833 {
834 uno::Reference< sdbc::XRow > xValues
835 = m_pImpl->m_xDataSupplier->queryPropertyValues(
836 m_pImpl->m_nPos - 1 );
837 if ( xValues.is() )
838 {
839 m_pImpl->m_bWasNull = false;
840 m_pImpl->m_xDataSupplier->validate();
841 return xValues->getFloat( columnIndex );
842 }
843 }
844
845 m_pImpl->m_bWasNull = true;
846 m_pImpl->m_xDataSupplier->validate();
847 return 0;
848}
849
850
851// virtual
852double SAL_CALL ResultSet::getDouble( sal_Int32 columnIndex )
853{
854 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
855 {
856 uno::Reference< sdbc::XRow > xValues
857 = m_pImpl->m_xDataSupplier->queryPropertyValues(
858 m_pImpl->m_nPos - 1 );
859 if ( xValues.is() )
860 {
861 m_pImpl->m_bWasNull = false;
862 m_pImpl->m_xDataSupplier->validate();
863 return xValues->getDouble( columnIndex );
864 }
865 }
866
867 m_pImpl->m_bWasNull = true;
868 m_pImpl->m_xDataSupplier->validate();
869 return 0;
870}
871
872
873// virtual
874uno::Sequence< sal_Int8 > SAL_CALL
875ResultSet::getBytes( sal_Int32 columnIndex )
876{
877 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
878 {
879 uno::Reference< sdbc::XRow > xValues
880 = m_pImpl->m_xDataSupplier->queryPropertyValues(
881 m_pImpl->m_nPos - 1 );
882 if ( xValues.is() )
883 {
884 m_pImpl->m_bWasNull = false;
885 m_pImpl->m_xDataSupplier->validate();
886 return xValues->getBytes( columnIndex );
887 }
888 }
889
890 m_pImpl->m_bWasNull = true;
891 m_pImpl->m_xDataSupplier->validate();
892 return uno::Sequence< sal_Int8 >();
893}
894
895
896// virtual
897util::Date SAL_CALL ResultSet::getDate( sal_Int32 columnIndex )
898{
899 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
900 {
901 uno::Reference< sdbc::XRow > xValues
902 = m_pImpl->m_xDataSupplier->queryPropertyValues(
903 m_pImpl->m_nPos - 1 );
904 if ( xValues.is() )
905 {
906 m_pImpl->m_bWasNull = false;
907 m_pImpl->m_xDataSupplier->validate();
908 return xValues->getDate( columnIndex );
909 }
910 }
911
912 m_pImpl->m_bWasNull = true;
913 m_pImpl->m_xDataSupplier->validate();
914 return util::Date();
915}
916
917
918// virtual
919util::Time SAL_CALL ResultSet::getTime( sal_Int32 columnIndex )
920{
921 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
922 {
923 uno::Reference< sdbc::XRow > xValues
924 = m_pImpl->m_xDataSupplier->queryPropertyValues(
925 m_pImpl->m_nPos - 1 );
926 if ( xValues.is() )
927 {
928 m_pImpl->m_bWasNull = false;
929 m_pImpl->m_xDataSupplier->validate();
930 return xValues->getTime( columnIndex );
931 }
932 }
933
934 m_pImpl->m_bWasNull = true;
935 m_pImpl->m_xDataSupplier->validate();
936 return util::Time();
937}
938
939
940// virtual
941util::DateTime SAL_CALL
942ResultSet::getTimestamp( sal_Int32 columnIndex )
943{
944 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
945 {
946 uno::Reference< sdbc::XRow > xValues
947 = m_pImpl->m_xDataSupplier->queryPropertyValues(
948 m_pImpl->m_nPos - 1 );
949 if ( xValues.is() )
950 {
951 m_pImpl->m_bWasNull = false;
952 m_pImpl->m_xDataSupplier->validate();
953 return xValues->getTimestamp( columnIndex );
954 }
955 }
956
957 m_pImpl->m_bWasNull = true;
958 m_pImpl->m_xDataSupplier->validate();
959 return util::DateTime();
960}
961
962
963// virtual
964uno::Reference< io::XInputStream > SAL_CALL
965ResultSet::getBinaryStream( sal_Int32 columnIndex )
966{
967 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
968 {
969 uno::Reference< sdbc::XRow > xValues
970 = m_pImpl->m_xDataSupplier->queryPropertyValues(
971 m_pImpl->m_nPos - 1 );
972 if ( xValues.is() )
973 {
974 m_pImpl->m_bWasNull = false;
975 m_pImpl->m_xDataSupplier->validate();
976 return xValues->getBinaryStream( columnIndex );
977 }
978 }
979
980 m_pImpl->m_bWasNull = true;
981 m_pImpl->m_xDataSupplier->validate();
982 return uno::Reference< io::XInputStream >();
983}
984
985
986// virtual
987uno::Reference< io::XInputStream > SAL_CALL
988ResultSet::getCharacterStream( sal_Int32 columnIndex )
989{
990 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
991 {
992 uno::Reference< sdbc::XRow > xValues
993 = m_pImpl->m_xDataSupplier->queryPropertyValues(
994 m_pImpl->m_nPos - 1 );
995 if ( xValues.is() )
996 {
997 m_pImpl->m_bWasNull = false;
998 m_pImpl->m_xDataSupplier->validate();
999 return xValues->getCharacterStream( columnIndex );
1000 }
1001 }
1002
1003 m_pImpl->m_bWasNull = true;
1004 m_pImpl->m_xDataSupplier->validate();
1005 return uno::Reference< io::XInputStream >();
1006}
1007
1008
1009// virtual
1011 sal_Int32 columnIndex,
1012 const uno::Reference< container::XNameAccess >& typeMap )
1013{
1014 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1015 {
1016 uno::Reference< sdbc::XRow > xValues
1017 = m_pImpl->m_xDataSupplier->queryPropertyValues(
1018 m_pImpl->m_nPos - 1 );
1019 if ( xValues.is() )
1020 {
1021 m_pImpl->m_bWasNull = false;
1022 m_pImpl->m_xDataSupplier->validate();
1023 return xValues->getObject( columnIndex, typeMap );
1024 }
1025 }
1026
1027 m_pImpl->m_bWasNull = true;
1028 m_pImpl->m_xDataSupplier->validate();
1029 return uno::Any();
1030}
1031
1032
1033// virtual
1034uno::Reference< sdbc::XRef > SAL_CALL
1035ResultSet::getRef( sal_Int32 columnIndex )
1036{
1037 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1038 {
1039 uno::Reference< sdbc::XRow > xValues
1040 = m_pImpl->m_xDataSupplier->queryPropertyValues(
1041 m_pImpl->m_nPos - 1 );
1042 if ( xValues.is() )
1043 {
1044 m_pImpl->m_bWasNull = false;
1045 m_pImpl->m_xDataSupplier->validate();
1046 return xValues->getRef( columnIndex );
1047 }
1048 }
1049
1050 m_pImpl->m_bWasNull = true;
1051 m_pImpl->m_xDataSupplier->validate();
1052 return uno::Reference< sdbc::XRef >();
1053}
1054
1055
1056// virtual
1057uno::Reference< sdbc::XBlob > SAL_CALL
1058ResultSet::getBlob( sal_Int32 columnIndex )
1059{
1060 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1061 {
1062 uno::Reference< sdbc::XRow > xValues
1063 = m_pImpl->m_xDataSupplier->queryPropertyValues(
1064 m_pImpl->m_nPos - 1 );
1065 if ( xValues.is() )
1066 {
1067 m_pImpl->m_bWasNull = false;
1068 m_pImpl->m_xDataSupplier->validate();
1069 return xValues->getBlob( columnIndex );
1070 }
1071 }
1072
1073 m_pImpl->m_bWasNull = true;
1074 m_pImpl->m_xDataSupplier->validate();
1075 return uno::Reference< sdbc::XBlob >();
1076}
1077
1078
1079// virtual
1080uno::Reference< sdbc::XClob > SAL_CALL
1081ResultSet::getClob( sal_Int32 columnIndex )
1082{
1083 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1084 {
1085 uno::Reference< sdbc::XRow > xValues
1086 = m_pImpl->m_xDataSupplier->queryPropertyValues(
1087 m_pImpl->m_nPos - 1 );
1088 if ( xValues.is() )
1089 {
1090 m_pImpl->m_bWasNull = false;
1091 m_pImpl->m_xDataSupplier->validate();
1092 return xValues->getClob( columnIndex );
1093 }
1094 }
1095
1096 m_pImpl->m_bWasNull = true;
1097 m_pImpl->m_xDataSupplier->validate();
1098 return uno::Reference< sdbc::XClob >();
1099}
1100
1101
1102// virtual
1103uno::Reference< sdbc::XArray > SAL_CALL
1104ResultSet::getArray( sal_Int32 columnIndex )
1105{
1106 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1107 {
1108 uno::Reference< sdbc::XRow > xValues
1109 = m_pImpl->m_xDataSupplier->queryPropertyValues(
1110 m_pImpl->m_nPos - 1 );
1111 if ( xValues.is() )
1112 {
1113 m_pImpl->m_bWasNull = false;
1114 m_pImpl->m_xDataSupplier->validate();
1115 return xValues->getArray( columnIndex );
1116 }
1117 }
1118
1119 m_pImpl->m_bWasNull = true;
1120 m_pImpl->m_xDataSupplier->validate();
1121 return uno::Reference< sdbc::XArray >();
1122}
1123
1124
1125// XCloseable methods.
1126
1127
1128// virtual
1129void SAL_CALL ResultSet::close()
1130{
1131 m_pImpl->m_xDataSupplier->close();
1132 m_pImpl->m_xDataSupplier->validate();
1133}
1134
1135
1136// XContentAccess methods.
1137
1138
1139// virtual
1141{
1142 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1143 return m_pImpl->m_xDataSupplier->queryContentIdentifierString(
1144 m_pImpl->m_nPos - 1 );
1145
1146 return OUString();
1147}
1148
1149
1150// virtual
1151uno::Reference< css::ucb::XContentIdentifier > SAL_CALL
1153{
1154 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1155 return m_pImpl->m_xDataSupplier->queryContentIdentifier(
1156 m_pImpl->m_nPos - 1 );
1157
1158 return uno::Reference< css::ucb::XContentIdentifier >();
1159}
1160
1161
1162// virtual
1163uno::Reference< css::ucb::XContent > SAL_CALL
1165{
1166 if ( m_pImpl->m_nPos && !m_pImpl->m_bAfterLast )
1167 return m_pImpl->m_xDataSupplier->queryContent( m_pImpl->m_nPos - 1 );
1168
1169 return uno::Reference< css::ucb::XContent >();
1170}
1171
1172
1173// XPropertySet methods.
1174
1175
1176// virtual
1177uno::Reference< beans::XPropertySetInfo > SAL_CALL
1179{
1180 std::unique_lock aGuard( m_pImpl->m_aMutex );
1181
1182 if ( !m_pImpl->m_xPropSetInfo.is() )
1183 m_pImpl->m_xPropSetInfo
1186 return m_pImpl->m_xPropSetInfo;
1187}
1188
1189
1190// virtual
1191void SAL_CALL ResultSet::setPropertyValue( const OUString& aPropertyName,
1192 const uno::Any& )
1193{
1194 if ( aPropertyName == "RowCount" )
1195 {
1196 // property is read-only.
1197 throw lang::IllegalArgumentException();
1198 }
1199 else if ( aPropertyName == "IsRowCountFinal" )
1200 {
1201 // property is read-only.
1202 throw lang::IllegalArgumentException();
1203 }
1204 else
1205 {
1206 throw beans::UnknownPropertyException(aPropertyName);
1207 }
1208}
1209
1210
1211// virtual
1213 const OUString& PropertyName )
1214{
1215 uno::Any aValue;
1216
1217 if ( PropertyName == "RowCount" )
1218 {
1219 aValue <<= m_pImpl->m_xDataSupplier->currentCount();
1220 }
1221 else if ( PropertyName == "IsRowCountFinal" )
1222 {
1223 aValue <<= m_pImpl->m_xDataSupplier->isCountFinal();
1224 }
1225 else
1226 {
1227 throw beans::UnknownPropertyException(PropertyName);
1228 }
1229
1230 return aValue;
1231}
1232
1233
1234// virtual
1236 const OUString& aPropertyName,
1237 const uno::Reference< beans::XPropertyChangeListener >& xListener )
1238{
1239 // Note: An empty property name means a listener for "all" properties.
1240
1241 std::unique_lock aGuard( m_pImpl->m_aMutex );
1242
1243 if ( !aPropertyName.isEmpty() &&
1244 aPropertyName != "RowCount" &&
1245 aPropertyName != "IsRowCountFinal" )
1246 throw beans::UnknownPropertyException(aPropertyName);
1247
1248 if ( !m_pImpl->m_pPropertyChangeListeners )
1249 m_pImpl->m_pPropertyChangeListeners.reset(
1251
1252 m_pImpl->m_pPropertyChangeListeners->addInterface(aGuard,
1253 aPropertyName, xListener );
1254}
1255
1256
1257// virtual
1259 const OUString& aPropertyName,
1260 const uno::Reference< beans::XPropertyChangeListener >& xListener )
1261{
1262 std::unique_lock aGuard( m_pImpl->m_aMutex );
1263
1264 if ( !aPropertyName.isEmpty() &&
1265 aPropertyName != "RowCount" &&
1266 aPropertyName != "IsRowCountFinal" )
1267 throw beans::UnknownPropertyException(aPropertyName);
1268
1269 if ( m_pImpl->m_pPropertyChangeListeners )
1270 m_pImpl->m_pPropertyChangeListeners->removeInterface(aGuard,
1271 aPropertyName, xListener );
1272
1273}
1274
1275
1276// virtual
1278 const OUString&,
1279 const uno::Reference< beans::XVetoableChangeListener >& )
1280{
1281 // No constrained props, at the moment.
1282}
1283
1284
1285// virtual
1287 const OUString&,
1288 const uno::Reference< beans::XVetoableChangeListener >& )
1289{
1290 // No constrained props, at the moment.
1291}
1292
1293
1294// Non-interface methods.
1295
1296
1297void ResultSet::propertyChanged( const beans::PropertyChangeEvent& rEvt ) const
1298{
1299 std::unique_lock aGuard( m_pImpl->m_aMutex );
1300
1301 if ( !m_pImpl->m_pPropertyChangeListeners )
1302 return;
1303
1304 // Notify listeners interested especially in the changed property.
1306 = m_pImpl->m_pPropertyChangeListeners->getContainer(aGuard,
1307 rEvt.PropertyName );
1308 if ( pPropsContainer )
1309 {
1310 pPropsContainer->notifyEach(aGuard, &beans::XPropertyChangeListener::propertyChange, rEvt);
1311 }
1312
1313 // Notify listeners interested in all properties.
1314 pPropsContainer
1315 = m_pImpl->m_pPropertyChangeListeners->getContainer( aGuard, OUString() );
1316 if ( pPropsContainer )
1317 {
1318 pPropsContainer->notifyEach( aGuard, &beans::XPropertyChangeListener::propertyChange, rEvt);
1319 }
1320}
1321
1322
1323void ResultSet::rowCountChanged( sal_uInt32 nOld, sal_uInt32 nNew )
1324{
1325 OSL_ENSURE( nOld < nNew, "ResultSet::rowCountChanged - nOld >= nNew!" );
1326
1327 if ( !m_pImpl->m_pPropertyChangeListeners )
1328 return;
1329
1330 propertyChanged(
1331 beans::PropertyChangeEvent(
1332 getXWeak(),
1333 "RowCount",
1334 false,
1335 1001,
1336 uno::Any( nOld ), // old value
1337 uno::Any( nNew ) ) ); // new value
1338}
1339
1340
1341void ResultSet::rowCountFinal()
1342{
1343 if ( !m_pImpl->m_pPropertyChangeListeners )
1344 return;
1345
1346 propertyChanged(
1347 beans::PropertyChangeEvent(
1348 getXWeak(),
1349 "IsRowCountFinal",
1350 false,
1351 1000,
1352 uno:: Any( false ), // old value
1353 uno::Any( true ) ) ); // new value
1354}
1355
1356
1357const uno::Sequence< beans::Property >& ResultSet::getProperties() const
1358{
1359 return m_pImpl->m_aProperties;
1360}
1361
1362
1363const uno::Reference< css::ucb::XCommandEnvironment >&
1364ResultSet::getEnvironment() const
1365{
1366 return m_pImpl->m_xEnv;
1367}
1368
1369} // namespace ucbhelper
1370
1371namespace ucbhelper_impl {
1372
1373
1374// PropertySetInfo Implementation.
1375
1376
1377PropertySetInfo::PropertySetInfo(
1378 const PropertyInfo* pProps,
1379 sal_Int32 nProps )
1380 : m_aProps( nProps )
1381{
1382
1383 if ( !nProps )
1384 return;
1385
1386 const PropertyInfo* pEntry = pProps;
1387 beans::Property* pProperties = m_aProps.getArray();
1388
1389 for ( sal_Int32 n = 0; n < nProps; ++n )
1390 {
1391 beans::Property& rProp = pProperties[ n ];
1392
1393 rProp.Name = OUString::createFromAscii( pEntry->pName );
1394 rProp.Handle = pEntry->nHandle;
1395 rProp.Type = pEntry->pGetCppuType();
1396 rProp.Attributes = pEntry->nAttributes;
1397
1398 pEntry++;
1399 }
1400}
1401
1402
1403
1404// XInterface methods.
1405void SAL_CALL PropertySetInfo::acquire()
1406 noexcept
1407{
1408 OWeakObject::acquire();
1409}
1410
1411void SAL_CALL PropertySetInfo::release()
1412 noexcept
1413{
1414 OWeakObject::release();
1415}
1416
1417css::uno::Any SAL_CALL PropertySetInfo::queryInterface(
1418 const css::uno::Type & rType )
1419{
1420 css::uno::Any aRet = cppu::queryInterface( rType,
1421 static_cast< lang::XTypeProvider* >(this),
1422 static_cast< beans::XPropertySetInfo* >(this)
1423 );
1424 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
1425}
1426
1427// XTypeProvider methods.
1428
1429
1430XTYPEPROVIDER_IMPL_2( PropertySetInfo,
1431 lang::XTypeProvider,
1432 beans::XPropertySetInfo );
1433
1434
1435// XPropertySetInfo methods.
1436
1437
1438// virtual
1439uno::Sequence< beans::Property > SAL_CALL PropertySetInfo::getProperties()
1440{
1441 return m_aProps;
1442}
1443
1444
1445// virtual
1446beans::Property SAL_CALL PropertySetInfo::getPropertyByName(
1447 const OUString& aName )
1448{
1449 beans::Property aProp;
1450 if ( queryProperty( aName, aProp ) )
1451 return aProp;
1452
1453 throw beans::UnknownPropertyException(aName);
1454}
1455
1456
1457// virtual
1458sal_Bool SAL_CALL PropertySetInfo::hasPropertyByName(
1459 const OUString& Name )
1460{
1461 beans::Property aProp;
1462 return queryProperty( Name, aProp );
1463}
1464
1465
1466bool PropertySetInfo::queryProperty(
1467 std::u16string_view aName, beans::Property& rProp ) const
1468{
1469 sal_Int32 nCount = m_aProps.getLength();
1470 const beans::Property* pProps = m_aProps.getConstArray();
1471 for ( sal_Int32 n = 0; n < nCount; ++n )
1472 {
1473 const beans::Property& rCurr = pProps[ n ];
1474 if ( rCurr.Name == aName )
1475 {
1476 rProp = rCurr;
1477 return true;
1478 }
1479 }
1480
1481 return false;
1482}
1483
1484} // namespace ucbhelper_impl
1485
1486/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
Reference< XComponentContext > m_xContext
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
css::uno::Type const & get()
This class provides a propertyset info ( the complete implementation of the interface XPropertySetInf...
Definition: contentinfo.hxx:47
This is an implementation of the interface XResultSetMetaData.
ResultSet(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Sequence< css::beans::Property > &rProperties, const rtl::Reference< ResultSetDataSupplier > &rDataSupplier)
Construction.
virtual void SAL_CALL dispose() override
Definition: resultset.cxx:230
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: resultset.cxx:1212
virtual sal_Bool SAL_CALL absolute(sal_Int32 row) override
Definition: resultset.cxx:453
virtual sal_Bool SAL_CALL wasNull() override
Definition: resultset.cxx:674
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: resultset.cxx:1286
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getStatement() override
Definition: resultset.cxx:659
std::unique_ptr< ResultSet_Impl > m_pImpl
Definition: resultset.hxx:70
void rowCountChanged(sal_uInt32 nOld, sal_uInt32 nNew)
This method should be called by the data supplier for the result set to indicate that there were new ...
Definition: resultset.cxx:1323
virtual sal_Bool SAL_CALL next() override
Definition: resultset.cxx:292
virtual sal_Int32 SAL_CALL getRow() override
Definition: resultset.cxx:439
virtual void SAL_CALL beforeFirst() override
Definition: resultset.cxx:384
virtual css::uno::Reference< css::sdbc::XBlob > SAL_CALL getBlob(sal_Int32 columnIndex) override
Definition: resultset.cxx:1058
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: resultset.cxx:263
virtual css::util::DateTime SAL_CALL getTimestamp(sal_Int32 columnIndex) override
Definition: resultset.cxx:942
virtual sal_Bool SAL_CALL relative(sal_Int32 rows) override
Definition: resultset.cxx:525
virtual OUString SAL_CALL getImplementationName() override
Definition: resultset.cxx:210
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: resultset.cxx:215
virtual OUString SAL_CALL queryContentIdentifierString() override
Definition: resultset.cxx:1140
virtual sal_Bool SAL_CALL last() override
Definition: resultset.cxx:421
virtual css::uno::Any SAL_CALL getObject(sal_Int32 columnIndex, const css::uno::Reference< css::container::XNameAccess > &typeMap) override
Definition: resultset.cxx:1010
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getBytes(sal_Int32 columnIndex) override
Definition: resultset.cxx:875
virtual float SAL_CALL getFloat(sal_Int32 columnIndex) override
Definition: resultset.cxx:830
virtual sal_Bool SAL_CALL isLast() override
Definition: resultset.cxx:363
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: resultset.cxx:1258
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getCharacterStream(sal_Int32 columnIndex) override
Definition: resultset.cxx:988
virtual ~ResultSet() override
Definition: resultset.cxx:203
virtual css::uno::Reference< css::io::XInputStream > SAL_CALL getBinaryStream(sal_Int32 columnIndex) override
Definition: resultset.cxx:965
virtual css::util::Date SAL_CALL getDate(sal_Int32 columnIndex) override
Definition: resultset.cxx:897
virtual OUString SAL_CALL getString(sal_Int32 columnIndex) override
Definition: resultset.cxx:698
virtual sal_Int16 SAL_CALL getShort(sal_Int32 columnIndex) override
Definition: resultset.cxx:764
virtual void SAL_CALL close() override
Definition: resultset.cxx:1129
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: resultset.cxx:1235
virtual sal_Bool SAL_CALL rowUpdated() override
Definition: resultset.cxx:635
virtual void SAL_CALL afterLast() override
Definition: resultset.cxx:394
void propertyChanged(const css::beans::PropertyChangeEvent &rEvt) const
This method propagates property value changes to all registered listeners.
Definition: resultset.cxx:1297
virtual sal_Bool SAL_CALL rowInserted() override
Definition: resultset.cxx:643
virtual css::util::Time SAL_CALL getTime(sal_Int32 columnIndex) override
Definition: resultset.cxx:919
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: resultset.cxx:1277
virtual void SAL_CALL refreshRow() override
Definition: resultset.cxx:623
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: resultset.cxx:220
virtual css::uno::Reference< css::sdbc::XClob > SAL_CALL getClob(sal_Int32 columnIndex) override
Definition: resultset.cxx:1081
virtual sal_Bool SAL_CALL rowDeleted() override
Definition: resultset.cxx:651
virtual sal_Bool SAL_CALL previous() override
Definition: resultset.cxx:594
virtual sal_Bool SAL_CALL first() override
Definition: resultset.cxx:403
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: resultset.cxx:1178
virtual sal_Int32 SAL_CALL getInt(sal_Int32 columnIndex) override
Definition: resultset.cxx:786
virtual css::uno::Reference< css::ucb::XContentIdentifier > SAL_CALL queryContentIdentifier() override
Definition: resultset.cxx:1152
virtual sal_Int8 SAL_CALL getByte(sal_Int32 columnIndex) override
Definition: resultset.cxx:742
virtual css::uno::Reference< css::sdbc::XResultSetMetaData > SAL_CALL getMetaData() override
Definition: resultset.cxx:276
virtual sal_Bool SAL_CALL isBeforeFirst() override
Definition: resultset.cxx:320
virtual css::uno::Reference< css::sdbc::XRef > SAL_CALL getRef(sal_Int32 columnIndex) override
Definition: resultset.cxx:1035
virtual sal_Int64 SAL_CALL getLong(sal_Int32 columnIndex) override
Definition: resultset.cxx:808
virtual double SAL_CALL getDouble(sal_Int32 columnIndex) override
Definition: resultset.cxx:852
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent() override
Definition: resultset.cxx:1164
virtual sal_Bool SAL_CALL getBoolean(sal_Int32 columnIndex) override
Definition: resultset.cxx:720
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: resultset.cxx:253
virtual css::uno::Reference< css::sdbc::XArray > SAL_CALL getArray(sal_Int32 columnIndex) override
Definition: resultset.cxx:1104
virtual sal_Bool SAL_CALL isAfterLast() override
Definition: resultset.cxx:341
virtual sal_Bool SAL_CALL isFirst() override
Definition: resultset.cxx:349
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: resultset.cxx:1191
sal_uInt32 m_nPos
int nCount
Type
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Reference
static const uno::Type & sal_Int32_getCppuType()
Definition: resultset.cxx:51
cppu::OMultiTypeInterfaceContainerHelperVar< OUString > PropertyChangeListeners
const PropertyInfo aPropertyTable[]
Definition: resultset.cxx:61
static const uno::Type & sal_Bool_getCppuType()
Definition: resultset.cxx:56
constexpr OUStringLiteral RESULTSET_SERVICE_NAME
Definition: resultset.hxx:44
sal_Int32 nHandle
Definition: resultset.cxx:44
const char * pName
Definition: resultset.cxx:43
uno::Sequence< beans::Property > m_aProps
Definition: resultset.cxx:91
#define RESULTSET_PROPERTY_COUNT
Definition: resultset.cxx:80
sal_Int16 nAttributes
Definition: resultset.cxx:45
std::unique_ptr< PropertyChangeListeners > m_pPropertyChangeListeners
Definition: resultset.cxx:146
uno::Reference< beans::XPropertySetInfo > m_xPropSetInfo
Definition: resultset.cxx:140
uno::Reference< sdbc::XResultSetMetaData > m_xMetaData
Definition: resultset.cxx:141
uno::Reference< css::ucb::XCommandEnvironment > m_xEnv
Definition: resultset.cxx:139
uno::Reference< uno::XComponentContext > m_xContext
Definition: resultset.cxx:138
comphelper::OInterfaceContainerHelper4< lang::XEventListener > m_aDisposeEventListeners
Definition: resultset.cxx:145
uno::Sequence< beans::Property > m_aProperties
Definition: resultset.cxx:142
rtl::Reference< ResultSetDataSupplier > m_xDataSupplier
Definition: resultset.cxx:143
unsigned char sal_Bool
signed char sal_Int8