diff options
Diffstat (limited to 'include/vbahelper/vbacollectionimpl.hxx')
-rw-r--r-- | include/vbahelper/vbacollectionimpl.hxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/include/vbahelper/vbacollectionimpl.hxx b/include/vbahelper/vbacollectionimpl.hxx index d3d20fd57a8a..bd3ffdd06e9a 100644 --- a/include/vbahelper/vbacollectionimpl.hxx +++ b/include/vbahelper/vbacollectionimpl.hxx @@ -54,12 +54,12 @@ public: const css::uno::Reference< css::container::XIndexAccess >& rxIndexAccess ) throw (css::uno::RuntimeException) : mxIndexAccess( rxIndexAccess ), mnIndex( 0 ) {} - virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException, std::exception) override { return mnIndex < mxIndexAccess->getCount(); } - virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override { if( !hasMoreElements() ) throw css::container::NoSuchElementException(); @@ -95,12 +95,12 @@ public: const css::uno::Reference< css::container::XIndexAccess >& rxIndexAccess ) throw (css::uno::RuntimeException) : mxParent( rxParent ), mxContext( rxContext ), mxEnumeration( new SimpleIndexAccessToEnumeration( rxIndexAccess ) ) {} - virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual sal_Bool SAL_CALL hasMoreElements() throw (css::uno::RuntimeException, std::exception) override { return mxEnumeration->hasMoreElements(); } - virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual css::uno::Any SAL_CALL nextElement() throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override { return createCollectionObject( mxEnumeration->nextElement() ); } @@ -127,7 +127,7 @@ protected: public: EnumerationHelperImpl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XEnumeration >& xEnumeration ) throw ( css::uno::RuntimeException ) : m_xParent( xParent ), m_xContext( xContext ), m_xEnumeration( xEnumeration ) { } - virtual sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE { return m_xEnumeration->hasMoreElements(); } + virtual sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException, std::exception) override { return m_xEnumeration->hasMoreElements(); } }; // a wrapper class for a providing a XIndexAccess, XNameAccess, XEnumerationAccess impl based on providing a vector of interfaces @@ -151,12 +151,12 @@ private: public: XNamedEnumerationHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), mIt( mXNamedVec.begin() ) {} - virtual sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual sal_Bool SAL_CALL hasMoreElements( ) throw (css::uno::RuntimeException, std::exception) override { return ( mIt != mXNamedVec.end() ); } - virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual css::uno::Any SAL_CALL nextElement( ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override { if ( hasMoreElements() ) return css::uno::makeAny( *mIt++ ); @@ -170,16 +170,16 @@ protected: public: XNamedObjectCollectionHelper( const XNamedVec& sMap ) : mXNamedVec( sMap ), cachePos(mXNamedVec.begin()) {} // XElementAccess - virtual css::uno::Type SAL_CALL getElementType( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE { return cppu::UnoType< OneIfc >::get(); } - virtual sal_Bool SAL_CALL hasElements( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE { return ( mXNamedVec.size() > 0 ); } + virtual css::uno::Type SAL_CALL getElementType( ) throw (css::uno::RuntimeException, std::exception) override { return cppu::UnoType< OneIfc >::get(); } + virtual sal_Bool SAL_CALL hasElements( ) throw (css::uno::RuntimeException, std::exception) override { return ( mXNamedVec.size() > 0 ); } // XNameAcess - virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) throw (css::container::NoSuchElementException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override { if ( !hasByName(aName) ) throw css::container::NoSuchElementException(); return css::uno::makeAny( *cachePos ); } - virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) throw (css::uno::RuntimeException, std::exception) override { css::uno::Sequence< OUString > sNames( mXNamedVec.size() ); OUString* pString = sNames.getArray(); @@ -193,7 +193,7 @@ public: } return sNames; } - virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (css::uno::RuntimeException, std::exception) override { cachePos = mXNamedVec.begin(); typename XNamedVec::iterator it_end = mXNamedVec.end(); @@ -207,8 +207,8 @@ public: } // XElementAccess - virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE { return mXNamedVec.size(); } - virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE + virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException, std::exception) override { return mXNamedVec.size(); } + virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception ) override { if ( Index < 0 || Index >= getCount() ) throw css::lang::IndexOutOfBoundsException(); @@ -217,7 +217,7 @@ public: } // XEnumerationAccess - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration( ) throw (css::uno::RuntimeException, std::exception) override { return new XNamedEnumerationHelper( mXNamedVec ); } @@ -277,13 +277,13 @@ public: ScVbaCollectionBase( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xIndexAccess, bool bIgnoreCase = false ) : BaseColBase( xParent, xContext ), m_xIndexAccess( xIndexAccess ), mbIgnoreCase( bIgnoreCase ) { m_xNameAccess.set(m_xIndexAccess, css::uno::UNO_QUERY); } //XCollection - virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException) SAL_OVERRIDE + virtual ::sal_Int32 SAL_CALL getCount() throw (css::uno::RuntimeException) override { return m_xIndexAccess->getCount(); } virtual css::uno::Any SAL_CALL Item(const css::uno::Any& Index1, const css::uno::Any& /*not processed in this base class*/) - throw (css::lang::IndexOutOfBoundsException, css::script::BasicErrorException, css::uno::RuntimeException) SAL_OVERRIDE + throw (css::lang::IndexOutOfBoundsException, css::script::BasicErrorException, css::uno::RuntimeException) override { if ( Index1.getValueTypeClass() != css::uno::TypeClass_STRING ) { @@ -302,17 +302,17 @@ public: } // XDefaultMethod - OUString SAL_CALL getDefaultMethodName( ) throw (css::uno::RuntimeException) SAL_OVERRIDE + OUString SAL_CALL getDefaultMethodName( ) throw (css::uno::RuntimeException) override { return OUString("Item"); } // XEnumerationAccess - virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) SAL_OVERRIDE = 0; + virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() throw (css::uno::RuntimeException) override = 0; // XElementAccess - virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) SAL_OVERRIDE = 0; + virtual css::uno::Type SAL_CALL getElementType() throw (css::uno::RuntimeException) override = 0; // XElementAccess - virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) SAL_OVERRIDE + virtual sal_Bool SAL_CALL hasElements() throw (css::uno::RuntimeException) override { return ( m_xIndexAccess->getCount() > 0 ); } |