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>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user