LibreOffice Module cppuhelper (master)  1
propshlp.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 
21 #include <osl/diagnose.h>
22 #include <cppuhelper/implbase.hxx>
24 #include <cppuhelper/propshlp.hxx>
25 #include <cppuhelper/exc_hlp.hxx>
26 #include <com/sun/star/beans/PropertyAttribute.hpp>
27 #include <com/sun/star/lang/DisposedException.hpp>
28 #include <memory>
29 #include <sal/log.hxx>
30 
31 using namespace osl;
32 using namespace com::sun::star::uno;
33 using namespace com::sun::star::beans;
34 using namespace com::sun::star::lang;
35 using namespace cppu;
36 
37 namespace cppu {
38 
39 IPropertyArrayHelper::~IPropertyArrayHelper()
40 {
41 }
42 
43 static const css::uno::Type & getPropertyTypeIdentifier( )
44 {
46 }
47 static const css::uno::Type & getPropertiesTypeIdentifier()
48 {
50 }
51 static const css::uno::Type & getVetoableTypeIdentifier()
52 {
54 }
55 
56 extern "C" {
57 
58 static int compare_OUString_Property_Impl( const void *arg1, const void *arg2 )
60 {
61  return static_cast<OUString const *>(arg1)->compareTo( static_cast<Property const *>(arg2)->Name );
62 }
63 
64 }
65 
70 namespace {
71 
72 class OPropertySetHelperInfo_Impl
73  : public WeakImplHelper< css::beans::XPropertySetInfo >
74 {
76 
77 public:
78  explicit OPropertySetHelperInfo_Impl( IPropertyArrayHelper & rHelper_ );
79 
80  // XPropertySetInfo-methods
81  virtual Sequence< Property > SAL_CALL getProperties() override;
82  virtual Property SAL_CALL getPropertyByName(const OUString& PropertyName) override;
83  virtual sal_Bool SAL_CALL hasPropertyByName(const OUString& PropertyName) override;
84 };
85 
86 }
87 
91 OPropertySetHelperInfo_Impl::OPropertySetHelperInfo_Impl(
92  IPropertyArrayHelper & rHelper_ )
93  :aInfos( rHelper_.getProperties() )
94 {
95 }
96 
100 Sequence< Property > OPropertySetHelperInfo_Impl::getProperties()
101 {
102  return aInfos;
103 }
104 
108 Property OPropertySetHelperInfo_Impl::getPropertyByName( const OUString & PropertyName )
109 {
110  Property * pR;
111  pR = static_cast<Property *>(bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(),
112  sizeof( Property ),
114  if( !pR ) {
115  throw UnknownPropertyException(PropertyName);
116  }
117 
118  return *pR;
119 }
120 
124 sal_Bool OPropertySetHelperInfo_Impl::hasPropertyByName( const OUString & PropertyName )
125 {
126  Property * pR;
127  pR = static_cast<Property *>(bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(),
128  sizeof( Property ),
130  return pR != nullptr;
131 }
132 
133 
134 
136 
137 public:
138  Impl( bool i_bIgnoreRuntimeExceptionsWhileFiring,
139  IEventNotificationHook *i_pFireEvents
140  )
141  :m_bIgnoreRuntimeExceptionsWhileFiring( i_bIgnoreRuntimeExceptionsWhileFiring )
142  ,m_bFireEvents(true)
143  ,m_pFireEvents( i_pFireEvents )
144  {
145  }
146 
150 
151  std::vector< sal_Int32 > m_handles;
152  std::vector< Any > m_newValues;
153  std::vector< Any > m_oldValues;
154 };
155 
156 
157 
158 OPropertySetHelper::OPropertySetHelper(
159  OBroadcastHelper & rBHelper_ )
160  : rBHelper( rBHelper_ ),
161  aBoundLC( rBHelper_.rMutex ),
162  aVetoableLC( rBHelper_.rMutex ),
163  m_pReserved( new Impl(false, nullptr) )
164 {
165 }
166 
168  OBroadcastHelper & rBHelper_, bool bIgnoreRuntimeExceptionsWhileFiring )
169  : rBHelper( rBHelper_ ),
170  aBoundLC( rBHelper_.rMutex ),
171  aVetoableLC( rBHelper_.rMutex ),
172  m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, nullptr ) )
173 {
174 }
175 
177  OBroadcastHelper & rBHelper_, IEventNotificationHook * i_pFireEvents,
178  bool bIgnoreRuntimeExceptionsWhileFiring)
179  : rBHelper( rBHelper_ ),
180  aBoundLC( rBHelper_.rMutex ),
181  aVetoableLC( rBHelper_.rMutex ),
182  m_pReserved(
183  new Impl( bIgnoreRuntimeExceptionsWhileFiring, i_pFireEvents) )
184 {
185 }
186 
188  OBroadcastHelper & irBHelper,
189  IEventNotificationHook *i_pFireEvents,
190  bool bIgnoreRuntimeExceptionsWhileFiring)
191  :OPropertySetHelper( irBHelper, i_pFireEvents, bIgnoreRuntimeExceptionsWhileFiring )
192 {
193 }
194 
199 {
200  delete m_pReserved;
201 }
203 {
204 }
205 
206 // XInterface
207 Any OPropertySetHelper::queryInterface( const css::uno::Type & rType )
208 {
210  rType,
211  static_cast< XPropertySet * >( this ),
212  static_cast< XMultiPropertySet * >( this ),
213  static_cast< XFastPropertySet * >( this ) );
214 }
215 
216 Any OPropertySetHelper2::queryInterface( const css::uno::Type & rType )
217 {
218  Any cnd(cppu::queryInterface(rType, static_cast< XPropertySetOption * >(this)));
219  if ( cnd.hasValue() )
220  return cnd;
222 }
223 
227 css::uno::Sequence< css::uno::Type > OPropertySetHelper::getTypes()
228 {
229  return {
233 }
234 
235 // ComponentHelper
237 {
238  // Create an event with this as sender
239  Reference < XPropertySet > rSource = this;
240  EventObject aEvt;
241  aEvt.Source = rSource;
242 
243  // inform all listeners to release this object
244  // The listener containers are automatically cleared
245  aBoundLC.disposeAndClear( aEvt );
247 }
248 
250  IPropertyArrayHelper & rProperties )
251 {
252  return new OPropertySetHelperInfo_Impl(rProperties);
253 }
254 
255 // XPropertySet
257  const OUString& rPropertyName, const Any& rValue )
258 {
259  // get the map table
261  // map the name to the handle
262  sal_Int32 nHandle = rPH.getHandleByName( rPropertyName );
263  // call the method of the XFastPropertySet interface
264  setFastPropertyValue( nHandle, rValue );
265 }
266 
267 // XPropertySet
269  const OUString& rPropertyName )
270 {
271  // get the map table
273  // map the name to the handle
274  sal_Int32 nHandle = rPH.getHandleByName( rPropertyName );
275  // call the method of the XFastPropertySet interface
276  return getFastPropertyValue( nHandle );
277 }
278 
279 // XPropertySet
281  const OUString& rPropertyName,
282  const Reference < XPropertyChangeListener > & rxListener )
283 {
284  MutexGuard aGuard( rBHelper.rMutex );
285  OSL_ENSURE( !rBHelper.bInDispose, "do not addPropertyChangeListener in the dispose call" );
286  OSL_ENSURE( !rBHelper.bDisposed, "object is disposed" );
288  return;
289 
290  // only add listeners if you are not disposed
291  // a listener with no name means all properties
292  if( !rPropertyName.isEmpty() )
293  {
294  // get the map table
296  // map the name to the handle
297  sal_Int32 nHandle = rPH.getHandleByName( rPropertyName );
298  if( nHandle == -1 ) {
299  // property not known throw exception
300  throw UnknownPropertyException(rPropertyName);
301  }
302 
303  sal_Int16 nAttributes;
304  rPH.fillPropertyMembersByHandle( nullptr, &nAttributes, nHandle );
305  if( !(nAttributes & css::beans::PropertyAttribute::BOUND) )
306  {
307  OSL_FAIL( "add listener to an unbound property" );
308  // silent ignore this
309  return;
310  }
311  // add the change listener to the helper container
312 
313  aBoundLC.addInterface( nHandle, rxListener );
314  }
315  else
316  // add the change listener to the helper container
317  rBHelper.aLC.addInterface(
319  rxListener
320  );
321 }
322 
323 
324 // XPropertySet
326  const OUString& rPropertyName,
327  const Reference < XPropertyChangeListener >& rxListener )
328 {
329  MutexGuard aGuard( rBHelper.rMutex );
330  OSL_ENSURE( !rBHelper.bDisposed, "object is disposed" );
331  // all listeners are automatically released in a dispose call
333  return;
334 
335  if( !rPropertyName.isEmpty() )
336  {
337  // get the map table
339  // map the name to the handle
340  sal_Int32 nHandle = rPH.getHandleByName( rPropertyName );
341  if( nHandle == -1 )
342  // property not known throw exception
343  throw UnknownPropertyException(rPropertyName);
344  aBoundLC.removeInterface( nHandle, rxListener );
345  }
346  else {
347  // remove the change listener to the helper container
348  rBHelper.aLC.removeInterface(
350  rxListener
351  );
352  }
353 }
354 
355 // XPropertySet
357  const OUString& rPropertyName,
358  const Reference< XVetoableChangeListener > & rxListener )
359 {
360  MutexGuard aGuard( rBHelper.rMutex );
361  OSL_ENSURE( !rBHelper.bInDispose, "do not addVetoableChangeListener in the dispose call" );
362  OSL_ENSURE( !rBHelper.bDisposed, "object is disposed" );
364  return;
365 
366  // only add listeners if you are not disposed
367  // a listener with no name means all properties
368  if( !rPropertyName.isEmpty() )
369  {
370  // get the map table
372  // map the name to the handle
373  sal_Int32 nHandle = rPH.getHandleByName( rPropertyName );
374  if( nHandle == -1 ) {
375  // property not known throw exception
376  throw UnknownPropertyException(rPropertyName);
377  }
378 
379  sal_Int16 nAttributes;
380  rPH.fillPropertyMembersByHandle( nullptr, &nAttributes, nHandle );
381  if( !(nAttributes & PropertyAttribute::CONSTRAINED) )
382  {
383  OSL_FAIL( "addVetoableChangeListener, and property is not constrained" );
384  // silent ignore this
385  return;
386  }
387  // add the vetoable listener to the helper container
388  aVetoableLC.addInterface( nHandle, rxListener );
389  }
390  else
391  // add the vetoable listener to the helper container
392  rBHelper.aLC.addInterface(
394  rxListener
395  );
396 }
397 
398 // XPropertySet
400  const OUString& rPropertyName,
401  const Reference < XVetoableChangeListener > & rxListener )
402 {
403  MutexGuard aGuard( rBHelper.rMutex );
404  OSL_ENSURE( !rBHelper.bDisposed, "object is disposed" );
405  // all listeners are automatically released in a dispose call
407  return;
408 
409  if( !rPropertyName.isEmpty() )
410  {
411  // get the map table
413  // map the name to the handle
414  sal_Int32 nHandle = rPH.getHandleByName( rPropertyName );
415  if( nHandle == -1 ) {
416  // property not known throw exception
417  throw UnknownPropertyException(rPropertyName);
418  }
419  // remove the vetoable listener to the helper container
420  aVetoableLC.removeInterface( nHandle, rxListener );
421  }
422  else
423  // add the vetoable listener to the helper container
424  rBHelper.aLC.removeInterface(
426  rxListener
427  );
428 }
429 
430 void OPropertySetHelper::setDependentFastPropertyValue( sal_Int32 i_handle, const css::uno::Any& i_value )
431 {
432  //OSL_PRECOND( rBHelper.rMutex.isAcquired(), "OPropertySetHelper::setDependentFastPropertyValue: to be called with a locked mutex only!" );
433  // there is no such thing as Mutex.isAcquired, sadly ...
434 
435  sal_Int16 nAttributes(0);
437  if ( !rInfo.fillPropertyMembersByHandle( nullptr, &nAttributes, i_handle ) )
438  // unknown property
439  throw UnknownPropertyException(OUString::number(i_handle));
440 
441  // no need to check for READONLY-ness of the property. The method is intended to be called internally, which
442  // implies it might be invoked for properties which are read-only to the instance's clients, but well allowed
443  // to change their value.
444 
445  Any aConverted, aOld;
446  bool bChanged = convertFastPropertyValue( aConverted, aOld, i_handle, i_value );
447  if ( !bChanged )
448  return;
449 
450  // don't fire vetoable events. This method is called with our mutex locked, so calling into listeners would not be
451  // a good idea. The caller is responsible for not invoking this for constrained properties.
452  OSL_ENSURE( ( nAttributes & PropertyAttribute::CONSTRAINED ) == 0,
453  "OPropertySetHelper::setDependentFastPropertyValue: not to be used for constrained properties!" );
454 
455  // actually set the new value
456  try
457  {
458  setFastPropertyValue_NoBroadcast( i_handle, aConverted );
459  }
460  catch (const UnknownPropertyException& ) { throw; /* allowed to leave */ }
461  catch (const PropertyVetoException& ) { throw; /* allowed to leave */ }
462  catch (const IllegalArgumentException& ) { throw; /* allowed to leave */ }
463  catch (const WrappedTargetException& ) { throw; /* allowed to leave */ }
464  catch (const RuntimeException& ) { throw; /* allowed to leave */ }
465  catch (const Exception& )
466  {
467  // not allowed to leave this method
468  WrappedTargetException aWrapped;
469  aWrapped.TargetException = ::cppu::getCaughtException();
470  aWrapped.Context = static_cast< XPropertySet* >( this );
471  throw aWrapped;
472  }
473 
474  // remember the handle/values, for the events to be fired later
475  m_pReserved->m_handles.push_back( i_handle );
476  m_pReserved->m_newValues.push_back( aConverted ); // TODO: setFastPropertyValue notifies the unconverted value here ...?
477  m_pReserved->m_oldValues.push_back( aOld );
478 }
479 
480 // XFastPropertySet
481 void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rValue )
482 {
483  OSL_ENSURE( !rBHelper.bInDispose, "do not setFastPropertyValue in the dispose call" );
484  OSL_ENSURE( !rBHelper.bDisposed, "object is disposed" );
485 
487  sal_Int16 nAttributes;
488  if( !rInfo.fillPropertyMembersByHandle( nullptr, &nAttributes, nHandle ) ) {
489  // unknown property
490  throw UnknownPropertyException(OUString::number(nHandle));
491  }
492  if( nAttributes & PropertyAttribute::READONLY )
493  throw PropertyVetoException();
494 
495  Any aConvertedVal;
496  Any aOldVal;
497 
498  // Will the property change?
499  bool bChanged;
500  {
501  MutexGuard aGuard( rBHelper.rMutex );
502  bChanged = convertFastPropertyValue( aConvertedVal, aOldVal, nHandle, rValue );
503  // release guard to fire events
504  }
505  if( !bChanged )
506  return;
507 
508  // Is it a constrained property?
509  if( nAttributes & PropertyAttribute::CONSTRAINED )
510  {
511  // In aValue is the converted rValue
512  // fire a constrained event
513  // second parameter NULL means constrained
514  fire( &nHandle, &rValue, &aOldVal, 1, true );
515  }
516 
517  {
518  MutexGuard aGuard( rBHelper.rMutex );
519  try
520  {
521  // set the property to the new value
522  setFastPropertyValue_NoBroadcast( nHandle, aConvertedVal );
523  }
524  catch (const css::beans::UnknownPropertyException& ) { throw; /* allowed to leave */ }
525  catch (const css::beans::PropertyVetoException& ) { throw; /* allowed to leave */ }
526  catch (const css::lang::IllegalArgumentException& ) { throw; /* allowed to leave */ }
527  catch (const css::lang::WrappedTargetException& ) { throw; /* allowed to leave */ }
528  catch (const css::uno::RuntimeException& ) { throw; /* allowed to leave */ }
529  catch (const css::uno::Exception& e )
530  {
531  // not allowed to leave this method
532  css::lang::WrappedTargetException aWrap;
533  aWrap.Context = static_cast< css::beans::XPropertySet* >( this );
534  aWrap.TargetException <<= e;
535 
536  throw aWrap;
537  }
538 
539  // release guard to fire events
540  }
541  // file a change event, if the value changed
542  impl_fireAll( &nHandle, &rValue, &aOldVal, 1 );
543 }
544 
545 // XFastPropertySet
547 
548 {
550  if( !rInfo.fillPropertyMembersByHandle( nullptr, nullptr, nHandle ) )
551  // unknown property
552  throw UnknownPropertyException(OUString::number(nHandle));
553 
554  Any aRet;
555  MutexGuard aGuard( rBHelper.rMutex );
556  getFastPropertyValue( aRet, nHandle );
557  return aRet;
558 }
559 
560 
561 void OPropertySetHelper::impl_fireAll( sal_Int32* i_handles, const Any* i_newValues, const Any* i_oldValues, sal_Int32 i_count )
562 {
563  ClearableMutexGuard aGuard( rBHelper.rMutex );
564  if ( m_pReserved->m_handles.empty() )
565  {
566  aGuard.clear();
567  fire( i_handles, i_newValues, i_oldValues, i_count, false );
568  return;
569  }
570 
571  const size_t additionalEvents = m_pReserved->m_handles.size();
572  OSL_ENSURE( additionalEvents == m_pReserved->m_newValues.size()
573  && additionalEvents == m_pReserved->m_oldValues.size(),
574  "OPropertySetHelper::impl_fireAll: inconsistency!" );
575 
576  std::vector< sal_Int32 > allHandles( additionalEvents + i_count );
577  std::copy( m_pReserved->m_handles.begin(), m_pReserved->m_handles.end(), allHandles.begin() );
578  std::copy( i_handles, i_handles + i_count, allHandles.begin() + additionalEvents );
579 
580  std::vector< Any > allNewValues( additionalEvents + i_count );
581  std::copy( m_pReserved->m_newValues.begin(), m_pReserved->m_newValues.end(), allNewValues.begin() );
582  std::copy( i_newValues, i_newValues + i_count, allNewValues.begin() + additionalEvents );
583 
584  std::vector< Any > allOldValues( additionalEvents + i_count );
585  std::copy( m_pReserved->m_oldValues.begin(), m_pReserved->m_oldValues.end(), allOldValues.begin() );
586  std::copy( i_oldValues, i_oldValues + i_count, allOldValues.begin() + additionalEvents );
587 
588  m_pReserved->m_handles.clear();
589  m_pReserved->m_newValues.clear();
590  m_pReserved->m_oldValues.clear();
591 
592  aGuard.clear();
593  fire( allHandles.data(), allNewValues.data(), allOldValues.data(), additionalEvents + i_count, false );
594 }
595 
596 
598 (
599  sal_Int32 * pnHandles,
600  const Any * pNewValues,
601  const Any * pOldValues,
602  sal_Int32 nHandles, // This is the Count of the array
603  sal_Bool bVetoable
604 )
605 {
606  if (! m_pReserved->m_bFireEvents)
607  return;
608 
609  if (m_pReserved->m_pFireEvents) {
610  m_pReserved->m_pFireEvents->fireEvents(
611  pnHandles, nHandles, bVetoable,
612  m_pReserved->m_bIgnoreRuntimeExceptionsWhileFiring);
613  }
614 
615  // Only fire, if one or more properties changed
616  if( !nHandles )
617  return;
618 
619  // create the event sequence of all changed properties
620  Sequence< PropertyChangeEvent > aEvts( nHandles );
621  PropertyChangeEvent * pEvts = aEvts.getArray();
622  Reference < XInterface > xSource( static_cast<XPropertySet *>(this), UNO_QUERY );
623  sal_Int32 i;
624  sal_Int32 nChangesLen = 0;
625  // Loop over all changed properties to fill the event struct
626  for( i = 0; i < nHandles; i++ )
627  {
628  // Vetoable fire and constrained attribute set or
629  // Change fire and Changed and bound attribute set
630  IPropertyArrayHelper & rInfo = getInfoHelper();
631  sal_Int16 nAttributes;
632  OUString aPropName;
633  rInfo.fillPropertyMembersByHandle( &aPropName, &nAttributes, pnHandles[i] );
634 
635  if(
636  (bVetoable && (nAttributes & PropertyAttribute::CONSTRAINED)) ||
637  (!bVetoable && (nAttributes & PropertyAttribute::BOUND))
638  )
639  {
640  pEvts[nChangesLen].Source = xSource;
641  pEvts[nChangesLen].PropertyName = aPropName;
642  pEvts[nChangesLen].PropertyHandle = pnHandles[i];
643  pEvts[nChangesLen].OldValue = pOldValues[i];
644  pEvts[nChangesLen].NewValue = pNewValues[i];
645  nChangesLen++;
646  }
647  }
648 
649  bool bIgnoreRuntimeExceptionsWhileFiring =
650  m_pReserved->m_bIgnoreRuntimeExceptionsWhileFiring;
651 
652  // fire the events for all changed properties
653  for( i = 0; i < nChangesLen; i++ )
654  {
655  // get the listener container for the property name
657  if( bVetoable ) // fire change Events?
658  pLC = aVetoableLC.getContainer( pEvts[i].PropertyHandle );
659  else
660  pLC = aBoundLC.getContainer( pEvts[i].PropertyHandle );
661  if( pLC )
662  {
663  // Iterate over all listeners and send events
664  OInterfaceIteratorHelper aIt( *pLC);
665  while( aIt.hasMoreElements() )
666  {
667  XInterface * pL = aIt.next();
668  try
669  {
670  try
671  {
672  if( bVetoable ) // fire change Events?
673  {
674  static_cast<XVetoableChangeListener *>(pL)->vetoableChange(
675  pEvts[i] );
676  }
677  else
678  {
679  static_cast<XPropertyChangeListener *>(pL)->propertyChange(
680  pEvts[i] );
681  }
682  }
683  catch (DisposedException & exc)
684  {
685  OSL_ENSURE( exc.Context.is(),
686  "DisposedException without Context!" );
687  if (exc.Context == pL)
688  aIt.remove();
689  else
690  throw;
691  }
692  }
693  catch (RuntimeException & exc)
694  {
695  SAL_INFO("cppuhelper", "caught RuntimeException while firing listeners: " << exc);
696  if (! bIgnoreRuntimeExceptionsWhileFiring)
697  throw;
698  }
699  }
700  }
701  // broadcast to all listeners with "" property name
702  if( bVetoable ){
703  // fire change Events?
704  pLC = rBHelper.aLC.getContainer(
706  );
707  }
708  else {
709  pLC = rBHelper.aLC.getContainer(
711  );
712  }
713  if( pLC )
714  {
715  // Iterate over all listeners and send events.
716  OInterfaceIteratorHelper aIt( *pLC);
717  while( aIt.hasMoreElements() )
718  {
719  XInterface * pL = aIt.next();
720  try
721  {
722  try
723  {
724  if( bVetoable ) // fire change Events?
725  {
726  static_cast<XVetoableChangeListener *>(pL)->vetoableChange(
727  pEvts[i] );
728  }
729  else
730  {
731  static_cast<XPropertyChangeListener *>(pL)->propertyChange(
732  pEvts[i] );
733  }
734  }
735  catch (DisposedException & exc)
736  {
737  OSL_ENSURE( exc.Context.is(),
738  "DisposedException without Context!" );
739  if (exc.Context == pL)
740  aIt.remove();
741  else
742  throw;
743  }
744  }
745  catch (RuntimeException & exc)
746  {
747  SAL_INFO("cppuhelper", "caught RuntimeException while firing listeners: " << exc);
748  if (! bIgnoreRuntimeExceptionsWhileFiring)
749  throw;
750  }
751  }
752  }
753  }
754 
755  // reduce array to changed properties
756  aEvts.realloc( nChangesLen );
757 
758  if( bVetoable )
759  return;
760 
761  auto pCont = rBHelper.aLC.getContainer(getPropertiesTypeIdentifier());
762  if (!pCont)
763  return;
764 
765  // Here is a Bug, unbound properties are also fired
766  OInterfaceIteratorHelper aIt( *pCont );
767  while( aIt.hasMoreElements() )
768  {
769  XPropertiesChangeListener * pL =
770  static_cast<XPropertiesChangeListener *>(aIt.next());
771  try
772  {
773  try
774  {
775  // fire the whole event sequence to the
776  // XPropertiesChangeListener's
777  pL->propertiesChange( aEvts );
778  }
779  catch (DisposedException & exc)
780  {
781  OSL_ENSURE( exc.Context.is(),
782  "DisposedException without Context!" );
783  if (exc.Context == pL)
784  aIt.remove();
785  else
786  throw;
787  }
788  }
789  catch (RuntimeException & exc)
790  {
791  SAL_INFO("cppuhelper", "caught RuntimeException while firing listeners: " << exc);
792  if (! bIgnoreRuntimeExceptionsWhileFiring)
793  throw;
794  }
795  }
796 }
797 
798 // OPropertySetHelper
800  sal_Int32 nSeqLen,
801  sal_Int32 * pHandles,
802  const Any * pValues,
803  sal_Int32 nHitCount )
804 {
805  OSL_ENSURE( !rBHelper.bInDispose, "do not getFastPropertyValue in the dispose call" );
806  OSL_ENSURE( !rBHelper.bDisposed, "object is disposed" );
807 
808  // get the map table
810 
811  std::unique_ptr<Any[]> pConvertedValues(new Any[ nHitCount ]);
812  std::unique_ptr<Any[]> pOldValues(new Any[ nHitCount ]);
813  sal_Int32 n = 0;
814  sal_Int32 i;
815 
816  {
817  // must lock the mutex outside the loop. So all values are consistent.
818  MutexGuard aGuard( rBHelper.rMutex );
819  for( i = 0; i < nSeqLen; i++ )
820  {
821  if( pHandles[i] != -1 )
822  {
823  sal_Int16 nAttributes;
824  rPH.fillPropertyMembersByHandle( nullptr, &nAttributes, pHandles[i] );
825  if( nAttributes & PropertyAttribute::READONLY ) {
826  throw PropertyVetoException();
827  }
828  // Will the property change?
829  if( convertFastPropertyValue( pConvertedValues[ n ], pOldValues[n],
830  pHandles[i], pValues[i] ) )
831  {
832  // only increment if the property really change
833  pHandles[n] = pHandles[i];
834  n++;
835  }
836  }
837  }
838  // release guard to fire events
839  }
840 
841  // fire vetoable events
842  fire( pHandles, pConvertedValues.get(), pOldValues.get(), n, true );
843 
844  {
845  // must lock the mutex outside the loop.
846  MutexGuard aGuard( rBHelper.rMutex );
847  // Loop over all changed properties
848  for( i = 0; i < n; i++ )
849  {
850  // Will the property change?
851  setFastPropertyValue_NoBroadcast( pHandles[i], pConvertedValues[i] );
852  }
853  // release guard to fire events
854  }
855 
856  // fire change events
857  impl_fireAll( pHandles, pConvertedValues.get(), pOldValues.get(), n );
858 }
859 
860 // XMultiPropertySet
866  const Sequence<OUString>& rPropertyNames,
867  const Sequence<Any>& rValues )
868 {
869  sal_Int32 nSeqLen = rPropertyNames.getLength();
870  std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[ nSeqLen ]);
871  // get the map table
873  // fill the handle array
874  sal_Int32 nHitCount = rPH.fillHandles( pHandles.get(), rPropertyNames );
875  if( nHitCount != 0 )
876  setFastPropertyValues( nSeqLen, pHandles.get(), rValues.getConstArray(), nHitCount );
877 }
878 
879 // XMultiPropertySet
881 {
882  sal_Int32 nSeqLen = rPropertyNames.getLength();
883  std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[ nSeqLen ]);
884  Sequence< Any > aValues( nSeqLen );
885 
886  // get the map table
888  // fill the handle array
889  rPH.fillHandles( pHandles.get(), rPropertyNames );
890 
891  Any * pValues = aValues.getArray();
892 
893  MutexGuard aGuard( rBHelper.rMutex );
894  // fill the sequence with the values
895  for( sal_Int32 i = 0; i < nSeqLen; i++ )
896  getFastPropertyValue( pValues[i], pHandles[i] );
897 
898  return aValues;
899 }
900 
901 // XMultiPropertySet
903  const Sequence<OUString> & ,
904  const Reference < XPropertiesChangeListener > & rListener )
905 {
906  rBHelper.addListener( cppu::UnoType<decltype(rListener)>::get(), rListener );
907 }
908 
909 // XMultiPropertySet
911  const Reference < XPropertiesChangeListener > & rListener )
912 {
913  rBHelper.removeListener( cppu::UnoType<decltype(rListener)>::get(), rListener );
914 }
915 
916 // XMultiPropertySet
918  const Sequence<OUString>& rPropertyNames,
919  const Reference < XPropertiesChangeListener >& rListener )
920 {
921  sal_Int32 nLen = rPropertyNames.getLength();
922  std::unique_ptr<sal_Int32[]> pHandles(new sal_Int32[nLen]);
924  rPH.fillHandles( pHandles.get(), rPropertyNames );
925  const OUString* pNames = rPropertyNames.getConstArray();
926 
927  // get the count of matching properties
928  sal_Int32 nFireLen = 0;
929  sal_Int32 i;
930  for( i = 0; i < nLen; i++ )
931  if( pHandles[i] != -1 )
932  nFireLen++;
933 
934  Sequence<PropertyChangeEvent> aChanges( nFireLen );
935  PropertyChangeEvent* pChanges = aChanges.getArray();
936 
937  {
938  // must lock the mutex outside the loop. So all values are consistent.
939  MutexGuard aGuard( rBHelper.rMutex );
940  Reference < XInterface > xSource( static_cast<XPropertySet *>(this), UNO_QUERY );
941  sal_Int32 nFirePos = 0;
942  for( i = 0; i < nLen; i++ )
943  {
944  if( pHandles[i] != -1 )
945  {
946  pChanges[nFirePos].Source = xSource;
947  pChanges[nFirePos].PropertyName = pNames[i];
948  pChanges[nFirePos].PropertyHandle = pHandles[i];
949  getFastPropertyValue( pChanges[nFirePos].OldValue, pHandles[i] );
950  pChanges[nFirePos].NewValue = pChanges[nFirePos].OldValue;
951  nFirePos++;
952  }
953  }
954  // release guard to fire events
955  }
956  if( nFireLen )
957  rListener->propertiesChange( aChanges );
958 }
959 
961 {
962  m_pReserved->m_bFireEvents = bEnable;
963 }
964 
965 extern "C" {
966 
967 static int compare_Property_Impl( const void *arg1, const void *arg2 )
969 {
970  return static_cast<Property const *>(arg1)->Name.compareTo( static_cast<Property const *>(arg2)->Name );
971 }
972 
973 }
974 
976 {
977  sal_Int32 i, nElements = aInfos.getLength();
978  const Property* pProperties = aInfos.getConstArray();
979 
980  for( i = 1; i < nElements; i++ )
981  {
982  if( pProperties[i-1].Name > pProperties[i].Name )
983  {
984  if (bSorted) {
985  OSL_FAIL( "Property array is not sorted" );
986  }
987  // not sorted
988  qsort( aInfos.getArray(), nElements, sizeof( Property ),
990  pProperties = aInfos.getConstArray();
991  break;
992  }
993  }
994  for( i = 0; i < nElements; i++ )
995  if( pProperties[i].Handle != i )
996  return;
997  // The handle is the index
998  bRightOrdered = true;
999 }
1000 
1002  Property * pProps,
1003  sal_Int32 nEle,
1004  sal_Bool bSorted )
1005  : m_pReserved(nullptr)
1006  , aInfos(pProps, nEle)
1007  , bRightOrdered( false )
1008 {
1009  init( bSorted );
1010 }
1011 
1013  const Sequence< Property > & aProps,
1014  sal_Bool bSorted )
1015  : m_pReserved(nullptr)
1016  , aInfos(aProps)
1017  , bRightOrdered( false )
1018 {
1019  init( bSorted );
1020 }
1021 
1022 
1024 {
1025  return aInfos.getLength();
1026 }
1027 
1028 
1031  OUString * pPropName,
1032  sal_Int16 * pAttributes,
1033  sal_Int32 nHandle
1034 )
1035 {
1036  const Property* pProperties = aInfos.getConstArray();
1037  sal_Int32 nElements = aInfos.getLength();
1038 
1039  if( bRightOrdered )
1040  {
1041  if( nHandle < 0 || nHandle >= nElements )
1042  return false;
1043  if( pPropName )
1044  *pPropName = pProperties[ nHandle ].Name;
1045  if( pAttributes )
1046  *pAttributes = pProperties[ nHandle ].Attributes;
1047  return true;
1048  }
1049  // normally the array is sorted
1050  for( sal_Int32 i = 0; i < nElements; i++ )
1051  {
1052  if( pProperties[i].Handle == nHandle )
1053  {
1054  if( pPropName )
1055  *pPropName = pProperties[ i ].Name;
1056  if( pAttributes )
1057  *pAttributes = pProperties[ i ].Attributes;
1058  return true;
1059  }
1060  }
1061  return false;
1062 }
1063 
1064 
1066 {
1067  return aInfos;
1068 }
1069 
1070 
1072 {
1073  Property * pR;
1074  pR = static_cast<Property *>(bsearch( &aPropertyName, aInfos.getConstArray(), aInfos.getLength(),
1075  sizeof( Property ),
1077  if( !pR ) {
1078  throw UnknownPropertyException(aPropertyName);
1079  }
1080  return *pR;
1081 }
1082 
1083 
1085 {
1086  Property * pR;
1087  pR = static_cast<Property *>(bsearch( &aPropertyName, aInfos.getConstArray(), aInfos.getLength(),
1088  sizeof( Property ),
1090  return pR != nullptr;
1091 }
1092 
1093 
1094 sal_Int32 OPropertyArrayHelper::getHandleByName( const OUString & rPropName )
1095 {
1096  Property * pR;
1097  pR = static_cast<Property *>(bsearch( &rPropName, aInfos.getConstArray(), aInfos.getLength(),
1098  sizeof( Property ),
1100  return pR ? pR->Handle : -1;
1101 }
1102 
1103 
1104 sal_Int32 OPropertyArrayHelper::fillHandles( sal_Int32 * pHandles, const Sequence< OUString > & rPropNames )
1105 {
1106  sal_Int32 nHitCount = 0;
1107  const OUString * pReqProps = rPropNames.getConstArray();
1108  sal_Int32 nReqLen = rPropNames.getLength();
1109  const Property * pCur = aInfos.getConstArray();
1110  const Property * pEnd = pCur + aInfos.getLength();
1111 
1112  for( sal_Int32 i = 0; i < nReqLen; i++ )
1113  {
1114  // Calculate logarithm
1115  sal_Int32 n = static_cast<sal_Int32>(pEnd - pCur);
1116  sal_Int32 nLog = 0;
1117  while( n )
1118  {
1119  nLog += 1;
1120  n = n >> 1;
1121  }
1122 
1123  // Number of properties to search for * Log2 of the number of remaining
1124  // properties to search in.
1125  if( (nReqLen - i) * nLog >= pEnd - pCur )
1126  {
1127  // linear search is better
1128  while( pCur < pEnd && pReqProps[i] > pCur->Name )
1129  {
1130  pCur++;
1131  }
1132  if( pCur < pEnd && pReqProps[i] == pCur->Name )
1133  {
1134  pHandles[i] = pCur->Handle;
1135  nHitCount++;
1136  }
1137  else
1138  pHandles[i] = -1;
1139  }
1140  else
1141  {
1142  // binary search is better
1143  sal_Int32 nCompVal = 1;
1144  const Property * pOldEnd = pEnd--;
1145  const Property * pMid = pCur;
1146 
1147  while( nCompVal != 0 && pCur <= pEnd )
1148  {
1149  pMid = (pEnd - pCur) / 2 + pCur;
1150 
1151  nCompVal = pReqProps[i].compareTo( pMid->Name );
1152 
1153  if( nCompVal > 0 )
1154  pCur = pMid + 1;
1155  else
1156  pEnd = pMid - 1;
1157  }
1158 
1159  if( nCompVal == 0 )
1160  {
1161  pHandles[i] = pMid->Handle;
1162  nHitCount++;
1163  pCur = pMid +1;
1164  }
1165  else if( nCompVal > 0 )
1166  {
1167  pHandles[i] = -1;
1168  pCur = pMid +1;
1169  }
1170  else
1171  {
1172  pHandles[i] = -1;
1173  pCur = pMid;
1174  }
1175  pEnd = pOldEnd;
1176  }
1177  }
1178  return nHitCount;
1179 }
1180 
1181 } // end namespace cppu
1182 
1183 
1184 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL removeVetoableChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE
Ignored if the property is not constrained.
Definition: propshlp.cxx:399
static const css::uno::Type & getVetoableTypeIdentifier()
Definition: propshlp.cxx:51
void SAL_CALL disposing()
Send a disposing notification to the listeners in the containers aBoundLC and aVetoableLC.
Definition: propshlp.cxx:236
void setDependentFastPropertyValue(sal_Int32 i_handle, const css::uno::Any &i_value)
sets an dependent property's value
Definition: propshlp.cxx:430
virtual sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString &rPropertyName) SAL_OVERRIDE
Return true if the property with the name rPropertyName exist, otherwise false.
Definition: propshlp.cxx:1084
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
The property sequence is created in the call.
Definition: propshlp.cxx:249
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE
Definition: propshlp.cxx:902
virtual sal_Int32 SAL_CALL getHandleByName(const ::rtl::OUString &rPropertyName) SAL_OVERRIDE
Return the handle of the property with the name rPropertyName.
Definition: propshlp.cxx:1094
virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle, const css::uno::Any &rValue) SAL_OVERRIDE
Throw UnknownPropertyException or PropertyVetoException if the property with the name rPropertyName d...
Definition: propshlp.cxx:481
~OPropertySetHelper()
You must call disposing before destruction.
Definition: propshlp.cxx:198
std::vector< Any > m_oldValues
Definition: propshlp.cxx:153
An interface to extend event notification actions.
Definition: propshlp.hxx:308
std::vector< Any > m_newValues
Definition: propshlp.cxx:152
This interface is used by the OPropertyHelper, to access the property description.
Definition: propshlp.hxx:50
sal_Int64 n
virtual css::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString &aPropertyName) SAL_OVERRIDE
Throw UnknownPropertyException if the property with the name rPropertyName does not exist...
Definition: propshlp.cxx:268
sal_Bool bRightOrdered
True, If the values of the handles are sorted in the same way as the names and the highest handle val...
Definition: propshlp.hxx:205
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties() SAL_OVERRIDE
Return the sequence of properties.
Definition: propshlp.cxx:1065
OUString Name
OMultiTypeInterfaceContainerHelperInt32 aVetoableLC
Container for the XPropertyVetoableListener.
Definition: propshlp.hxx:635
css::uno::XInterface *SAL_CALL next()
Return the next element of the iterator.
virtual ~OPropertySetHelper2()
You must call disposing before destruction.
Definition: propshlp.cxx:202
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(const css::uno::Sequence< ::rtl::OUString > &PropertyNames) SAL_OVERRIDE
Definition: propshlp.cxx:880
#define SAL_THROW_EXTERN_C()
virtual sal_Bool SAL_CALL convertFastPropertyValue(css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue)=0
Converted the value rValue and return the result in rConvertedValue and the old value in rOldValue...
Impl(bool i_bIgnoreRuntimeExceptionsWhileFiring, IEventNotificationHook *i_pFireEvents)
Definition: propshlp.cxx:138
sal_Int32 SAL_CALL removeInterface(const sal_Int32 &rKey, const css::uno::Reference< css::uno::XInterface > &rxIFace)
Remove an element from the container specified with the key.
::osl::Mutex & rMutex
The shared mutex.
container aLC
ListenerContainer class is thread safe.
virtual void SAL_CALL setPropertyValue(const ::rtl::OUString &rPropertyName, const css::uno::Any &aValue) SAL_OVERRIDE
Throw UnknownPropertyException or PropertyVetoException if the property with the name rPropertyName d...
Definition: propshlp.cxx:256
css::uno::Sequence< css::beans::Property > aInfos
The sequence generated from the pProperties array.
Definition: propshlp.hxx:199
Any SAL_CALL getCaughtException()
Use this function to get the dynamic type of a caught C++-UNO exception; completes the above function...
This is the iterator of an InterfaceContainerHelper.
sal_Int32 nElements
sal_Int32 nHandle
void addListener(const keyType &key, const css::uno::Reference< css::uno::XInterface > &r)
adds a listener threadsafe.
virtual void SAL_CALL firePropertiesChangeEvent(const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE
Definition: propshlp.cxx:917
sal_Int32 SAL_CALL getCount() const
Return the number of properties.
Definition: propshlp.cxx:1023
static int compare_OUString_Property_Impl(const void *arg1, const void *arg2) SAL_THROW_EXTERN_C()
Definition: propshlp.cxx:58
sal_Bool bDisposed
Dispose call ready.
int i
void removeListener(const keyType &key, const css::uno::Reference< css::uno::XInterface > &r)
removes a listener threadsafe
class IEventNotificationHook *const m_pFireEvents
Definition: propshlp.cxx:149
static const css::uno::Type & getPropertyTypeIdentifier()
Definition: propshlp.cxx:43
virtual sal_Bool SAL_CALL fillPropertyMembersByHandle(::rtl::OUString *pPropName, sal_Int16 *pAttributes, sal_Int32 nHandle)=0
Return the property members Name and Attribute from the handle nHandle.
class SAL_NO_VTABLE XPropertySet
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
Only returns a reference to XMultiPropertySet, XFastPropertySet, XPropertySet and XEventListener...
Definition: propshlp.cxx:207
css::uno::Sequence< css::uno::Type > getTypes()
eases implementing XTypeProvider::getTypes, returns the types of XMultiPropertySet, XFastPropertySet, XPropertySet
Definition: propshlp.cxx:227
OPropertyArrayHelper(css::beans::Property *pProps, sal_Int32 nElements, sal_Bool bSorted=true)
Create an object which supports the common property interfaces.
void init(sal_Bool bSorted)
Definition: propshlp.cxx:975
virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle) SAL_OVERRIDE
if the property with the handle nHandle does not exist.
Definition: propshlp.cxx:546
virtual void SAL_CALL enableChangeListenerNotification(sal_Bool bEnable) SAL_OVERRIDE
Definition: propshlp.cxx:960
sal_Int16 nAttributes
unsigned char sal_Bool
OPropertySetHelper2(OBroadcastHelper &rBHelper, IEventNotificationHook *i_pFireEvents=NULL, bool bIgnoreRuntimeExceptionsWhileFiring=false)
Constructor.
Definition: propshlp.cxx:187
css::uno::Type const & get()
This struct contains the standard variables of a broadcaster.
virtual IPropertyArrayHelper &SAL_CALL getInfoHelper()=0
This abstract method must return the name to index table.
void SAL_CALL disposeAndClear(const css::lang::EventObject &rEvt)
Call disposing on all objects in the container that support XEventListener.
sal_Int32 SAL_CALL addInterface(const sal_Int32 &rKey, const css::uno::Reference< css::uno::XInterface > &r)
Insert an element in the container specified with the key.
OBroadcastHelper & rBHelper
The common data of a broadcaster.
Definition: propshlp.hxx:627
sal_Bool bInDispose
In dispose call.
const PropertyValue * pValues
virtual sal_Bool SAL_CALL fillPropertyMembersByHandle(::rtl::OUString *pPropName, sal_Int16 *pAttributes, sal_Int32 nHandle) SAL_OVERRIDE
Return the property members Name and Attribute from the handle nHandle.
Definition: propshlp.cxx:1030
void SAL_CALL fire(sal_Int32 *pnHandles, const css::uno::Any *pNewValues, const css::uno::Any *pOldValues, sal_Int32 nCount, sal_Bool bVetoable)
This method fire events to all registered property listeners.
Definition: propshlp.cxx:598
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE
Definition: propshlp.cxx:910
virtual sal_Int32 SAL_CALL fillHandles(sal_Int32 *pHandles, const css::uno::Sequence< ::rtl::OUString > &rPropNames)=0
Fill the array with the handles of the properties.
A container of interfaces.
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const css::uno::Any &rValue)=0
The same as setFastPropertyValue; nHandle is always valid.
#define SAL_INFO(area, stream)
static const css::uno::Type & getPropertiesTypeIdentifier()
Definition: propshlp.cxx:47
void impl_fireAll(sal_Int32 *i_handles, const css::uno::Any *i_newValues, const css::uno::Any *i_oldValues, sal_Int32 i_count)
notifies the given changes in property's values, plus all property changes collected during recent |s...
Definition: propshlp.cxx:561
SQLHANDLE Handle
virtual void SAL_CALL addPropertyChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE
Ignored if the property is not bound.
Definition: propshlp.cxx:280
virtual css::beans::Property SAL_CALL getPropertyByName(const ::rtl::OUString &rPropertyName) SAL_OVERRIDE
Return the property with the name rPropertyName.
Definition: propshlp.cxx:1071
static int compare_Property_Impl(const void *arg1, const void *arg2) SAL_THROW_EXTERN_C()
Definition: propshlp.cxx:967
OPropertySetHelper(OBroadcastHelper &rBHelper)
Definition: propshlp.cxx:158
std::vector< sal_Int32 > m_handles
Definition: propshlp.cxx:151
void SAL_CALL setFastPropertyValues(sal_Int32 nSeqLen, sal_Int32 *pHandles, const css::uno::Any *pValues, sal_Int32 nHitCount)
Set multiple properties with the handles.
Definition: propshlp.cxx:799
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
Only returns a reference to XMultiPropertySet, XFastPropertySet, XPropertySet and XEventListener...
Definition: propshlp.cxx:216
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Sequence< css::uno::Any > &Values) SAL_OVERRIDE
The sequence may be contain not known properties.
Definition: propshlp.cxx:865
OMultiTypeInterfaceContainerHelperInt32 aBoundLC
Container for the XPropertyChangedListener.
Definition: propshlp.hxx:631
Sequence< Property > aInfos
Definition: propshlp.cxx:75
static void copy(Sequence< Type > &rDest, const Sequence< Type > &rSource, sal_Int32 nOffset)
virtual void SAL_CALL removePropertyChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE
Ignored if the property is not bound.
Definition: propshlp.cxx:325
Impl *const m_pReserved
reserved for future use.
Definition: propshlp.hxx:637
This abstract class maps the methods of the interfaces XMultiPropertySet, XFastPropertySet and XPrope...
Definition: propshlp.hxx:362
virtual sal_Int32 SAL_CALL getHandleByName(const ::rtl::OUString &rPropertyName)=0
Return the handle of the property with the name rPropertyName.
void SAL_CALL remove()
Removes the current element (the last one returned by next()) from the underlying container...
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
Compares demanded type to given template argument types.
bool SAL_CALL hasMoreElements() const
Return true, if there are more elements in the iterator.
virtual void SAL_CALL addVetoableChangeListener(const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE
Ignored if the property is not constrained.
Definition: propshlp.cxx:356
virtual sal_Int32 SAL_CALL fillHandles(sal_Int32 *pHandles, const css::uno::Sequence< ::rtl::OUString > &rPropNames) SAL_OVERRIDE
Fill the array with the handles of the properties.
Definition: propshlp.cxx:1104