From b401896a56149aa2871b65a330a6f601a9830ccd Mon Sep 17 00:00:00 2001 From: Mohammed Abdul Azeem Date: Sun, 9 Jul 2017 17:02:06 +0530 Subject: Helper function to cast to FastAttributeList: Refactoring codes that cast XFastAttributeList reference to FastAttributeList pointer using the helper function. Change-Id: Iecf4b815d6556b0992d638b633260fbd459c0dc4 Reviewed-on: https://gerrit.libreoffice.org/39723 Tested-by: Jenkins Reviewed-by: Michael Meeks --- include/sax/fastattribs.hxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/sax') diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx index c813fcf6944d..4147ac978f44 100644 --- a/include/sax/fastattribs.hxx +++ b/include/sax/fastattribs.hxx @@ -102,6 +102,13 @@ public: virtual css::uno::Sequence< css::xml::Attribute > SAL_CALL getUnknownAttributes( ) override; virtual css::uno::Sequence< css::xml::FastAttribute > SAL_CALL getFastAttributes() override; + static FastAttributeList* castToFastAttributeList( + const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) + { + assert( dynamic_cast ( xAttrList.get() ) != nullptr ); + return ( static_cast ( xAttrList.get() ) ); + } + /// Use for fast iteration and conversion of attributes class FastAttributeIter { const FastAttributeList &mrList; -- cgit