summaryrefslogtreecommitdiffstats
path: root/framework/source/fwi/uielement/constitemcontainer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'framework/source/fwi/uielement/constitemcontainer.cxx')
-rw-r--r--framework/source/fwi/uielement/constitemcontainer.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx
index 9dee39a6e76d..40865c8f1b81 100644
--- a/framework/source/fwi/uielement/constitemcontainer.cxx
+++ b/framework/source/fwi/uielement/constitemcontainer.cxx
@@ -34,7 +34,7 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::container;
const int PROPHANDLE_UINAME = 1;
-constexpr OUStringLiteral PROPNAME_UINAME = u"UIName";
+constexpr OUString PROPNAME_UINAME = u"UIName"_ustr;
namespace framework
{
@@ -147,7 +147,7 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference
Reference< XIndexAccess > xReturn;
if ( rSubContainer.is() )
{
- ItemContainer* pSource = comphelper::getFromUnoTunnel<ItemContainer>( rSubContainer );
+ ItemContainer* pSource = dynamic_cast<ItemContainer*>( rSubContainer.get() );
rtl::Reference<ConstItemContainer> pSubContainer;
if ( pSource )
pSubContainer = new ConstItemContainer( *pSource );
@@ -159,18 +159,6 @@ Reference< XIndexAccess > ConstItemContainer::deepCopyContainer( const Reference
return xReturn;
}
-// XUnoTunnel
-sal_Int64 ConstItemContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier )
-{
- return comphelper::getSomethingImpl(rIdentifier, this);
-}
-
-const Sequence< sal_Int8 >& ConstItemContainer::getUnoTunnelId() noexcept
-{
- static const comphelper::UnoIdInit theConstItemContainerUnoTunnelId;
- return theConstItemContainerUnoTunnelId.getSeq();
-}
-
// XElementAccess
sal_Bool SAL_CALL ConstItemContainer::hasElements()
{
@@ -187,7 +175,18 @@ Any SAL_CALL ConstItemContainer::getByIndex( sal_Int32 Index )
{
if ( sal_Int32( m_aItemVector.size()) <= Index )
throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) );
- return makeAny( m_aItemVector[Index] );
+ return Any( m_aItemVector[Index] );
+}
+
+namespace
+{
+ std::vector<comphelper::PropertyMapEntry> makePropertyMap(const css::uno::Sequence<css::beans::Property>& rProps)
+ {
+ std::vector<comphelper::PropertyMapEntry> aEntries;
+ for (auto const& it : rProps)
+ aEntries.emplace_back(it.Name, it.Handle, it.Type, it.Attributes, 0);
+ return aEntries;
+ }
}
// XPropertySet
@@ -195,7 +194,8 @@ Reference< XPropertySetInfo > SAL_CALL ConstItemContainer::getPropertySetInfo()
{
// Create structure of propertysetinfo for baseclass "OPropertySetHelper".
// (Use method "getInfoHelper()".)
- static Reference< XPropertySetInfo > xInfo(new comphelper::PropertySetInfo(getInfoHelper().getProperties()));
+ static std::vector<comphelper::PropertyMapEntry> aPropertyInfos(makePropertyMap(getInfoHelper().getProperties()));
+ static Reference< XPropertySetInfo > xInfo(new comphelper::PropertySetInfo(aPropertyInfos));
return xInfo;
}
@@ -207,7 +207,7 @@ void SAL_CALL ConstItemContainer::setPropertyValue( const OUString&, const Any&
Any SAL_CALL ConstItemContainer::getPropertyValue( const OUString& PropertyName )
{
if ( PropertyName == PROPNAME_UINAME )
- return makeAny( m_aUIName );
+ return Any( m_aUIName );
throw UnknownPropertyException(PropertyName);
}
@@ -239,7 +239,7 @@ void SAL_CALL ConstItemContainer::setFastPropertyValue( sal_Int32, const css::un
Any SAL_CALL ConstItemContainer::getFastPropertyValue( sal_Int32 nHandle )
{
if ( nHandle == PROPHANDLE_UINAME )
- return makeAny( m_aUIName );
+ return Any( m_aUIName );
throw UnknownPropertyException(OUString::number(nHandle));
}