summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-11-07 14:42:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-08 08:17:55 +0100
commitcc772833a1166151bac2911037659582df655bcf (patch)
tree827574c76c8c7b88939630da1aef80574a9e319f /vbahelper
parentd31bb122bc5d7ca75a02d659bcf9dee3d429a165 (diff)
loplugin:fieldcast in VbShapeRangeEnumHelper
Change-Id: I18e24a4c0b86a6f9a456c0e962f87d74a4edf709 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159093 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/vbahelper/vbashaperange.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx
index 4dd837259bf7..73af31d69145 100644
--- a/vbahelper/source/vbahelper/vbashaperange.cxx
+++ b/vbahelper/source/vbahelper/vbashaperange.cxx
@@ -26,6 +26,8 @@
#include <utility>
#include <vbahelper/vbashaperange.hxx>
#include <vbahelper/vbashape.hxx>
+#include <rtl/ref.hxx>
+
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -33,18 +35,18 @@ namespace {
class VbShapeRangeEnumHelper : public EnumerationHelper_BASE
{
- uno::Reference< XCollection > m_xParent;
+ rtl::Reference< ScVbaShapeRange > m_xParent;
uno::Reference<container::XIndexAccess > m_xIndexAccess;
sal_Int32 nIndex;
public:
- VbShapeRangeEnumHelper( uno::Reference< XCollection > xParent, uno::Reference< container::XIndexAccess > xIndexAccess ) : m_xParent(std::move( xParent )), m_xIndexAccess(std::move( xIndexAccess )), nIndex( 0 ) {}
+ VbShapeRangeEnumHelper( rtl::Reference< ScVbaShapeRange > 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
{
- ScVbaShapeRange* pCollectionImpl = dynamic_cast< ScVbaShapeRange* >(m_xParent.get());
+ ScVbaShapeRange* pCollectionImpl = m_xParent.get();
if ( pCollectionImpl && hasMoreElements() )
return pCollectionImpl->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) );
throw container::NoSuchElementException();