summaryrefslogtreecommitdiff
path: root/vbahelper/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-07 14:41:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-08 08:17:48 +0100
commitd31bb122bc5d7ca75a02d659bcf9dee3d429a165 (patch)
tree28359f83a781fd6316c9fb294543b528bd2be537 /vbahelper/source
parentea7233bc1174b781c809db55d2c55af0011ce0e0 (diff)
loplugin:fieldcast in VbShapeEnumHelper
Change-Id: Iece221df3b650078a1796d407459bbd96ad058e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159092 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper/source')
-rw-r--r--vbahelper/source/vbahelper/vbashapes.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx
index 02630a75c520..e96cda4ac926 100644
--- a/vbahelper/source/vbahelper/vbashapes.cxx
+++ b/vbahelper/source/vbahelper/vbashapes.cxx
@@ -52,18 +52,18 @@ namespace {
class VbShapeEnumHelper : public EnumerationHelper_BASE
{
- uno::Reference<msforms::XShapes > m_xParent;
+ rtl::Reference<ScVbaShapes> m_xParent;
uno::Reference<container::XIndexAccess > m_xIndexAccess;
sal_Int32 nIndex;
public:
- VbShapeEnumHelper( uno::Reference< msforms::XShapes > xParent, uno::Reference< container::XIndexAccess > xIndexAccess ) : m_xParent(std::move( xParent )), m_xIndexAccess(std::move( xIndexAccess )), nIndex( 0 ) {}
+ VbShapeEnumHelper( rtl::Reference< ScVbaShapes > xParent, uno::Reference< container::XIndexAccess > xIndexAccess ) : m_xParent(std::move( xParent )), m_xIndexAccess(std::move( xIndexAccess )), nIndex( 0 ) {}
virtual sal_Bool SAL_CALL hasMoreElements( ) override
{
return ( nIndex < m_xIndexAccess->getCount() );
}
virtual uno::Any SAL_CALL nextElement( ) override
{
- ScVbaShapes* pShapes = dynamic_cast< ScVbaShapes* >(m_xParent.get());
+ ScVbaShapes* pShapes = m_xParent.get();
if ( pShapes && hasMoreElements() )
return pShapes->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) );
throw container::NoSuchElementException();