XUnoTunnel->dynamic_cast in SvUnoAttributeContainer

Change-Id: Ief76f12dd98e3455667b70d09605c82c0cedc4b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145485
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx
index 50733ad..7507ed2 100644
--- a/editeng/source/items/xmlcnitm.cxx
+++ b/editeng/source/items/xmlcnitm.cxx
@@ -76,8 +76,8 @@ bool SvXMLAttrContainerItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMembe

bool SvXMLAttrContainerItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
{
    Reference<XUnoTunnel> xTunnel(rVal, UNO_QUERY);
    if (auto pContainer = comphelper::getFromUnoTunnel<SvUnoAttributeContainer>(xTunnel))
    Reference<XInterface> xTunnel(rVal, UNO_QUERY);
    if (auto pContainer = dynamic_cast<SvUnoAttributeContainer*>(xTunnel.get()))
    {
        maContainerData = *pContainer->GetContainerImpl();
    }
diff --git a/include/xmloff/unoatrcn.hxx b/include/xmloff/unoatrcn.hxx
index 8e5556b..b09a062 100644
--- a/include/xmloff/unoatrcn.hxx
+++ b/include/xmloff/unoatrcn.hxx
@@ -28,18 +28,16 @@
#include <sal/types.h>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XUnoTunnel.hpp>

#include <xmloff/xmlcnimp.hxx>

#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase2.hxx>

extern css::uno::Reference< css::uno::XInterface >  SvUnoAttributeContainer_CreateInstance();

class XMLOFF_DLLPUBLIC SvUnoAttributeContainer final :
    public ::cppu::WeakAggImplHelper3<
    public ::cppu::WeakAggImplHelper2<
        css::lang::XServiceInfo,
        css::lang::XUnoTunnel,
        css::container::XNameContainer >
{
private:
@@ -52,9 +50,6 @@ public:
    SvUnoAttributeContainer( std::unique_ptr<SvXMLAttrContainerData> pContainer = nullptr );
    SvXMLAttrContainerData* GetContainerImpl() const { return mpContainer.get(); }

    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept;
    virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;

    // css::container::XElementAccess
    virtual css::uno::Type  SAL_CALL getElementType() override;
    virtual sal_Bool SAL_CALL hasElements() override;
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index 354cd47..676c1d7 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -86,17 +86,6 @@ sal_uInt16 SvUnoAttributeContainer::getIndexByName(std::u16string_view aName ) c
    return USHRT_MAX;
}

const css::uno::Sequence< sal_Int8 > & SvUnoAttributeContainer::getUnoTunnelId() noexcept
{
    static const comphelper::UnoIdInit theSvUnoAttributeContainerUnoTunnelId;
    return theSvUnoAttributeContainerUnoTunnelId.getSeq();
}

sal_Int64 SAL_CALL SvUnoAttributeContainer::getSomething( const css::uno::Sequence< sal_Int8 >& rId )
{
    return comphelper::getSomethingImpl(rId, this);
}

// container::XNameAccess
uno::Any SAL_CALL SvUnoAttributeContainer::getByName(const OUString& aName)
{