LibreOffice Module ucb (master)  1
ucbstore.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 /**************************************************************************
22  TODO
23  **************************************************************************
24 
25  *************************************************************************/
26 
27 #include <optional>
28 #include <unordered_map>
29 #include <sal/log.hxx>
30 #include <tools/diagnose_ex.h>
31 #include <rtl/ustrbuf.hxx>
32 #include <rtl/ref.hxx>
36 #include <com/sun/star/beans/IllegalTypeException.hpp>
37 #include <com/sun/star/beans/NotRemoveableException.hpp>
38 #include <com/sun/star/beans/PropertyAttribute.hpp>
39 #include <com/sun/star/beans/PropertyExistException.hpp>
40 #include <com/sun/star/beans/PropertySetInfoChange.hpp>
41 #include <com/sun/star/configuration/theDefaultProvider.hpp>
42 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
43 #include <com/sun/star/container/XNameContainer.hpp>
44 #include <com/sun/star/container/XNameReplace.hpp>
45 #include <com/sun/star/util/XChangesBatch.hpp>
46 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
47 #include <cppuhelper/implbase.hxx>
48 #include <cppuhelper/weak.hxx>
49 #include <ucbhelper/macros.hxx>
50 #include "ucbstore.hxx"
51 
52 using namespace com::sun::star::beans;
53 using namespace com::sun::star::configuration;
54 using namespace com::sun::star::container;
55 using namespace com::sun::star::lang;
56 using namespace com::sun::star::ucb;
57 using namespace com::sun::star::uno;
58 using namespace com::sun::star::util;
59 using namespace comphelper;
60 using namespace cppu;
61 
62 static OUString makeHierarchalNameSegment( const OUString & rIn )
63 {
64  OUStringBuffer aBuffer;
65  aBuffer.append( "['" );
66 
67  sal_Int32 nCount = rIn.getLength();
68  for ( sal_Int32 n = 0; n < nCount; ++n )
69  {
70  const sal_Unicode c = rIn[ n ];
71  switch ( c )
72  {
73  case '&':
74  aBuffer.append( "&amp;" );
75  break;
76 
77  case '"':
78  aBuffer.append( "&quot;" );
79  break;
80 
81  case '\'':
82  aBuffer.append( "&apos;" );
83  break;
84 
85  case '<':
86  aBuffer.append( "&lt;" );
87  break;
88 
89  case '>':
90  aBuffer.append( "&gt;" );
91  break;
92 
93  default:
94  aBuffer.append( c );
95  break;
96  }
97  }
98 
99  aBuffer.append( "']" );
100  return aBuffer.makeStringAndClear();
101 }
102 
103 #define STORE_CONTENTPROPERTIES_KEY "/org.openoffice.ucb.Store/ContentProperties"
104 
105 // describe path of cfg entry
106 #define CFGPROPERTY_NODEPATH "nodepath"
107 
108 class PropertySetInfo_Impl : public cppu::WeakImplHelper < XPropertySetInfo >
109 {
110  std::optional<Sequence< Property >>
113 
114 public:
116 
117  // XPropertySetInfo
118  virtual Sequence< Property > SAL_CALL getProperties() override;
119  virtual Property SAL_CALL getPropertyByName( const OUString& aName ) override;
120  virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override;
121 
122  // Non-interface methods.
123  void reset() { m_xProps.reset(); }
124 };
125 
126 
127 // UcbStore Implementation.
128 
129 
132  m_xContext( xContext )
133 {
134 }
135 
136 
137 // virtual
139 {
140 }
141 
143 {
144  return "com.sun.star.comp.ucb.UcbStore";
145 }
146 sal_Bool SAL_CALL UcbStore::supportsService( const OUString& ServiceName )
147 {
148  return cppu::supportsService( this, ServiceName );
149 }
150 css::uno::Sequence< OUString > SAL_CALL UcbStore::getSupportedServiceNames()
151 {
152  return { "com.sun.star.ucb.Store" };
153 }
154 
155 // Service factory implementation.
156 
157 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
159  css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&)
160 {
161  return cppu::acquire(new UcbStore(context));
162 }
163 
164 
165 // XPropertySetRegistryFactory methods.
166 
167 
168 // virtual
171 {
172  // The URL parameter is ignored by this interface implementation. It always
173  // uses the configuration server as storage medium.
174 
175  if ( !m_xTheRegistry.is() )
176  {
177  osl::Guard< osl::Mutex > aGuard( m_aMutex );
178  if ( !m_xTheRegistry.is() )
180  }
181 
182  return m_xTheRegistry;
183 }
184 
185 
186 // XInitialization methods.
187 
188 
189 // virtual
190 void SAL_CALL UcbStore::initialize( const Sequence< Any >& aArguments )
191 {
192  osl::Guard< osl::Mutex > aGuard( m_aMutex );
193  m_aInitArgs = aArguments;
194 }
195 
196 
197 
198 // PropertySetRegistry Implementation.
199 
200 
202  const Reference< XComponentContext >& xContext,
203  const Sequence< Any > &rInitArgs )
204 : m_xContext( xContext )
205 , m_aInitArgs(rInitArgs)
206 , m_bTriedToGetRootReadAccess(false)
207 , m_bTriedToGetRootWriteAccess(false)
208 {
209 }
210 
211 
212 // virtual
214 {
215 }
216 
217 
218 // XServiceInfo methods.
219 
220 
222 {
223  return "com.sun.star.comp.ucb.PropertySetRegistry";
224 }
225 
226 sal_Bool SAL_CALL PropertySetRegistry::supportsService( const OUString& ServiceName )
227 {
228  return cppu::supportsService( this, ServiceName );
229 }
230 
231 css::uno::Sequence< OUString > SAL_CALL PropertySetRegistry::getSupportedServiceNames()
232 {
233  return { "com.sun.star.ucb.PropertySetRegistry" };
234 }
235 
236 
237 // XPropertySetRegistry methods.
238 
239 
240 // virtual
242 PropertySetRegistry::openPropertySet( const OUString& key, sal_Bool create )
243 {
244  if ( !key.isEmpty() )
245  {
246  osl::Guard< osl::Mutex > aGuard( m_aMutex );
247 
249 
250  PropertySetMap_Impl::const_iterator it = rSets.find( key );
251  if ( it != rSets.end() )
252  {
253  // Already instantiated.
254  return Reference< XPersistentPropertySet >( (*it).second );
255  }
256  else
257  {
258  // Create new instance.
259  Reference< XNameAccess > xRootNameAccess(
260  getRootConfigReadAccess(), UNO_QUERY );
261  if ( xRootNameAccess.is() )
262  {
263  // Propertyset in registry?
264  if ( xRootNameAccess->hasByName( key ) )
265  {
266  // Yep!
269  *this, key ) );
270  }
271  else if ( create )
272  {
273  // No. Create entry for propertyset.
274 
276  getConfigWriteAccess( OUString() ), UNO_QUERY );
277  Reference< XChangesBatch > xBatch( xFac, UNO_QUERY );
278  Reference< XNameContainer > xContainer( xFac, UNO_QUERY );
279 
280  OSL_ENSURE( xFac.is(),
281  "PropertySetRegistry::openPropertySet - "
282  "No factory!" );
283 
284  OSL_ENSURE( xBatch.is(),
285  "PropertySetRegistry::openPropertySet - "
286  "No batch!" );
287 
288  OSL_ENSURE( xContainer.is(),
289  "PropertySetRegistry::openPropertySet - "
290  "No container!" );
291 
292  if ( xFac.is() && xBatch.is() && xContainer.is() )
293  {
294  try
295  {
296  // Create new "Properties" config item.
297  Reference< XNameReplace > xNameReplace(
298  xFac->createInstance(), UNO_QUERY );
299 
300  if ( xNameReplace.is() )
301  {
302  // Fill new item...
303 
304  // Insert new item.
305  xContainer->insertByName(
306  key, makeAny( xNameReplace ) );
307  // Commit changes.
308  xBatch->commitChanges();
309 
312  *this, key ) );
313  }
314  }
315  catch (const IllegalArgumentException&)
316  {
317  // insertByName
318 
319  OSL_FAIL( "PropertySetRegistry::openPropertySet - "
320  "caught IllegalArgumentException!" );
321  }
322  catch (const ElementExistException&)
323  {
324  // insertByName
325 
326  OSL_FAIL( "PropertySetRegistry::openPropertySet - "
327  "caught ElementExistException!" );
328  }
329  catch (const WrappedTargetException&)
330  {
331  // insertByName, commitChanges
332 
333  OSL_FAIL( "PropertySetRegistry::openPropertySet - "
334  "caught WrappedTargetException!" );
335  }
336  catch (const RuntimeException&)
337  {
338  OSL_FAIL( "PropertySetRegistry::openPropertySet - "
339  "caught RuntimeException!" );
340  }
341  catch (const Exception&)
342  {
343  // createInstance
344 
345  OSL_FAIL( "PropertySetRegistry::openPropertySet - "
346  "caught Exception!" );
347  }
348  }
349  }
350  else
351  {
352  // No entry. Fail, but no error.
354  }
355  }
356 
357  SAL_WARN( "ucb", "no root access" );
358  }
359  }
360 
362 }
363 
364 
365 // virtual
366 void SAL_CALL PropertySetRegistry::removePropertySet( const OUString& key )
367 {
368  if ( key.isEmpty() )
369  return;
370 
371  osl::Guard< osl::Mutex > aGuard( m_aMutex );
372 
373  Reference< XNameAccess > xRootNameAccess(
374  getRootConfigReadAccess(), UNO_QUERY );
375  if ( xRootNameAccess.is() )
376  {
377  // Propertyset in registry?
378  if ( !xRootNameAccess->hasByName( key ) )
379  return;
381  getConfigWriteAccess( OUString() ), UNO_QUERY );
382  Reference< XNameContainer > xContainer( xBatch, UNO_QUERY );
383 
384  if ( xBatch.is() && xContainer.is() )
385  {
386  try
387  {
388  // Remove item.
389  xContainer->removeByName( key );
390  // Commit changes.
391  xBatch->commitChanges();
392 
393  // Success.
394  return;
395  }
396  catch (const NoSuchElementException&)
397  {
398  // removeByName
399 
400  OSL_FAIL( "PropertySetRegistry::removePropertySet - "
401  "caught NoSuchElementException!" );
402  return;
403  }
404  catch (const WrappedTargetException&)
405  {
406  // commitChanges
407 
408  OSL_FAIL( "PropertySetRegistry::removePropertySet - "
409  "caught WrappedTargetException!" );
410  return;
411  }
412  }
413 
414  return;
415  }
416 
417  SAL_WARN( "ucb", "no root access" );
418 }
419 
420 
421 // XElementAccess methods.
422 
423 
424 // virtual
425 css::uno::Type SAL_CALL PropertySetRegistry::getElementType()
426 {
428 }
429 
430 
431 // virtual
433 {
434  osl::Guard< osl::Mutex > aGuard( m_aMutex );
435 
436  Reference< XElementAccess > xElemAccess(
437  getRootConfigReadAccess(), UNO_QUERY );
438  if ( xElemAccess.is() )
439  return xElemAccess->hasElements();
440 
441  return false;
442 }
443 
444 
445 // XNameAccess methods.
446 
447 
448 // virtual
449 Any SAL_CALL PropertySetRegistry::getByName( const OUString& aName )
450 {
451  osl::Guard< osl::Mutex > aGuard( m_aMutex );
452 
453  Reference< XNameAccess > xNameAccess(
454  getRootConfigReadAccess(), UNO_QUERY );
455  if ( xNameAccess.is() )
456  {
457 
458  try
459  {
460  return xNameAccess->getByName( aName );
461  }
462  catch (const NoSuchElementException&)
463  {
464  // getByName
465  }
466  catch (const WrappedTargetException&)
467  {
468  // getByName
469  }
470  }
471 
472  return Any();
473 }
474 
475 
476 // virtual
478 {
479  osl::Guard< osl::Mutex > aGuard( m_aMutex );
480 
481  Reference< XNameAccess > xNameAccess(
482  getRootConfigReadAccess(), UNO_QUERY );
483  if ( xNameAccess.is() )
484  {
485  return xNameAccess->getElementNames();
486  }
487  return Sequence< OUString >( 0 );
488 }
489 
490 
491 // virtual
492 sal_Bool SAL_CALL PropertySetRegistry::hasByName( const OUString& aName )
493 {
494  osl::Guard< osl::Mutex > aGuard( m_aMutex );
495 
496  Reference< XNameAccess > xNameAccess(
497  getRootConfigReadAccess(), UNO_QUERY );
498  if ( xNameAccess.is() )
499  {
500  return xNameAccess->hasByName( aName );
501  }
502 
503  return false;
504 }
505 
506 
508 {
509  OUString key( pSet->getKey() );
510 
511  if ( !key.isEmpty() )
512  {
513  osl::Guard< osl::Mutex > aGuard( m_aMutex );
514  m_aPropSets[ key ] = pSet;
515  }
516 }
517 
518 
520 {
521  OUString key( pSet->getKey() );
522 
523  if ( key.isEmpty() )
524  return;
525 
526  osl::Guard< osl::Mutex > aGuard( m_aMutex );
527 
529 
530  PropertySetMap_Impl::iterator it = rSets.find( key );
531  if ( it != rSets.end() )
532  {
533  // Found.
534  rSets.erase( it );
535  }
536 }
537 
538 
539 void PropertySetRegistry::renamePropertySet( const OUString& rOldKey,
540  const OUString& rNewKey )
541 {
542  if ( rOldKey == rNewKey )
543  return;
544 
545  Reference< XNameAccess > xRootNameAccess(
546  getConfigWriteAccess( OUString() ), UNO_QUERY );
547  if ( xRootNameAccess.is() )
548  {
549  // Old key present?
550  if ( xRootNameAccess->hasByName( rOldKey ) )
551  {
552  // New key not present?
553  if ( xRootNameAccess->hasByName( rNewKey ) )
554  {
555  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
556  "New key exists!" );
557  return;
558  }
560  xRootNameAccess, UNO_QUERY );
561  Reference< XChangesBatch > xBatch( xFac, UNO_QUERY );
562  Reference< XNameContainer > xContainer( xFac, UNO_QUERY );
563 
564  OSL_ENSURE( xFac.is(),
565  "PropertySetRegistry::renamePropertySet - "
566  "No factory!" );
567 
568  OSL_ENSURE( xBatch.is(),
569  "PropertySetRegistry::renamePropertySet - "
570  "No batch!" );
571 
572  OSL_ENSURE( xContainer.is(),
573  "PropertySetRegistry::renamePropertySet - "
574  "No container!" );
575 
576  if ( xFac.is() && xBatch.is() && xContainer.is() )
577  {
578 
579  // Create new "Properties" config item.
580 
581 
582  try
583  {
584  Reference< XNameReplace > xNameReplace(
585  xFac->createInstance(), UNO_QUERY );
586 
587  if ( xNameReplace.is() )
588  {
589  // Insert new item.
590  xContainer->insertByName(
591  rNewKey, makeAny( xNameReplace ) );
592  // Commit changes.
593  xBatch->commitChanges();
594  }
595  }
596  catch (const IllegalArgumentException&)
597  {
598  // insertByName
599 
600  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
601  "caught IllegalArgumentException!" );
602  return;
603  }
604  catch (const ElementExistException&)
605  {
606  // insertByName
607 
608  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
609  "caught ElementExistException!" );
610  return;
611  }
612  catch (const WrappedTargetException&)
613  {
614  // insertByName, commitChanges
615 
616  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
617  "caught WrappedTargetException!" );
618  return;
619  }
620  catch (const RuntimeException&)
621  {
622  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
623  "caught RuntimeException!" );
624  return;
625  }
626  catch (const Exception&)
627  {
628  // createInstance
629 
630  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
631  "caught Exception!" );
632  return;
633  }
634 
635 
636  // Copy data...
637 
638 
639  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
640  xRootNameAccess, UNO_QUERY );
641  if ( !xRootHierNameAccess.is() )
642  {
643  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
644  "No hierarchical name access!" );
645  return;
646  }
647 
648  try
649  {
650  OUString aOldValuesKey
651  = makeHierarchalNameSegment( rOldKey ) + "/Values";
652 
653  Reference< XNameAccess > xOldNameAccess;
654  xRootHierNameAccess->getByHierarchicalName(
655  aOldValuesKey )
656  >>= xOldNameAccess;
657  if ( !xOldNameAccess.is() )
658  {
659  OSL_FAIL( "PersistentPropertySet::renamePropertySet - "
660  "No old name access!" );
661  return;
662  }
663 
664  // Obtain property names.
665  const Sequence< OUString > aElems
666  = xOldNameAccess->getElementNames();
667  if ( aElems.hasElements() )
668  {
669  OUString aNewValuesKey
670  = makeHierarchalNameSegment( rNewKey ) + "/Values";
671 
673  xRootHierNameAccess->getByHierarchicalName(
674  aNewValuesKey )
675  >>= xNewFac;
676  if ( !xNewFac.is() )
677  {
678  OSL_FAIL( "PersistentPropertySet::renamePropertySet - "
679  "No new factory!" );
680  return;
681  }
682 
683  Reference< XNameContainer > xNewContainer(
684  xNewFac, UNO_QUERY );
685  if ( !xNewContainer.is() )
686  {
687  OSL_FAIL( "PersistentPropertySet::renamePropertySet - "
688  "No new container!" );
689  return;
690  }
691 
692  aOldValuesKey += "/";
693 
694  OUString const aHandleKey("/Handle");
695  OUString const aValueKey("/Value");
696  OUString const aStateKey("/State");
697  OUString const aAttrKey("/Attributes");
698 
699  for ( const OUString& rPropName : aElems )
700  {
701  // Create new item.
702  Reference< XNameReplace > xNewPropNameReplace(
703  xNewFac->createInstance(), UNO_QUERY );
704 
705  if ( !xNewPropNameReplace.is() )
706  {
707  OSL_FAIL( "PersistentPropertySet::renamePropertySet - "
708  "No new prop name replace!" );
709  return;
710  }
711 
712  // Fill new item...
713 
714  // Set Values
715  OUString aKey = aOldValuesKey;
716  aKey += makeHierarchalNameSegment( rPropName );
717 
718  // ... handle
719  OUString aNewKey1 = aKey + aHandleKey;
720  Any aAny =
721  xRootHierNameAccess->getByHierarchicalName(
722  aNewKey1 );
723  xNewPropNameReplace->replaceByName( "Handle", aAny );
724 
725  // ... value
726  aNewKey1 = aKey + aValueKey;
727  aAny =
728  xRootHierNameAccess->getByHierarchicalName(
729  aNewKey1 );
730  xNewPropNameReplace->replaceByName( "Value", aAny );
731 
732  // ... state
733  aNewKey1 = aKey + aStateKey;
734  aAny =
735  xRootHierNameAccess->getByHierarchicalName(
736  aNewKey1 );
737  xNewPropNameReplace->replaceByName( "State", aAny );
738 
739  // ... attributes
740  aNewKey1 = aKey + aAttrKey;
741  aAny =
742  xRootHierNameAccess->getByHierarchicalName(
743  aNewKey1 );
744  xNewPropNameReplace->replaceByName( "Attributes", aAny );
745 
746  // Insert new item.
747  xNewContainer->insertByName(
748  rPropName, makeAny( xNewPropNameReplace ) );
749 
750  // Commit changes.
751  xBatch->commitChanges();
752  }
753  }
754  }
755  catch (const IllegalArgumentException&)
756  {
757  // insertByName, replaceByName
758 
759  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
760  "caught IllegalArgumentException!" );
761  return;
762  }
763  catch (const ElementExistException&)
764  {
765  // insertByName
766 
767  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
768  "caught ElementExistException!" );
769  return;
770  }
771  catch (const WrappedTargetException&)
772  {
773  // insertByName, replaceByName, commitChanges
774 
775  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
776  "caught WrappedTargetException!" );
777  return;
778  }
779  catch (const NoSuchElementException&)
780  {
781  // getByHierarchicalName, replaceByName
782 
783  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
784  "caught NoSuchElementException!" );
785  return;
786  }
787  catch (const RuntimeException&)
788  {
789  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
790  "caught RuntimeException!" );
791  return;
792  }
793  catch (const Exception&)
794  {
795  // createInstance
796 
797  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
798  "caught Exception!" );
799  return;
800  }
801 
802 
803  // Remove old entry...
804 
805 
806  try
807  {
808  // Remove item.
809  xContainer->removeByName( rOldKey );
810  // Commit changes.
811  xBatch->commitChanges();
812 
813  // Success.
814  return;
815  }
816  catch (const NoSuchElementException&)
817  {
818  // removeByName
819 
820  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
821  "caught NoSuchElementException!" );
822  return;
823  }
824  catch (const WrappedTargetException&)
825  {
826  // commitChanges
827 
828  OSL_FAIL( "PropertySetRegistry::renamePropertySet - "
829  "caught WrappedTargetException!" );
830  return;
831  }
832  }
833  }
834  }
835 
836  OSL_FAIL( "PropertySetRegistry::renamePropertySet - Error!" );
837 }
838 
839 
841 {
842  if ( !m_xConfigProvider.is() )
843  {
844  osl::Guard< osl::Mutex > aGuard( m_aMutex );
845  if ( !m_xConfigProvider.is() )
846  {
847  const Sequence< Any >& rInitArgs = m_aInitArgs;
848 
849  if ( rInitArgs.hasElements() )
850  {
851  // Extract config provider from service init args.
852  rInitArgs[ 0 ] >>= m_xConfigProvider;
853 
854  OSL_ENSURE( m_xConfigProvider.is(),
855  "PropertySetRegistry::getConfigProvider - "
856  "No config provider!" );
857  }
858  else
859  {
860  try
861  {
862  m_xConfigProvider = theDefaultProvider::get( m_xContext );
863  }
864  catch (const Exception&)
865  {
866  TOOLS_WARN_EXCEPTION( "ucb", "");
867  }
868  }
869  }
870  }
871 
872  return m_xConfigProvider;
873 }
874 
875 
877 {
878  try
879  {
880  osl::Guard< osl::Mutex > aGuard( m_aMutex );
881 
882  if ( !m_xRootReadAccess.is() )
883  {
885  {
886  OSL_FAIL( "PropertySetRegistry::getRootConfigReadAccess - "
887  "Unable to read any config data! -> #82494#" );
888  return Reference< XInterface >();
889  }
890 
892 
893  if ( m_xConfigProvider.is() )
894  {
896  {
898  }));
899 
901 
903  m_xConfigProvider->createInstanceWithArguments(
904  "com.sun.star.configuration.ConfigurationAccess",
905  aArguments );
906 
907  if ( m_xRootReadAccess.is() )
908  return m_xRootReadAccess;
909  }
910  }
911  else
912  return m_xRootReadAccess;
913  }
914  catch (const RuntimeException&)
915  {
916  throw;
917  }
918  catch (const Exception&)
919  {
920  // createInstance, createInstanceWithArguments
921 
922  TOOLS_WARN_EXCEPTION("ucb", "");
923  return Reference< XInterface >();
924  }
925 
926  SAL_WARN( "ucb", "Error!" );
927  return Reference< XInterface >();
928 }
929 
930 
932  const OUString& rPath )
933 {
934  try
935  {
936  osl::Guard< osl::Mutex > aGuard( m_aMutex );
937 
938  if ( !m_xRootWriteAccess.is() )
939  {
941  {
942  OSL_FAIL( "PropertySetRegistry::getConfigWriteAccess - "
943  "Unable to write any config data! -> #82494#" );
944  return Reference< XInterface >();
945  }
946 
948 
949  if ( m_xConfigProvider.is() )
950  {
952  {
954  }));
955 
957 
959  m_xConfigProvider->createInstanceWithArguments(
960  "com.sun.star.configuration.ConfigurationUpdateAccess",
961  aArguments );
962 
963  OSL_ENSURE( m_xRootWriteAccess.is(),
964  "PropertySetRegistry::getConfigWriteAccess - "
965  "No config update access!" );
966  }
967  }
968 
969  if ( m_xRootWriteAccess.is() )
970  {
971  if ( !rPath.isEmpty() )
972  {
974  m_xRootWriteAccess, UNO_QUERY );
975  if ( xNA.is() )
976  {
977  Reference< XInterface > xInterface;
978  xNA->getByHierarchicalName( rPath ) >>= xInterface;
979 
980  if ( xInterface.is() )
981  return xInterface;
982  }
983  }
984  else
985  return m_xRootWriteAccess;
986  }
987  }
988  catch (const RuntimeException&)
989  {
990  throw;
991  }
992  catch (const NoSuchElementException&)
993  {
994  // getByHierarchicalName
995 
996  OSL_FAIL( "PropertySetRegistry::getConfigWriteAccess - "
997  "caught NoSuchElementException!" );
998  return Reference< XInterface >();
999  }
1000  catch (const Exception&)
1001  {
1002  // createInstance, createInstanceWithArguments
1003 
1004  OSL_FAIL( "PropertySetRegistry::getConfigWriteAccess - "
1005  "caught Exception!" );
1006  return Reference< XInterface >();
1007  }
1008 
1009  OSL_FAIL( "PropertySetRegistry::getConfigWriteAccess - Error!" );
1010  return Reference< XInterface >();
1011 }
1012 
1013 
1014 // PersistentPropertySet Implementation.
1015 
1016 
1018  PropertySetRegistry& rCreator,
1019  const OUString& rKey )
1020 : m_pCreator( &rCreator ), m_aKey( rKey )
1021 {
1022  // register at creator.
1023  rCreator.add( this );
1024 }
1025 
1026 
1027 // virtual
1029 {
1030  // deregister at creator.
1031  m_pCreator->remove( this );
1032 }
1033 
1034 // XServiceInfo methods.
1035 
1037 {
1038  return "com.sun.star.comp.ucb.PersistentPropertySet";
1039 }
1040 
1041 sal_Bool SAL_CALL PersistentPropertySet::supportsService( const OUString& ServiceName )
1042 {
1043  return cppu::supportsService( this, ServiceName );
1044 }
1045 
1046 css::uno::Sequence< OUString > SAL_CALL PersistentPropertySet::getSupportedServiceNames()
1047 {
1048  return { "com.sun.star.ucb.PersistentPropertySet" };
1049 }
1050 
1051 
1052 // XComponent methods.
1053 
1054 
1055 // virtual
1057 {
1058  if ( m_pDisposeEventListeners &&
1059  m_pDisposeEventListeners->getLength() )
1060  {
1061  EventObject aEvt;
1062  aEvt.Source = static_cast< XComponent * >( this );
1063  m_pDisposeEventListeners->disposeAndClear( aEvt );
1064  }
1065 
1067  m_pPropSetChangeListeners->getLength() )
1068  {
1069  EventObject aEvt;
1070  aEvt.Source = static_cast< XPropertySetInfoChangeNotifier * >( this );
1071  m_pPropSetChangeListeners->disposeAndClear( aEvt );
1072  }
1073 
1075  {
1076  EventObject aEvt;
1077  aEvt.Source = static_cast< XPropertySet * >( this );
1078  m_pPropertyChangeListeners->disposeAndClear( aEvt );
1079  }
1080 }
1081 
1082 
1083 // virtual
1085  const Reference< XEventListener >& Listener )
1086 {
1087  if ( !m_pDisposeEventListeners )
1090 
1091  m_pDisposeEventListeners->addInterface( Listener );
1092 }
1093 
1094 
1095 // virtual
1097  const Reference< XEventListener >& Listener )
1098 {
1100  m_pDisposeEventListeners->removeInterface( Listener );
1101 
1102  // Note: Don't want to delete empty container here -> performance.
1103 }
1104 
1105 
1106 // XPropertySet methods.
1107 
1108 
1109 // virtual
1111 {
1112  osl::Guard< osl::Mutex > aGuard( m_aMutex );
1113 
1114  if ( !m_pInfo.is() )
1115  {
1116  m_pInfo = new PropertySetInfo_Impl( this );
1117  }
1118  return m_pInfo;
1119 }
1120 
1121 
1122 // virtual
1123 void SAL_CALL PersistentPropertySet::setPropertyValue( const OUString& aPropertyName,
1124  const Any& aValue )
1125 {
1126  osl::ClearableGuard< osl::Mutex > aCGuard( m_aMutex );
1127 
1128  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
1129  m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1130  if ( xRootHierNameAccess.is() )
1131  {
1132  OUString aFullPropName( getFullKey() + "/" );
1133  aFullPropName += makeHierarchalNameSegment( aPropertyName );
1134 
1135  // Does property exist?
1136  if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1137  {
1138  Reference< XNameReplace > xNameReplace(
1139  m_pCreator->getConfigWriteAccess(
1140  aFullPropName ), UNO_QUERY );
1142  m_pCreator->getConfigWriteAccess(
1143  OUString() ), UNO_QUERY );
1144 
1145  if ( xNameReplace.is() && xBatch.is() )
1146  {
1147  try
1148  {
1149  // Obtain old value
1150  OUString aValueName = aFullPropName + "/Value";
1151  Any aOldValue
1152  = xRootHierNameAccess->getByHierarchicalName(
1153  aValueName );
1154  // Check value type.
1155  if ( aOldValue.getValueType() != aValue.getValueType() )
1156  {
1157  aCGuard.clear();
1158  throw IllegalArgumentException();
1159  }
1160 
1161  // Write value
1162  xNameReplace->replaceByName( "Value", aValue );
1163 
1164  // Write state ( Now it is a directly set value )
1165  xNameReplace->replaceByName(
1166  "State",
1167  makeAny(
1168  sal_Int32(
1169  PropertyState_DIRECT_VALUE ) ) );
1170 
1171  // Commit changes.
1172  xBatch->commitChanges();
1173 
1174  PropertyChangeEvent aEvt;
1176  {
1177  // Obtain handle
1178  aValueName = aFullPropName + "/Handle";
1179  sal_Int32 nHandle = -1;
1180  xRootHierNameAccess->getByHierarchicalName( aValueName )
1181  >>= nHandle;
1182 
1183  aEvt.Source = static_cast<OWeakObject*>(this);
1184  aEvt.PropertyName = aPropertyName;
1185  aEvt.PropertyHandle = nHandle;
1186  aEvt.Further = false;
1187  aEvt.OldValue = aOldValue;
1188  aEvt.NewValue = aValue;
1189 
1190  // Callback follows!
1191  aCGuard.clear();
1192 
1193  notifyPropertyChangeEvent( aEvt );
1194  }
1195  return;
1196  }
1197  catch (const IllegalArgumentException&)
1198  {
1199  // replaceByName
1200  }
1201  catch (const NoSuchElementException&)
1202  {
1203  // getByHierarchicalName, replaceByName
1204  }
1205  catch (const WrappedTargetException&)
1206  {
1207  // replaceByName, commitChanges
1208  }
1209  }
1210  }
1211  }
1212 
1213  throw UnknownPropertyException(aPropertyName);
1214 }
1215 
1216 
1217 // virtual
1219  const OUString& PropertyName )
1220 {
1221  osl::Guard< osl::Mutex > aGuard( m_aMutex );
1222 
1224  m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1225  if ( xNameAccess.is() )
1226  {
1227  OUString aFullPropName( getFullKey() + "/" );
1228  aFullPropName += makeHierarchalNameSegment( PropertyName ) + "/Value";
1229  try
1230  {
1231  return xNameAccess->getByHierarchicalName( aFullPropName );
1232  }
1233  catch (const NoSuchElementException&)
1234  {
1235  throw UnknownPropertyException(aFullPropName);
1236  }
1237  }
1238 
1239  throw UnknownPropertyException(PropertyName);
1240 }
1241 
1242 
1243 // virtual
1245  const OUString& aPropertyName,
1246  const Reference< XPropertyChangeListener >& xListener )
1247 {
1248 // load();
1249 
1253 
1254  m_pPropertyChangeListeners->addInterface(
1255  aPropertyName, xListener );
1256 }
1257 
1258 
1259 // virtual
1261  const OUString& aPropertyName,
1262  const Reference< XPropertyChangeListener >& aListener )
1263 {
1264 // load();
1265 
1267  m_pPropertyChangeListeners->removeInterface(
1268  aPropertyName, aListener );
1269 
1270  // Note: Don't want to delete empty container here -> performance.
1271 }
1272 
1273 
1274 // virtual
1276  const OUString&,
1278 {
1279 // load();
1280 // OSL_FAIL( // "PersistentPropertySet::addVetoableChangeListener - N.Y.I." );
1281 }
1282 
1283 
1284 // virtual
1286  const OUString&,
1288 {
1289 // load();
1290 // OSL_FAIL( // "PersistentPropertySet::removeVetoableChangeListener - N.Y.I." );
1291 }
1292 
1293 
1294 // XPersistentPropertySet methods.
1295 
1296 
1297 // virtual
1299 {
1300  return m_pCreator;
1301 }
1302 
1303 
1304 // virtual
1306 {
1307  return m_aKey;
1308 }
1309 
1310 
1311 // XNamed methods.
1312 
1313 
1314 // virtual
1316 {
1317  // same as getKey()
1318  return m_aKey;
1319 }
1320 
1321 
1322 // virtual
1323 void SAL_CALL PersistentPropertySet::setName( const OUString& aName )
1324 {
1325  if ( aName != m_aKey )
1326  m_pCreator->renamePropertySet( m_aKey, aName );
1327 }
1328 
1329 
1330 // XPropertyContainer methods.
1331 
1332 
1333 // virtual
1335  const OUString& Name, sal_Int16 Attributes, const Any& DefaultValue )
1336 {
1337  if ( Name.isEmpty() )
1338  throw IllegalArgumentException();
1339 
1340  // @@@ What other types can't be written to config server?
1341 
1342  // Check type class ( Not all types can be written to storage )
1343  TypeClass eTypeClass = DefaultValue.getValueTypeClass();
1344  if ( eTypeClass == TypeClass_INTERFACE )
1345  throw IllegalTypeException();
1346 
1347  osl::Guard< osl::Mutex > aGuard( m_aMutex );
1348 
1349  // Property already in set?
1350 
1351  OUString aFullValuesName;
1352 
1353  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
1354  m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1355  if ( xRootHierNameAccess.is() )
1356  {
1357  aFullValuesName = getFullKey();
1358  OUString aFullPropName = aFullValuesName + "/";
1359  aFullPropName += makeHierarchalNameSegment( Name );
1360 
1361  if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1362  {
1363  // Already in set.
1364  throw PropertyExistException();
1365  }
1366  }
1367 
1368  // Property is always removable.
1369  Attributes |= PropertyAttribute::REMOVABLE;
1370 
1371  // Add property.
1372 
1374  m_pCreator->getConfigWriteAccess( aFullValuesName ),
1375  UNO_QUERY );
1376  Reference< XNameContainer > xContainer( xFac, UNO_QUERY );
1378  m_pCreator->getConfigWriteAccess( OUString() ),
1379  UNO_QUERY );
1380 
1381  OSL_ENSURE( xFac.is(),
1382  "PersistentPropertySet::addProperty - No factory!" );
1383 
1384  OSL_ENSURE( xBatch.is(),
1385  "PersistentPropertySet::addProperty - No batch!" );
1386 
1387  OSL_ENSURE( xContainer.is(),
1388  "PersistentPropertySet::addProperty - No container!" );
1389 
1390  if ( xFac.is() && xBatch.is() && xContainer.is() )
1391  {
1392  try
1393  {
1394  // Create new "PropertyValue" config item.
1395  Reference< XNameReplace > xNameReplace(
1396  xFac->createInstance(), UNO_QUERY );
1397 
1398  if ( xNameReplace.is() )
1399  {
1400  // Fill new item...
1401 
1402  // Set handle
1403  xNameReplace->replaceByName(
1404  "Handle",
1405  makeAny( sal_Int32( -1 ) ) );
1406 
1407  // Set default value
1408  xNameReplace->replaceByName(
1409  "Value",
1410  DefaultValue );
1411 
1412  // Set state ( always "default" )
1413  xNameReplace->replaceByName(
1414  "State",
1415  makeAny(
1416  sal_Int32(
1417  PropertyState_DEFAULT_VALUE ) ) );
1418 
1419  // Set attributes
1420  xNameReplace->replaceByName(
1421  "Attributes",
1422  makeAny( sal_Int32( Attributes ) ) );
1423 
1424  // Insert new item.
1425  xContainer->insertByName( Name, makeAny( xNameReplace ) );
1426 
1427  // Commit changes.
1428  xBatch->commitChanges();
1429 
1430  // Property set info is invalid.
1431  if ( m_pInfo.is() )
1432  m_pInfo->reset();
1433 
1434  // Notify propertyset info change listeners.
1436  m_pPropSetChangeListeners->getLength() )
1437  {
1438  PropertySetInfoChangeEvent evt(
1439  static_cast< OWeakObject * >( this ),
1440  Name,
1441  -1,
1442  PropertySetInfoChange::PROPERTY_INSERTED );
1444  }
1445 
1446  // Success.
1447  return;
1448  }
1449  }
1450  catch (const IllegalArgumentException&)
1451  {
1452  // insertByName
1453 
1454  OSL_FAIL( "PersistentPropertySet::addProperty - "
1455  "caught IllegalArgumentException!" );
1456  return;
1457  }
1458  catch (const ElementExistException&)
1459  {
1460  // insertByName
1461 
1462  OSL_FAIL( "PersistentPropertySet::addProperty - "
1463  "caught ElementExistException!" );
1464  return;
1465  }
1466  catch (const WrappedTargetException&)
1467  {
1468  // replaceByName, insertByName, commitChanges
1469 
1470  OSL_FAIL( "PersistentPropertySet::addProperty - "
1471  "caught WrappedTargetException!" );
1472  return;
1473  }
1474  catch (const RuntimeException&)
1475  {
1476  throw;
1477  }
1478  catch (const Exception&)
1479  {
1480  // createInstance
1481 
1482  OSL_FAIL( "PersistentPropertySet::addProperty - "
1483  "caught Exception!" );
1484  return;
1485  }
1486  }
1487 
1488  OSL_FAIL( "PersistentPropertySet::addProperty - Error!" );
1489 }
1490 
1491 
1492 // virtual
1493 void SAL_CALL PersistentPropertySet::removeProperty( const OUString& Name )
1494 {
1495  osl::Guard< osl::Mutex > aGuard( m_aMutex );
1496 
1497  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
1498  m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1499  if ( xRootHierNameAccess.is() )
1500  {
1501  OUString aFullValuesName = getFullKey();
1502  OUString aFullPropName = aFullValuesName + "/";
1503  aFullPropName += makeHierarchalNameSegment( Name );
1504 
1505  // Property in set?
1506  if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1507  throw UnknownPropertyException(aFullPropName);
1508 
1509  // Property removable?
1510  try
1511  {
1512  OUString aFullAttrName = aFullPropName + "/Attributes";
1513 
1514  sal_Int32 nAttribs = 0;
1515  if ( xRootHierNameAccess->getByHierarchicalName( aFullAttrName )
1516  >>= nAttribs )
1517  {
1518  if ( !( nAttribs & PropertyAttribute::REMOVABLE ) )
1519  {
1520  // Not removable!
1521  throw NotRemoveableException();
1522  }
1523  }
1524  else
1525  {
1526  OSL_FAIL( "PersistentPropertySet::removeProperty - "
1527  "No attributes!" );
1528  return;
1529  }
1530  }
1531  catch (const NoSuchElementException&)
1532  {
1533  // getByHierarchicalName
1534 
1535  OSL_FAIL( "PersistentPropertySet::removeProperty - "
1536  "caught NoSuchElementException!" );
1537  }
1538 
1539  // Remove property...
1540 
1541  Reference< XNameContainer > xContainer(
1542  m_pCreator->getConfigWriteAccess( aFullValuesName ),
1543  UNO_QUERY );
1545  m_pCreator->getConfigWriteAccess( OUString() ),
1546  UNO_QUERY );
1547 
1548  OSL_ENSURE( xBatch.is(),
1549  "PersistentPropertySet::removeProperty - No batch!" );
1550 
1551  OSL_ENSURE( xContainer.is(),
1552  "PersistentPropertySet::removeProperty - No container!" );
1553 
1554  if ( xBatch.is() && xContainer.is() )
1555  {
1556  try
1557  {
1558  sal_Int32 nHandle = -1;
1559 
1561  m_pPropSetChangeListeners->getLength() )
1562  {
1563  // Obtain property handle ( needed for propertysetinfo
1564  // change event )...
1565 
1566  try
1567  {
1568  OUString aFullHandleName = aFullPropName + "/Handle";
1569 
1570  if ( ! ( xRootHierNameAccess->getByHierarchicalName(
1571  aFullHandleName ) >>= nHandle ) )
1572  nHandle = -1;
1573 
1574  }
1575  catch (const NoSuchElementException&)
1576  {
1577  // getByHierarchicalName
1578 
1579  OSL_FAIL( "PersistentPropertySet::removeProperty - "
1580  "caught NoSuchElementException!" );
1581  nHandle = -1;
1582  }
1583  }
1584 
1585  xContainer->removeByName( Name );
1586  xBatch->commitChanges();
1587 
1588  // Property set info is invalid.
1589  if ( m_pInfo.is() )
1590  m_pInfo->reset();
1591 
1592  // Notify propertyset info change listeners.
1594  m_pPropSetChangeListeners->getLength() )
1595  {
1596  PropertySetInfoChangeEvent evt(
1597  static_cast< OWeakObject * >( this ),
1598  Name,
1599  nHandle,
1600  PropertySetInfoChange::PROPERTY_REMOVED );
1602  }
1603 
1604  // Success.
1605  return;
1606  }
1607  catch (const NoSuchElementException&)
1608  {
1609  // removeByName
1610 
1611  OSL_FAIL( "PersistentPropertySet::removeProperty - "
1612  "caught NoSuchElementException!" );
1613  return;
1614  }
1615  catch (const WrappedTargetException&)
1616  {
1617  // commitChanges
1618 
1619  OSL_FAIL( "PersistentPropertySet::removeProperty - "
1620  "caught WrappedTargetException!" );
1621  return;
1622  }
1623  }
1624  }
1625 
1626  OSL_FAIL( "PersistentPropertySet::removeProperty - Error!" );
1627 }
1628 
1629 
1630 // XPropertySetInfoChangeNotifier methods.
1631 
1632 
1633 // virtual
1636 {
1640 
1641  m_pPropSetChangeListeners->addInterface( Listener );
1642 }
1643 
1644 
1645 // virtual
1648 {
1650  m_pPropSetChangeListeners->removeInterface( Listener );
1651 }
1652 
1653 
1654 // XPropertyAccess methods.
1655 
1656 
1657 // virtual
1659 {
1660  osl::Guard< osl::Mutex > aGuard( m_aMutex );
1661 
1662  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
1663  m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1664  if ( xRootHierNameAccess.is() )
1665  {
1666  try
1667  {
1668  Reference< XNameAccess > xNameAccess;
1669  xRootHierNameAccess->getByHierarchicalName(getFullKey())
1670  >>= xNameAccess;
1671  if ( xNameAccess.is() )
1672  {
1673  // Obtain property names.
1674 
1675  Sequence< OUString > aElems = xNameAccess->getElementNames();
1676 
1677  sal_Int32 nCount = aElems.getLength();
1678  if ( nCount )
1679  {
1680  Reference< XHierarchicalNameAccess > xHierNameAccess(
1681  xNameAccess, UNO_QUERY );
1682 
1683  OSL_ENSURE( xHierNameAccess.is(),
1684  "PersistentPropertySet::getPropertyValues - "
1685  "No hierarchical name access!" );
1686 
1687  if ( xHierNameAccess.is() )
1688  {
1689  Sequence< PropertyValue > aValues( nCount );
1690 
1691  static const OUStringLiteral aHandleName(u"/Handle");
1692  static const OUStringLiteral aValueName(u"/Value");
1693  static const OUStringLiteral aStateName(u"/State");
1694 
1695  for ( sal_Int32 n = 0; n < nCount; ++n )
1696  {
1697  PropertyValue& rValue = aValues[ n ];
1698  OUString rName = aElems[ n ];
1699  OUString aXMLName
1700  = makeHierarchalNameSegment( rName );
1701 
1702  // Set property name.
1703 
1704  rValue.Name = rName;
1705 
1706  try
1707  {
1708  // Obtain and set property handle
1709  OUString aHierName = aXMLName + aHandleName;
1710  Any aKeyValue
1711  = xHierNameAccess->getByHierarchicalName(
1712  aHierName );
1713 
1714  if ( !( aKeyValue >>= rValue.Handle ) )
1715  OSL_FAIL( "PersistentPropertySet::getPropertyValues - "
1716  "Error getting property handle!" );
1717  }
1718  catch (const NoSuchElementException&)
1719  {
1720  // getByHierarchicalName
1721 
1722  OSL_FAIL( "PersistentPropertySet::getPropertyValues - "
1723  "NoSuchElementException!" );
1724  }
1725 
1726  try
1727  {
1728  // Obtain and set property value
1729  OUString aHierName = aXMLName + aValueName;
1730  rValue.Value
1731  = xHierNameAccess->getByHierarchicalName(
1732  aHierName );
1733 
1734  // Note: The value may be void if addProperty
1735  // was called with a default value
1736  // of type void.
1737  }
1738  catch (const NoSuchElementException&)
1739  {
1740  // getByHierarchicalName
1741 
1742  OSL_FAIL( "PersistentPropertySet::getPropertyValues - "
1743  "NoSuchElementException!" );
1744  }
1745 
1746  try
1747  {
1748  // Obtain and set property state
1749  OUString aHierName = aXMLName +aStateName;
1750  Any aKeyValue
1751  = xHierNameAccess->getByHierarchicalName(
1752  aHierName );
1753 
1754  sal_Int32 nState = 0;
1755  if ( !( aKeyValue >>= nState ) )
1756  OSL_FAIL( "PersistentPropertySet::getPropertyValues - "
1757  "Error getting property state!" );
1758  else
1759  rValue.State = PropertyState( nState );
1760  }
1761  catch (const NoSuchElementException&)
1762  {
1763  // getByHierarchicalName
1764 
1765  OSL_FAIL( "PersistentPropertySet::getPropertyValues - "
1766  "NoSuchElementException!" );
1767  }
1768  }
1769 
1770  return aValues;
1771  }
1772  }
1773  }
1774  }
1775  catch (const NoSuchElementException&)
1776  {
1777  // getByHierarchicalName
1778  }
1779  }
1780 
1781  return Sequence< PropertyValue >( 0 );
1782 }
1783 
1784 
1785 // virtual
1787  const Sequence< PropertyValue >& aProps )
1788 {
1789  if ( !aProps.hasElements() )
1790  return;
1791 
1792  osl::ClearableGuard< osl::Mutex > aCGuard( m_aMutex );
1793 
1794  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
1795  m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1796  if ( xRootHierNameAccess.is() )
1797  {
1798  std::vector< PropertyChangeEvent > aEvents;
1799 
1800  OUString aFullPropNamePrefix( getFullKey() + "/" );
1801 
1802  // Iterate over given property value sequence.
1803  for ( const PropertyValue& rNewValue : aProps )
1804  {
1805  const OUString& rName = rNewValue.Name;
1806 
1807  OUString aFullPropName = aFullPropNamePrefix;
1808  aFullPropName += makeHierarchalNameSegment( rName );
1809 
1810  // Does property exist?
1811  if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1812  {
1813  Reference< XNameReplace > xNameReplace(
1814  m_pCreator->getConfigWriteAccess(
1815  aFullPropName ), UNO_QUERY );
1817  m_pCreator->getConfigWriteAccess(
1818  OUString() ), UNO_QUERY );
1819 
1820  if ( xNameReplace.is() && xBatch.is() )
1821  {
1822  try
1823  {
1824  // Write handle
1825  xNameReplace->replaceByName(
1826  "Handle",
1827  makeAny( rNewValue.Handle ) );
1828 
1829  // Save old value
1830  OUString aValueName = aFullPropName +"/Value";
1831  Any aOldValue
1832  = xRootHierNameAccess->getByHierarchicalName(
1833  aValueName );
1834  // Write value
1835  xNameReplace->replaceByName(
1836  "Value",
1837  rNewValue.Value );
1838 
1839  // Write state ( Now it is a directly set value )
1840  xNameReplace->replaceByName(
1841  "State",
1842  makeAny(
1843  sal_Int32(
1844  PropertyState_DIRECT_VALUE ) ) );
1845 
1846  // Commit changes.
1847  xBatch->commitChanges();
1848 
1850  {
1851  PropertyChangeEvent aEvt;
1852  aEvt.Source = static_cast<OWeakObject*>(this);
1853  aEvt.PropertyName = rNewValue.Name;
1854  aEvt.PropertyHandle = rNewValue.Handle;
1855  aEvt.Further = false;
1856  aEvt.OldValue = aOldValue;
1857  aEvt.NewValue = rNewValue.Value;
1858 
1859  aEvents.push_back( aEvt );
1860  }
1861  }
1862  catch (const IllegalArgumentException&)
1863  {
1864  // replaceByName
1865  }
1866  catch (const NoSuchElementException&)
1867  {
1868  // getByHierarchicalName, replaceByName
1869  }
1870  catch (const WrappedTargetException&)
1871  {
1872  // replaceByName, commitChanges
1873  }
1874  }
1875  }
1876  }
1877 
1878  // Callback follows!
1879  aCGuard.clear();
1880 
1882  {
1883  // Notify property changes.
1884  for (auto const& event : aEvents)
1885  {
1886  notifyPropertyChangeEvent( event );
1887  }
1888  }
1889 
1890  return;
1891  }
1892 
1893  OSL_FAIL( "PersistentPropertySet::setPropertyValues - Nothing set!" );
1894 }
1895 
1896 
1897 // Non-interface methods
1898 
1899 
1901  const PropertyChangeEvent& rEvent ) const
1902 {
1903  // Get "normal" listeners for the property.
1904  OInterfaceContainerHelper* pContainer =
1905  m_pPropertyChangeListeners->getContainer(
1906  rEvent.PropertyName );
1907  if ( pContainer && pContainer->getLength() )
1908  {
1909  OInterfaceIteratorHelper aIter( *pContainer );
1910  while ( aIter.hasMoreElements() )
1911  {
1912  // Propagate event.
1914  aIter.next(), UNO_QUERY );
1915  if ( xListener.is() )
1916  xListener->propertyChange( rEvent );
1917  }
1918  }
1919 
1920  // Get "normal" listeners for all properties.
1921  OInterfaceContainerHelper* pNoNameContainer =
1922  m_pPropertyChangeListeners->getContainer( OUString() );
1923  if ( pNoNameContainer && pNoNameContainer->getLength() )
1924  {
1925  OInterfaceIteratorHelper aIter( *pNoNameContainer );
1926  while ( aIter.hasMoreElements() )
1927  {
1928  // Propagate event.
1930  aIter.next(), UNO_QUERY );
1931  if ( xListener.is() )
1932  xListener->propertyChange( rEvent );
1933  }
1934  }
1935 }
1936 
1937 
1939  const PropertySetInfoChangeEvent& evt ) const
1940 {
1942  return;
1943 
1944  // Notify event listeners.
1946  while ( aIter.hasMoreElements() )
1947  {
1948  // Propagate event.
1950  xListener( aIter.next(), UNO_QUERY );
1951  if ( xListener.is() )
1952  xListener->propertySetInfoChange( evt );
1953  }
1954 }
1955 
1956 
1958 {
1959  if ( m_aFullKey.isEmpty() )
1960  {
1961  osl::Guard< osl::Mutex > aGuard( m_aMutex );
1962  if ( m_aFullKey.isEmpty() )
1963  {
1965  m_aFullKey += "/Values";
1966  }
1967  }
1968 
1969  return m_aFullKey;
1970 }
1971 
1972 
1974 {
1975  return *m_pCreator;
1976 }
1977 
1978 
1979 // PropertySetInfo_Impl Implementation.
1980 
1981 
1983  PersistentPropertySet* pOwner )
1984 : m_pOwner( pOwner )
1985 {
1986 }
1987 
1988 
1989 // XPropertySetInfo methods.
1990 
1991 
1992 // virtual
1994 {
1995  if ( !m_xProps )
1996  {
1997  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
1999  UNO_QUERY );
2000  if ( xRootHierNameAccess.is() )
2001  {
2002  try
2003  {
2004  Reference< XNameAccess > xNameAccess;
2005  xRootHierNameAccess->getByHierarchicalName(
2006  m_pOwner->getFullKey() )
2007  >>= xNameAccess;
2008  if ( xNameAccess.is() )
2009  {
2010  // Obtain property names.
2011 
2012  Sequence< OUString > aElems
2013  = xNameAccess->getElementNames();
2014 
2015  sal_uInt32 nCount = aElems.getLength();
2016  Sequence< Property > aPropSeq( nCount );
2017 
2018  if ( nCount )
2019  {
2020  Reference< XHierarchicalNameAccess > xHierNameAccess(
2021  xNameAccess, UNO_QUERY );
2022 
2023  OSL_ENSURE( xHierNameAccess.is(),
2024  "PropertySetInfo_Impl::getProperties - "
2025  "No hierarchical name access!" );
2026 
2027  if ( xHierNameAccess.is() )
2028  {
2029  static const OUStringLiteral aHandleName(u"/Handle");
2030  static const OUStringLiteral aValueName(u"/Value");
2031  static const OUStringLiteral aAttrName(u"/Attributes");
2032 
2033  Property* pProps = aPropSeq.getArray();
2034 
2035  for ( sal_uInt32 n = 0; n < nCount; ++n )
2036  {
2037  Property& rProp = pProps[ n ];
2038  OUString rName = aElems[ n ];
2039  OUString aXMLName
2040  = makeHierarchalNameSegment( rName );
2041 
2042  // Set property name.
2043 
2044  rProp.Name = rName;
2045 
2046  try
2047  {
2048  // Obtain and set property handle
2049  OUString aHierName = aXMLName + aHandleName;
2050  Any aKeyValue
2051  = xHierNameAccess->getByHierarchicalName(
2052  aHierName );
2053 
2054  if ( !( aKeyValue >>= rProp.Handle ) )
2055  OSL_FAIL( "PropertySetInfo_Impl::getProperties - "
2056  "Error getting property handle!" );
2057  }
2058  catch (const NoSuchElementException&)
2059  {
2060  // getByHierarchicalName
2061 
2062  OSL_FAIL( "PropertySetInfo_Impl::getProperties - "
2063  "NoSuchElementException!" );
2064  }
2065 
2066  try
2067  {
2068  // Obtain and set property type
2069  OUString aHierName = aXMLName + aValueName;
2070  Any aKeyValue
2071  = xHierNameAccess->getByHierarchicalName(
2072  aHierName );
2073 
2074  // Note: The type may be void if addProperty
2075  // was called with a default value
2076  // of type void.
2077 
2078  rProp.Type = aKeyValue.getValueType();
2079  }
2080  catch (const NoSuchElementException&)
2081  {
2082  // getByHierarchicalName
2083 
2084  OSL_FAIL( "PropertySetInfo_Impl::getProperties - "
2085  "NoSuchElementException!" );
2086  }
2087 
2088  try
2089  {
2090  // Obtain and set property attributes
2091  OUString aHierName = aXMLName + aAttrName;
2092  Any aKeyValue
2093  = xHierNameAccess->getByHierarchicalName(
2094  aHierName );
2095 
2096  sal_Int32 nAttribs = 0;
2097  if ( aKeyValue >>= nAttribs )
2098  rProp.Attributes
2099  = sal_Int16( nAttribs );
2100  else
2101  OSL_FAIL( "PropertySetInfo_Impl::getProperties - "
2102  "Error getting property attributes!" );
2103  }
2104  catch (const NoSuchElementException&)
2105  {
2106  // getByHierarchicalName
2107 
2108  OSL_FAIL( "PropertySetInfo_Impl::getProperties - "
2109  "NoSuchElementException!" );
2110  }
2111  }
2112  }
2113  }
2114 
2115  // Success.
2116  m_xProps = std::move(aPropSeq);
2117  return *m_xProps;
2118  }
2119  }
2120  catch (const NoSuchElementException&)
2121  {
2122  // getByHierarchicalName
2123  }
2124  }
2125 
2126  OSL_FAIL( "PropertySetInfo_Impl::getProperties - Error!" );
2127  m_xProps.emplace();
2128  }
2129 
2130  return *m_xProps;
2131 }
2132 
2133 
2134 // virtual
2136  const OUString& aName )
2137 {
2138  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
2140  UNO_QUERY );
2141  if ( xRootHierNameAccess.is() )
2142  {
2143  OUString aFullPropName( m_pOwner->getFullKey() + "/" );
2144  aFullPropName += makeHierarchalNameSegment( aName );
2145 
2146  // Does property exist?
2147  if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
2148  throw UnknownPropertyException(aFullPropName);
2149 
2150  try
2151  {
2152  Property aProp;
2153 
2154  // Obtain handle.
2155  OUString aKey = aFullPropName + "/Handle";
2156 
2157  if ( !( xRootHierNameAccess->getByHierarchicalName( aKey )
2158  >>= aProp.Handle ) )
2159  {
2160  OSL_FAIL( "PropertySetInfo_Impl::getPropertyByName - "
2161  "No handle!" );
2162  return Property();
2163  }
2164 
2165  // Obtain Value and extract type.
2166  aKey = aFullPropName + "/Value";
2167 
2168  Any aValue = xRootHierNameAccess->getByHierarchicalName( aKey );
2169  if ( !aValue.hasValue() )
2170  {
2171  OSL_FAIL( "PropertySetInfo_Impl::getPropertyByName - "
2172  "No Value!" );
2173  return Property();
2174  }
2175 
2176  aProp.Type = aValue.getValueType();
2177 
2178  // Obtain Attributes.
2179  aKey = aFullPropName + "/Attributes";
2180 
2181  sal_Int32 nAttribs = 0;
2182  if ( xRootHierNameAccess->getByHierarchicalName( aKey )
2183  >>= nAttribs )
2184  aProp.Attributes = sal_Int16( nAttribs );
2185  else
2186  {
2187  OSL_FAIL( "PropertySetInfo_Impl::getPropertyByName - "
2188  "No attributes!" );
2189  return Property();
2190  }
2191 
2192  // set name.
2193  aProp.Name = aName;
2194 
2195  // Success.
2196  return aProp;
2197  }
2198  catch (const NoSuchElementException&)
2199  {
2200  // getByHierarchicalName
2201 
2202  OSL_FAIL( "PropertySetInfo_Impl::getPropertyByName - "
2203  "caught NoSuchElementException!" );
2204  }
2205 
2206  }
2207 
2208  OSL_FAIL( "PropertySetInfo_Impl::getPropertyByName - Error!" );
2209  return Property();
2210 }
2211 
2212 
2213 // virtual
2215  const OUString& Name )
2216 {
2217  Reference< XHierarchicalNameAccess > xRootHierNameAccess(
2219  UNO_QUERY );
2220  if ( xRootHierNameAccess.is() )
2221  {
2222  OUString aFullPropName( m_pOwner->getFullKey() + "/" );
2223  aFullPropName += makeHierarchalNameSegment( Name );
2224 
2225  return xRootHierNameAccess->hasByHierarchicalName( aFullPropName );
2226  }
2227 
2228  return false;
2229 }
2230 
2231 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void remove(PersistentPropertySet *pSet)
Definition: ucbstore.cxx:519
virtual OUString SAL_CALL getImplementationName() override
Definition: ucbstore.cxx:142
css::uno::Reference< css::uno::XInterface > m_xRootWriteAccess
Definition: ucbstore.hxx:89
virtual OUString SAL_CALL getName() override
Definition: ucbstore.cxx:1315
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
Definition: ucbstore.cxx:477
rtl::Reference< PropertySetInfo_Impl > m_pInfo
Definition: ucbstore.hxx:157
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: ucbstore.cxx:1275
PropertySetRegistry(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Sequence< css::uno::Any > &rInitArgs)
Definition: ucbstore.cxx:201
osl::Mutex m_aMutex
virtual css::uno::Reference< css::ucb::XPropertySetRegistry > SAL_CALL getRegistry() override
Definition: ucbstore.cxx:1298
virtual css::uno::Type SAL_CALL getElementType() override
Definition: ucbstore.cxx:425
css::uno::Reference< css::ucb::XPropertySetRegistry > m_xTheRegistry
Definition: ucbstore.hxx:51
PersistentPropertySet(PropertySetRegistry &rCreator, const OUString &rKey)
Definition: ucbstore.cxx:1017
sal_Int64 n
virtual ~PropertySetRegistry() override
Definition: ucbstore.cxx:213
virtual Sequence< Property > SAL_CALL getProperties() override
Definition: ucbstore.cxx:1993
virtual OUString SAL_CALL getImplementationName() override
Definition: ucbstore.cxx:1036
std::unique_ptr< comphelper::OInterfaceContainerHelper2 > m_pPropSetChangeListeners
Definition: ucbstore.hxx:162
static OUString makeHierarchalNameSegment(const OUString &rIn)
Definition: ucbstore.cxx:62
mutable::osl::Mutex m_aMutex
css::uno::XInterface *SAL_CALL next()
bool m_bTriedToGetRootWriteAccess
Definition: ucbstore.hxx:92
void renamePropertySet(const OUString &rOldKey, const OUString &rNewKey)
Definition: ucbstore.cxx:539
css::uno::Any const & rValue
#define STORE_CONTENTPROPERTIES_KEY
Definition: ucbstore.cxx:103
sal_uInt16 sal_Unicode
virtual void SAL_CALL removePropertySet(const OUString &key) override
Definition: ucbstore.cxx:366
Sequence< PropertyValue > aArguments
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() override
Definition: ucbstore.cxx:1658
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: ucbstore.cxx:1123
virtual ~PersistentPropertySet() override
Definition: ucbstore.cxx:1028
virtual OUString SAL_CALL getImplementationName() override
Definition: ucbstore.cxx:221
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: ucbstore.hxx:49
css::uno::Reference< css::uno::XInterface > getConfigWriteAccess(const OUString &rPath)
Definition: ucbstore.cxx:931
UcbStore(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Definition: ucbstore.cxx:130
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: ucbstore.cxx:1046
int nCount
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual ~UcbStore() override
Definition: ucbstore.cxx:138
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: ucbstore.cxx:1041
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ucb_UcbStore_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: ucbstore.cxx:158
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
Definition: ucbstore.cxx:190
PersistentPropertySet * m_pOwner
Definition: ucbstore.cxx:112
sal_Int32 nHandle
#define CFGPROPERTY_NODEPATH
Definition: ucbstore.cxx:106
virtual sal_Bool SAL_CALL hasElements() override
Definition: ucbstore.cxx:432
const css::uno::Sequence< css::uno::Any > m_aInitArgs
Definition: ucbstore.hxx:85
virtual void SAL_CALL removePropertySetInfoChangeListener(const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override
Definition: ucbstore.cxx:1646
rtl::Reference< PropertySetRegistry > m_pCreator
Definition: ucbstore.hxx:156
sal_Int32 SAL_CALL getLength() const
#define TOOLS_WARN_EXCEPTION(area, stream)
PropertySetMap_Impl m_aPropSets
Definition: ucbstore.hxx:86
friend class PersistentPropertySet
Definition: ucbstore.hxx:82
class SAL_NO_VTABLE XPropertySet
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
ContentProvider * m_pOwner
Definition: pkgprovider.cxx:57
virtual void SAL_CALL addPropertySetInfoChangeListener(const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override
Definition: ucbstore.cxx:1634
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: ucbstore.cxx:231
virtual Property SAL_CALL getPropertyByName(const OUString &aName) override
Definition: ucbstore.cxx:2135
void add(PersistentPropertySet *pSet)
Definition: ucbstore.cxx:507
void notifyPropertySetInfoChange(const css::beans::PropertySetInfoChangeEvent &evt) const
Definition: ucbstore.cxx:1938
const OUString & getFullKey()
Definition: ucbstore.cxx:1957
float u
unsigned char sal_Bool
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
Definition: ucbstore.cxx:449
std::unique_ptr< comphelper::OInterfaceContainerHelper2 > m_pDisposeEventListeners
Definition: ucbstore.hxx:161
css::uno::Type const & get()
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: ucbstore.cxx:1285
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: ucbstore.cxx:226
css::uno::Reference< css::uno::XInterface > getRootConfigReadAccess()
Definition: ucbstore.cxx:876
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: ucbstore.cxx:1084
virtual void SAL_CALL dispose() override
Definition: ucbstore.cxx:1056
PropertySetInfo_Impl(PersistentPropertySet *pOwner)
Definition: ucbstore.cxx:1982
bool m_bTriedToGetRootReadAccess
Definition: ucbstore.hxx:91
css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider
Definition: ucbstore.hxx:87
css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider()
Definition: ucbstore.cxx:840
virtual void SAL_CALL setName(const OUString &aName) override
Definition: ucbstore.cxx:1323
std::optional< Sequence< Property > > m_xProps
Definition: ucbstore.cxx:111
osl::Mutex m_aMutex
Definition: ucbstore.hxx:90
std::unique_ptr< char[]> aBuffer
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
Definition: ucbstore.cxx:492
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: ucbstore.cxx:146
void notifyPropertyChangeEvent(const css::beans::PropertyChangeEvent &rEvent) const
Definition: ucbstore.cxx:1900
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: ucbstore.cxx:1260
virtual css::uno::Reference< css::ucb::XPersistentPropertySet > SAL_CALL openPropertySet(const OUString &key, sal_Bool create) override
Definition: ucbstore.cxx:242
std::unique_ptr< PropertyListeners_Impl > m_pPropertyChangeListeners
Definition: ucbstore.hxx:163
Reference< XPropertySet > m_xProps
cppu::OMultiTypeInterfaceContainerHelperVar< OUString > PropertyListeners_Impl
Definition: ucbstore.hxx:144
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: ucbstore.cxx:1786
virtual void SAL_CALL removeProperty(const OUString &Name) override
Definition: ucbstore.cxx:1493
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: ucbstore.cxx:150
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: ucbstore.cxx:1110
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: ucbstore.cxx:1218
#define SAL_WARN(area, stream)
css::uno::XInterface * next()
virtual sal_Bool SAL_CALL hasPropertyByName(const OUString &Name) override
Definition: ucbstore.cxx:2214
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
Definition: ucbstore.cxx:1096
Reference< XComponentContext > m_xContext
virtual OUString SAL_CALL getKey() override
Definition: ucbstore.cxx:1305
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: ucbstore.hxx:84
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: ucbstore.cxx:1244
sal_Int32 nState
css::uno::Sequence< css::uno::Any > m_aInitArgs
Definition: ucbstore.hxx:50
std::unordered_map< OUString, PersistentPropertySet * > PropertySetMap_Impl
Definition: ucbstore.hxx:72
virtual css::uno::Reference< css::ucb::XPropertySetRegistry > SAL_CALL createPropertySetRegistry(const OUString &URL) override
Definition: ucbstore.cxx:170
bool SAL_CALL hasMoreElements() const
css::uno::Reference< css::uno::XInterface > m_xRootReadAccess
Definition: ucbstore.hxx:88
cppu::WeakComponentImplHelper< css::lang::XServiceInfo, css::ucb::XPropertySetRegistryFactory, css::lang::XInitialization > UcbStore_Base
Definition: ucbstore.hxx:45
PropertySetRegistry & getPropertySetRegistry()
Definition: ucbstore.cxx:1973
virtual void SAL_CALL addProperty(const OUString &Name, sal_Int16 Attributes, const css::uno::Any &DefaultValue) override
Definition: ucbstore.cxx:1334
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)