28#include <unordered_map>
31#include <rtl/ustrbuf.hxx>
35#include <com/sun/star/beans/IllegalTypeException.hpp>
36#include <com/sun/star/beans/NotRemoveableException.hpp>
37#include <com/sun/star/beans/PropertyAttribute.hpp>
38#include <com/sun/star/beans/PropertyExistException.hpp>
39#include <com/sun/star/beans/PropertySetInfoChange.hpp>
40#include <com/sun/star/configuration/theDefaultProvider.hpp>
41#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
42#include <com/sun/star/container/XNameContainer.hpp>
43#include <com/sun/star/container/XNameReplace.hpp>
44#include <com/sun/star/util/XChangesBatch.hpp>
45#include <com/sun/star/lang/XSingleServiceFactory.hpp>
66 size_t nCount = rIn.size();
99 return aBuffer.makeStringAndClear();
109 std::optional<Sequence< Property >>
142 return "com.sun.star.comp.ucb.UcbStore";
150 return {
"com.sun.star.ucb.Store" };
155extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
157 css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any>
const&)
159 return cppu::acquire(
new UcbStore(context));
175 std::unique_lock aGuard(
m_aMutex );
190 std::unique_lock aGuard(
m_aMutex );
203, m_aInitArgs(rInitArgs)
204, m_bTriedToGetRootReadAccess(false)
205, m_bTriedToGetRootWriteAccess(false)
221 return "com.sun.star.comp.ucb.PropertySetRegistry";
231 return {
"com.sun.star.ucb.PropertySetRegistry" };
245 std::unique_lock aGuard(
m_aMutex );
249 PropertySetMap_Impl::const_iterator it = rSets.find( key );
250 if ( it != rSets.end() )
257 if ( !xRootNameAccess.is() )
259 SAL_WARN(
"ucb",
"no root access" );
264 if ( xRootNameAccess->hasByName( key ) )
269 aGuard, *
this, key ) );
280 OSL_ENSURE( xFac.is(),
281 "PropertySetRegistry::openPropertySet - "
284 OSL_ENSURE( xBatch.is(),
285 "PropertySetRegistry::openPropertySet - "
288 OSL_ENSURE( xContainer.is(),
289 "PropertySetRegistry::openPropertySet - "
292 if ( xFac.is() && xBatch.is() && xContainer.is() )
298 xFac->createInstance(), UNO_QUERY );
300 if ( xNameReplace.is() )
305 xContainer->insertByName(
306 key,
Any( xNameReplace ) );
308 xBatch->commitChanges();
312 aGuard, *
this, key ) );
315 catch (
const IllegalArgumentException&)
319 OSL_FAIL(
"PropertySetRegistry::openPropertySet - "
320 "caught IllegalArgumentException!" );
322 catch (
const ElementExistException&)
326 OSL_FAIL(
"PropertySetRegistry::openPropertySet - "
327 "caught ElementExistException!" );
329 catch (
const WrappedTargetException&)
333 OSL_FAIL(
"PropertySetRegistry::openPropertySet - "
334 "caught WrappedTargetException!" );
338 OSL_FAIL(
"PropertySetRegistry::openPropertySet - "
339 "caught RuntimeException!" );
345 OSL_FAIL(
"PropertySetRegistry::openPropertySet - "
346 "caught Exception!" );
356 SAL_WARN(
"ucb",
"no root access" );
368 std::unique_lock aGuard(
m_aMutex );
372 if ( xRootNameAccess.is() )
375 if ( !xRootNameAccess->hasByName( key ) )
381 if ( xBatch.is() && xContainer.is() )
386 xContainer->removeByName( key );
388 xBatch->commitChanges();
393 catch (
const NoSuchElementException&)
397 OSL_FAIL(
"PropertySetRegistry::removePropertySet - "
398 "caught NoSuchElementException!" );
401 catch (
const WrappedTargetException&)
405 OSL_FAIL(
"PropertySetRegistry::removePropertySet - "
406 "caught WrappedTargetException!" );
414 SAL_WARN(
"ucb",
"no root access" );
433 if ( xElemAccess.is() )
434 return xElemAccess->hasElements();
448 if ( xNameAccess.is() )
453 return xNameAccess->getByName(
aName );
455 catch (
const NoSuchElementException&)
459 catch (
const WrappedTargetException&)
474 if ( xNameAccess.is() )
476 return xNameAccess->getElementNames();
487 if ( xNameAccess.is() )
489 return xNameAccess->hasByName(
aName );
497 std::unique_lock<std::mutex>& ,
500 OUString key( pSet->
getKey() );
502 if ( !key.isEmpty() )
511 OUString key( pSet->
getKey() );
516 std::unique_lock aGuard(
m_aMutex );
520 PropertySetMap_Impl::iterator it = rSets.find( key );
521 if ( it != rSets.end() )
530 const OUString& rNewKey )
532 if ( rOldKey == rNewKey )
537 if ( xRootNameAccess.is() )
540 if ( xRootNameAccess->hasByName( rOldKey ) )
543 if ( xRootNameAccess->hasByName( rNewKey ) )
545 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
550 xRootNameAccess, UNO_QUERY );
554 OSL_ENSURE( xFac.is(),
555 "PropertySetRegistry::renamePropertySet - "
558 OSL_ENSURE( xBatch.is(),
559 "PropertySetRegistry::renamePropertySet - "
562 OSL_ENSURE( xContainer.is(),
563 "PropertySetRegistry::renamePropertySet - "
566 if ( xFac.is() && xBatch.is() && xContainer.is() )
575 xFac->createInstance(), UNO_QUERY );
577 if ( xNameReplace.is() )
580 xContainer->insertByName(
581 rNewKey,
Any( xNameReplace ) );
583 xBatch->commitChanges();
586 catch (
const IllegalArgumentException&)
590 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
591 "caught IllegalArgumentException!" );
594 catch (
const ElementExistException&)
598 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
599 "caught ElementExistException!" );
602 catch (
const WrappedTargetException&)
606 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
607 "caught WrappedTargetException!" );
612 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
613 "caught RuntimeException!" );
620 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
621 "caught Exception!" );
630 xRootNameAccess, UNO_QUERY );
631 if ( !xRootHierNameAccess.is() )
633 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
634 "No hierarchical name access!" );
640 OUString aOldValuesKey
644 xRootHierNameAccess->getByHierarchicalName(
647 if ( !xOldNameAccess.is() )
649 OSL_FAIL(
"PersistentPropertySet::renamePropertySet - "
650 "No old name access!" );
656 = xOldNameAccess->getElementNames();
657 if ( aElems.hasElements() )
659 OUString aNewValuesKey
663 xRootHierNameAccess->getByHierarchicalName(
668 OSL_FAIL(
"PersistentPropertySet::renamePropertySet - "
674 xNewFac, UNO_QUERY );
675 if ( !xNewContainer.is() )
677 OSL_FAIL(
"PersistentPropertySet::renamePropertySet - "
678 "No new container!" );
682 aOldValuesKey +=
"/";
684 for (
const OUString& rPropName : aElems )
688 xNewFac->createInstance(), UNO_QUERY );
690 if ( !xNewPropNameReplace.is() )
692 OSL_FAIL(
"PersistentPropertySet::renamePropertySet - "
693 "No new prop name replace!" );
703 OUString aNewKey1 = aKey +
"/Handle";
705 xRootHierNameAccess->getByHierarchicalName(
707 xNewPropNameReplace->replaceByName(
"Handle", aAny );
710 aNewKey1 = aKey +
"/Value";
712 xRootHierNameAccess->getByHierarchicalName(
714 xNewPropNameReplace->replaceByName(
"Value", aAny );
717 aNewKey1 = aKey +
"/State";
719 xRootHierNameAccess->getByHierarchicalName(
721 xNewPropNameReplace->replaceByName(
"State", aAny );
724 aNewKey1 = aKey +
"/Attributes";
726 xRootHierNameAccess->getByHierarchicalName(
728 xNewPropNameReplace->replaceByName(
"Attributes", aAny );
731 xNewContainer->insertByName(
732 rPropName,
Any( xNewPropNameReplace ) );
735 xBatch->commitChanges();
739 catch (
const IllegalArgumentException&)
743 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
744 "caught IllegalArgumentException!" );
747 catch (
const ElementExistException&)
751 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
752 "caught ElementExistException!" );
755 catch (
const WrappedTargetException&)
759 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
760 "caught WrappedTargetException!" );
763 catch (
const NoSuchElementException&)
767 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
768 "caught NoSuchElementException!" );
773 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
774 "caught RuntimeException!" );
781 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
782 "caught Exception!" );
793 xContainer->removeByName( rOldKey );
795 xBatch->commitChanges();
800 catch (
const NoSuchElementException&)
804 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
805 "caught NoSuchElementException!" );
808 catch (
const WrappedTargetException&)
812 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - "
813 "caught WrappedTargetException!" );
820 OSL_FAIL(
"PropertySetRegistry::renamePropertySet - Error!" );
830 if ( rInitArgs.hasElements() )
836 "PropertySetRegistry::getConfigProvider - "
837 "No config provider!" );
858 std::unique_lock aGuard(
m_aMutex );
870 OSL_FAIL(
"PropertySetRegistry::getRootConfigReadAccess - "
871 "Unable to read any config data! -> #82494#" );
888 "com.sun.star.configuration.ConfigurationAccess",
916 const OUString& rPath )
918 std::unique_lock aGuard(
m_aMutex );
923 const OUString& rPath )
931 OSL_FAIL(
"PropertySetRegistry::getConfigWriteAccess - "
932 "Unable to write any config data! -> #82494#" );
949 "com.sun.star.configuration.ConfigurationUpdateAccess",
953 "PropertySetRegistry::getConfigWriteAccess - "
954 "No config update access!" );
960 if ( !rPath.isEmpty() )
967 xNA->getByHierarchicalName( rPath ) >>= xInterface;
969 if ( xInterface.is() )
981 catch (
const NoSuchElementException&)
985 OSL_FAIL(
"PropertySetRegistry::getConfigWriteAccess - "
986 "caught NoSuchElementException!" );
993 OSL_FAIL(
"PropertySetRegistry::getConfigWriteAccess - "
994 "caught Exception!" );
998 OSL_FAIL(
"PropertySetRegistry::getConfigWriteAccess - Error!" );
1007 std::unique_lock<std::mutex>& rCreatorGuard,
1010: m_pCreator( &rCreator ), m_aKey(
std::move( aKey ))
1013 rCreator.
add( rCreatorGuard,
this );
1028 return "com.sun.star.comp.ucb.PersistentPropertySet";
1038 return {
"com.sun.star.ucb.PersistentPropertySet" };
1052 aEvt.Source =
static_cast< XComponent *
>( this );
1059 aEvt.Source =
static_cast< XPropertySetInfoChangeNotifier *
>( this );
1113 std::unique_lock aCGuard(
m_aMutex);
1116 m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1117 if ( xRootHierNameAccess.is() )
1123 if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1127 aFullPropName ), UNO_QUERY );
1130 OUString() ), UNO_QUERY );
1132 if ( xNameReplace.is() && xBatch.is() )
1137 OUString aValueName = aFullPropName +
"/Value";
1139 = xRootHierNameAccess->getByHierarchicalName(
1142 if ( aOldValue.getValueType() != aValue.getValueType() )
1144 throw IllegalArgumentException();
1148 xNameReplace->replaceByName(
"Value", aValue );
1151 xNameReplace->replaceByName(
1155 PropertyState_DIRECT_VALUE ) ) );
1158 xBatch->commitChanges();
1160 PropertyChangeEvent aEvt;
1164 aValueName = aFullPropName +
"/Handle";
1166 xRootHierNameAccess->getByHierarchicalName( aValueName )
1169 aEvt.Source = getXWeak();
1170 aEvt.PropertyName = aPropertyName;
1171 aEvt.PropertyHandle =
nHandle;
1172 aEvt.Further =
false;
1173 aEvt.OldValue = aOldValue;
1174 aEvt.NewValue = aValue;
1180 catch (
const IllegalArgumentException&)
1184 catch (
const NoSuchElementException&)
1188 catch (
const WrappedTargetException&)
1196 throw UnknownPropertyException(aPropertyName);
1202 const OUString& PropertyName )
1207 m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1208 if ( xNameAccess.is() )
1214 return xNameAccess->getByHierarchicalName( aFullPropName );
1216 catch (
const NoSuchElementException&)
1218 throw UnknownPropertyException(aFullPropName);
1222 throw UnknownPropertyException(PropertyName);
1228 const OUString& aPropertyName,
1241 const OUString& aPropertyName,
1249 aPropertyName, aListener );
1316 const OUString& Name, sal_Int16 Attributes,
const Any& DefaultValue )
1318 if (
Name.isEmpty() )
1319 throw IllegalArgumentException();
1324 TypeClass eTypeClass = DefaultValue.getValueTypeClass();
1325 if ( eTypeClass == TypeClass_INTERFACE )
1326 throw IllegalTypeException();
1332 OUString aFullValuesName;
1335 m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1336 if ( xRootHierNameAccess.is() )
1339 OUString aFullPropName = aFullValuesName +
"/" +
1342 if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1345 throw PropertyExistException();
1350 Attributes |= PropertyAttribute::REMOVABLE;
1355 m_pCreator->getConfigWriteAccess( aFullValuesName ),
1359 m_pCreator->getConfigWriteAccess( OUString() ),
1362 OSL_ENSURE( xFac.is(),
1363 "PersistentPropertySet::addProperty - No factory!" );
1365 OSL_ENSURE( xBatch.is(),
1366 "PersistentPropertySet::addProperty - No batch!" );
1368 OSL_ENSURE( xContainer.is(),
1369 "PersistentPropertySet::addProperty - No container!" );
1371 if ( xFac.is() && xBatch.is() && xContainer.is() )
1377 xFac->createInstance(), UNO_QUERY );
1379 if ( xNameReplace.is() )
1384 xNameReplace->replaceByName(
1386 Any( sal_Int32( -1 ) ) );
1389 xNameReplace->replaceByName(
1394 xNameReplace->replaceByName(
1398 PropertyState_DEFAULT_VALUE ) ) );
1401 xNameReplace->replaceByName(
1403 Any( sal_Int32( Attributes ) ) );
1406 xContainer->insertByName(
Name,
Any( xNameReplace ) );
1409 xBatch->commitChanges();
1418 PropertySetInfoChangeEvent evt(
1422 PropertySetInfoChange::PROPERTY_INSERTED );
1430 catch (
const IllegalArgumentException&)
1434 OSL_FAIL(
"PersistentPropertySet::addProperty - "
1435 "caught IllegalArgumentException!" );
1438 catch (
const ElementExistException&)
1442 OSL_FAIL(
"PersistentPropertySet::addProperty - "
1443 "caught ElementExistException!" );
1446 catch (
const WrappedTargetException&)
1450 OSL_FAIL(
"PersistentPropertySet::addProperty - "
1451 "caught WrappedTargetException!" );
1462 OSL_FAIL(
"PersistentPropertySet::addProperty - "
1463 "caught Exception!" );
1468 OSL_FAIL(
"PersistentPropertySet::addProperty - Error!" );
1478 m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1479 if ( xRootHierNameAccess.is() )
1482 OUString aFullPropName = aFullValuesName +
"/" +
1486 if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1487 throw UnknownPropertyException(aFullPropName);
1492 OUString aFullAttrName = aFullPropName +
"/Attributes";
1494 sal_Int32 nAttribs = 0;
1495 if ( xRootHierNameAccess->getByHierarchicalName( aFullAttrName )
1498 if ( !( nAttribs & PropertyAttribute::REMOVABLE ) )
1501 throw NotRemoveableException();
1506 OSL_FAIL(
"PersistentPropertySet::removeProperty - "
1511 catch (
const NoSuchElementException&)
1515 OSL_FAIL(
"PersistentPropertySet::removeProperty - "
1516 "caught NoSuchElementException!" );
1522 m_pCreator->getConfigWriteAccess( aFullValuesName ),
1525 m_pCreator->getConfigWriteAccess( OUString() ),
1528 OSL_ENSURE( xBatch.is(),
1529 "PersistentPropertySet::removeProperty - No batch!" );
1531 OSL_ENSURE( xContainer.is(),
1532 "PersistentPropertySet::removeProperty - No container!" );
1534 if ( xBatch.is() && xContainer.is() )
1547 OUString aFullHandleName = aFullPropName +
"/Handle";
1549 if ( ! ( xRootHierNameAccess->getByHierarchicalName(
1550 aFullHandleName ) >>=
nHandle ) )
1554 catch (
const NoSuchElementException&)
1558 OSL_FAIL(
"PersistentPropertySet::removeProperty - "
1559 "caught NoSuchElementException!" );
1564 xContainer->removeByName(
Name );
1565 xBatch->commitChanges();
1574 PropertySetInfoChangeEvent evt(
1578 PropertySetInfoChange::PROPERTY_REMOVED );
1585 catch (
const NoSuchElementException&)
1589 OSL_FAIL(
"PersistentPropertySet::removeProperty - "
1590 "caught NoSuchElementException!" );
1593 catch (
const WrappedTargetException&)
1597 OSL_FAIL(
"PersistentPropertySet::removeProperty - "
1598 "caught WrappedTargetException!" );
1604 OSL_FAIL(
"PersistentPropertySet::removeProperty - Error!" );
1639 m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1640 if ( xRootHierNameAccess.is() )
1645 xRootHierNameAccess->getByHierarchicalName(
getFullKeyImpl(aGuard))
1647 if ( xNameAccess.is() )
1653 sal_Int32
nCount = aElems.getLength();
1657 xNameAccess, UNO_QUERY );
1659 OSL_ENSURE( xHierNameAccess.is(),
1660 "PersistentPropertySet::getPropertyValues - "
1661 "No hierarchical name access!" );
1663 if ( xHierNameAccess.is() )
1666 auto pValues = aValues.getArray();
1668 static constexpr OUStringLiteral aHandleName(
u"/Handle");
1669 static constexpr OUStringLiteral aValueName(
u"/Value");
1670 static constexpr OUStringLiteral aStateName(
u"/State");
1672 for ( sal_Int32
n = 0;
n <
nCount; ++
n )
1674 PropertyValue& rValue =
pValues[
n ];
1675 OUString rName = aElems[
n ];
1681 rValue.Name = rName;
1686 OUString aHierName = aXMLName + aHandleName;
1688 = xHierNameAccess->getByHierarchicalName(
1691 if ( !( aKeyValue >>= rValue.Handle ) )
1692 OSL_FAIL(
"PersistentPropertySet::getPropertyValues - "
1693 "Error getting property handle!" );
1695 catch (
const NoSuchElementException&)
1699 OSL_FAIL(
"PersistentPropertySet::getPropertyValues - "
1700 "NoSuchElementException!" );
1706 OUString aHierName = aXMLName + aValueName;
1708 = xHierNameAccess->getByHierarchicalName(
1715 catch (
const NoSuchElementException&)
1719 OSL_FAIL(
"PersistentPropertySet::getPropertyValues - "
1720 "NoSuchElementException!" );
1726 OUString aHierName = aXMLName +aStateName;
1728 = xHierNameAccess->getByHierarchicalName(
1732 if ( !( aKeyValue >>=
nState ) )
1733 OSL_FAIL(
"PersistentPropertySet::getPropertyValues - "
1734 "Error getting property state!" );
1736 rValue.State = PropertyState(
nState );
1738 catch (
const NoSuchElementException&)
1742 OSL_FAIL(
"PersistentPropertySet::getPropertyValues - "
1743 "NoSuchElementException!" );
1752 catch (
const NoSuchElementException&)
1766 if ( !aProps.hasElements() )
1769 std::unique_lock aCGuard(
m_aMutex);
1772 m_pCreator->getRootConfigReadAccess(), UNO_QUERY );
1773 if ( xRootHierNameAccess.is() )
1775 std::vector< PropertyChangeEvent > aEvents;
1780 for (
const PropertyValue& rNewValue : aProps )
1782 const OUString& rName = rNewValue.Name;
1784 OUString aFullPropName = aFullPropNamePrefix +
1788 if ( xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
1792 aFullPropName ), UNO_QUERY );
1795 OUString() ), UNO_QUERY );
1797 if ( xNameReplace.is() && xBatch.is() )
1802 xNameReplace->replaceByName(
1804 Any( rNewValue.Handle ) );
1807 OUString aValueName = aFullPropName +
"/Value";
1809 = xRootHierNameAccess->getByHierarchicalName(
1812 xNameReplace->replaceByName(
1817 xNameReplace->replaceByName(
1821 PropertyState_DIRECT_VALUE ) ) );
1824 xBatch->commitChanges();
1828 PropertyChangeEvent aEvt;
1829 aEvt.Source = getXWeak();
1830 aEvt.PropertyName = rNewValue.Name;
1831 aEvt.PropertyHandle = rNewValue.Handle;
1832 aEvt.Further =
false;
1833 aEvt.OldValue = aOldValue;
1834 aEvt.NewValue = rNewValue.Value;
1836 aEvents.push_back( aEvt );
1839 catch (
const IllegalArgumentException&)
1843 catch (
const NoSuchElementException&)
1847 catch (
const WrappedTargetException&)
1858 for (
auto const& event : aEvents)
1867 OSL_FAIL(
"PersistentPropertySet::setPropertyValues - Nothing set!" );
1875 std::unique_lock<std::mutex>& rGuard,
1876 const PropertyChangeEvent& rEvent )
const
1881 if ( pContainer && pContainer->
getLength(rGuard) )
1883 pContainer->
notifyEach( rGuard, &XPropertyChangeListener::propertyChange, rEvent );
1889 if ( pNoNameContainer && pNoNameContainer->
getLength(rGuard) )
1891 pNoNameContainer->
notifyEach( rGuard, &XPropertyChangeListener::propertyChange, rEvent );
1897 std::unique_lock<std::mutex>& rGuard,
1898 const PropertySetInfoChangeEvent& evt )
const
1950 if ( xRootHierNameAccess.is() )
1955 xRootHierNameAccess->getByHierarchicalName(
1958 if ( xNameAccess.is() )
1963 = xNameAccess->getElementNames();
1965 sal_uInt32
nCount = aElems.getLength();
1971 xNameAccess, UNO_QUERY );
1973 OSL_ENSURE( xHierNameAccess.is(),
1974 "PropertySetInfo_Impl::getProperties - "
1975 "No hierarchical name access!" );
1977 if ( xHierNameAccess.is() )
1979 static constexpr OUStringLiteral aHandleName(
u"/Handle");
1980 static constexpr OUStringLiteral aValueName(
u"/Value");
1981 static constexpr OUStringLiteral aAttrName(
u"/Attributes");
1983 Property* pProps = aPropSeq.getArray();
1985 for ( sal_uInt32
n = 0;
n <
nCount; ++
n )
1988 OUString rName = aElems[
n ];
1999 OUString aHierName = aXMLName + aHandleName;
2001 = xHierNameAccess->getByHierarchicalName(
2004 if ( !( aKeyValue >>= rProp.Handle ) )
2005 OSL_FAIL(
"PropertySetInfo_Impl::getProperties - "
2006 "Error getting property handle!" );
2008 catch (
const NoSuchElementException&)
2012 OSL_FAIL(
"PropertySetInfo_Impl::getProperties - "
2013 "NoSuchElementException!" );
2019 OUString aHierName = aXMLName + aValueName;
2021 = xHierNameAccess->getByHierarchicalName(
2028 rProp.Type = aKeyValue.getValueType();
2030 catch (
const NoSuchElementException&)
2034 OSL_FAIL(
"PropertySetInfo_Impl::getProperties - "
2035 "NoSuchElementException!" );
2041 OUString aHierName = aXMLName + aAttrName;
2043 = xHierNameAccess->getByHierarchicalName(
2046 sal_Int32 nAttribs = 0;
2047 if ( aKeyValue >>= nAttribs )
2049 = sal_Int16( nAttribs );
2051 OSL_FAIL(
"PropertySetInfo_Impl::getProperties - "
2052 "Error getting property attributes!" );
2054 catch (
const NoSuchElementException&)
2058 OSL_FAIL(
"PropertySetInfo_Impl::getProperties - "
2059 "NoSuchElementException!" );
2070 catch (
const NoSuchElementException&)
2076 OSL_FAIL(
"PropertySetInfo_Impl::getProperties - Error!" );
2086 const OUString& aName )
2091 if ( xRootHierNameAccess.is() )
2097 if ( !xRootHierNameAccess->hasByHierarchicalName( aFullPropName ) )
2098 throw UnknownPropertyException(aFullPropName);
2105 OUString aKey = aFullPropName +
"/Handle";
2107 if ( !( xRootHierNameAccess->getByHierarchicalName( aKey )
2108 >>= aProp.Handle ) )
2110 OSL_FAIL(
"PropertySetInfo_Impl::getPropertyByName - "
2116 aKey = aFullPropName +
"/Value";
2118 Any aValue = xRootHierNameAccess->getByHierarchicalName( aKey );
2119 if ( !aValue.hasValue() )
2121 OSL_FAIL(
"PropertySetInfo_Impl::getPropertyByName - "
2126 aProp.Type = aValue.getValueType();
2129 aKey = aFullPropName +
"/Attributes";
2131 sal_Int32 nAttribs = 0;
2132 if ( xRootHierNameAccess->getByHierarchicalName( aKey )
2134 aProp.Attributes = sal_Int16( nAttribs );
2137 OSL_FAIL(
"PropertySetInfo_Impl::getPropertyByName - "
2148 catch (
const NoSuchElementException&)
2152 OSL_FAIL(
"PropertySetInfo_Impl::getPropertyByName - "
2153 "caught NoSuchElementException!" );
2158 OSL_FAIL(
"PropertySetInfo_Impl::getPropertyByName - Error!" );
2165 const OUString& Name )
2170 if ( xRootHierNameAccess.is() )
2175 return xRootHierNameAccess->hasByHierarchicalName( aFullPropName );
const PropertyValue * pValues
Reference< XComponentContext > m_xContext
virtual void SAL_CALL dispose() override
comphelper::OInterfaceContainerHelper4< css::beans::XPropertySetInfoChangeListener > m_aPropSetChangeListeners
virtual void SAL_CALL removeProperty(const OUString &Name) override
void notifyPropertyChangeEvent(std::unique_lock< std::mutex > &rGuard, const css::beans::PropertyChangeEvent &rEvent) const
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > m_aDisposeEventListeners
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
PropertyListeners_Impl m_aPropertyChangeListeners
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< css::beans::PropertyValue > &aProps) override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual void SAL_CALL removePropertySetInfoChangeListener(const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override
PropertySetRegistry & getPropertySetRegistry()
void notifyPropertySetInfoChange(std::unique_lock< std::mutex > &rGuard, const css::beans::PropertySetInfoChangeEvent &evt) const
virtual OUString SAL_CALL getKey() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Reference< css::ucb::XPropertySetRegistry > SAL_CALL getRegistry() override
virtual void SAL_CALL addPropertySetInfoChangeListener(const css::uno::Reference< css::beans::XPropertySetInfoChangeListener > &Listener) override
virtual void SAL_CALL setName(const OUString &aName) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
rtl::Reference< PropertySetInfo_Impl > m_pInfo
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
rtl::Reference< PropertySetRegistry > m_pCreator
PersistentPropertySet(std::unique_lock< std::mutex > &rCreatorGuard, PropertySetRegistry &rCreator, OUString aKey)
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL addProperty(const OUString &Name, sal_Int16 Attributes, const css::uno::Any &DefaultValue) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getPropertyValues() override
virtual ~PersistentPropertySet() override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &Listener) override
virtual OUString SAL_CALL getName() override
const OUString & getFullKeyImpl(std::unique_lock< std::mutex > &)
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
std::optional< Sequence< Property > > m_xProps
virtual Property SAL_CALL getPropertyByName(const OUString &aName) override
PersistentPropertySet * m_pOwner
virtual sal_Bool SAL_CALL hasPropertyByName(const OUString &Name) override
virtual Sequence< Property > SAL_CALL getProperties() override
PropertySetInfo_Impl(PersistentPropertySet *pOwner)
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual void SAL_CALL removePropertySet(const OUString &key) override
css::uno::Reference< css::uno::XInterface > getRootConfigReadAccessImpl(std::unique_lock< std::mutex > &l)
friend class PersistentPropertySet
css::uno::Reference< css::uno::XInterface > getConfigWriteAccessImpl(std::unique_lock< std::mutex > &l, const OUString &rPath)
css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider(std::unique_lock< std::mutex > &l)
css::uno::Reference< css::uno::XInterface > getRootConfigReadAccess()
virtual css::uno::Reference< css::ucb::XPersistentPropertySet > SAL_CALL openPropertySet(const OUString &key, sal_Bool create) override
css::uno::Reference< css::uno::XInterface > getConfigWriteAccess(const OUString &rPath)
const css::uno::Sequence< css::uno::Any > m_aInitArgs
PropertySetMap_Impl m_aPropSets
virtual css::uno::Type SAL_CALL getElementType() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
bool m_bTriedToGetRootReadAccess
PropertySetRegistry(const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Sequence< css::uno::Any > &rInitArgs)
css::uno::Reference< css::lang::XMultiServiceFactory > m_xConfigProvider
void renamePropertySet(const OUString &rOldKey, const OUString &rNewKey)
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
void remove(PersistentPropertySet *pSet)
virtual sal_Bool SAL_CALL hasElements() override
void add(std::unique_lock< std::mutex > &rCreatorGuard, PersistentPropertySet *pSet)
css::uno::Reference< css::uno::XInterface > m_xRootWriteAccess
bool m_bTriedToGetRootWriteAccess
css::uno::Reference< css::uno::XInterface > m_xRootReadAccess
virtual ~PropertySetRegistry() override
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
UcbStore(const css::uno::Reference< css::uno::XComponentContext > &xContext)
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Reference< css::ucb::XPropertySetRegistry > SAL_CALL createPropertySetRegistry(const OUString &URL) override
css::uno::Reference< css::ucb::XPropertySetRegistry > m_xTheRegistry
virtual ~UcbStore() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Sequence< css::uno::Any > m_aInitArgs
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
sal_Int32 addInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
void disposeAndClear(::std::unique_lock<::std::mutex > &rGuard, const css::lang::EventObject &rEvt)
sal_Int32 getLength(std::unique_lock< std::mutex > &rGuard) const
sal_Int32 removeInterface(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< ListenerT > &rxIFace)
sal_Int32 removeInterface(::std::unique_lock<::std::mutex > &rGuard, const key &rKey, const css::uno::Reference< listener > &rListener)
bool hasContainedTypes(std::unique_lock< std::mutex > &rGuard) const
sal_Int32 addInterface(::std::unique_lock<::std::mutex > &rGuard, const key &rKey, const css::uno::Reference< listener > &rListener)
void disposeAndClear(std::unique_lock< std::mutex > &rGuard, const css::lang::EventObject &rEvt)
OInterfaceContainerHelper4< listener > * getContainer(std::unique_lock< std::mutex > &rGuard, const key &rKey) const
css::uno::Type const & get()
#define TOOLS_WARN_EXCEPTION(area, stream)
Sequence< PropertyValue > aArguments
#define SAL_WARN(area, stream)
class SAL_NO_VTABLE XPropertySet
css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
ContentProvider * m_pOwner
constexpr OUStringLiteral CFGPROPERTY_NODEPATH
static OUString makeHierarchalNameSegment(std::u16string_view rIn)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ucb_UcbStore_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
constexpr OUStringLiteral STORE_CONTENTPROPERTIES_KEY
std::unordered_map< OUString, PersistentPropertySet * > PropertySetMap_Impl
std::unique_ptr< char[]> aBuffer