diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-11 14:19:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-25 12:13:26 +0200 |
commit | 0dbc76a3ca25f43232073484541504e342380d0a (patch) | |
tree | d0324098ee97a845cbbf9f7205a43af94ca7306d /include/sax | |
parent | af9642350db024e9a9ff73f46693ff5d0a4ce66b (diff) |
make FastParser always take a FastTokenHandlerBase subclass
since most of the call sites already do, and we can skip the
slow path this way.
Change-Id: I64ed30c51324e0510818f42ef838f97c401bb6dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90326
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/sax')
-rw-r--r-- | include/sax/fastattribs.hxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx index 839f4c2b8cfd..60090f88f2f5 100644 --- a/include/sax/fastattribs.hxx +++ b/include/sax/fastattribs.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SAX_FASTATTRIBS_HXX #include <com/sun/star/xml/sax/XFastAttributeList.hpp> +#include <com/sun/star/xml/sax/XFastTokenHandler.hpp> #include <cppuhelper/implbase.hxx> #include <sax/saxdllapi.h> @@ -49,7 +50,8 @@ struct UnknownAttribute typedef std::vector< UnknownAttribute > UnknownAttributeList; /// A native C++ interface to tokenisation -class SAX_DLLPUBLIC FastTokenHandlerBase +class SAX_DLLPUBLIC FastTokenHandlerBase : + public cppu::WeakImplHelper< css::xml::sax::XFastTokenHandler > { public: virtual ~FastTokenHandlerBase(); @@ -57,24 +59,21 @@ class SAX_DLLPUBLIC FastTokenHandlerBase /** * Client method to attempt the use of this interface if possible. - * @xTokenHandler - the UNO handle for the token lookup interface - * @pTokenHandler - a dynamic_cast version of @xTokenHandler to this interface + * @xTokenHandler - the token lookup interface * @pStr - string buffer to lookup * @nLength - optional length of chars in that buffer * * @return Tokenized form of pStr */ static sal_Int32 getTokenFromChars( - const css::uno::Reference<css::xml::sax::XFastTokenHandler > &xTokenHandler, - const FastTokenHandlerBase *pTokenHandler /* can be NULL */, + const FastTokenHandlerBase *pTokenHandler, const char *pStr, size_t nLength ); }; class SAX_DLLPUBLIC FastAttributeList final : public cppu::WeakImplHelper< css::xml::sax::XFastAttributeList > { public: - FastAttributeList( const css::uno::Reference< css::xml::sax::XFastTokenHandler >& xTokenHandler, - FastTokenHandlerBase *pOptHandlerBase = nullptr ); + FastAttributeList( FastTokenHandlerBase *pTokenHandler ); virtual ~FastAttributeList() override; void clear(); @@ -208,8 +207,7 @@ private: std::vector< sal_Int32 > maAttributeValues; std::vector< sal_Int32 > maAttributeTokens; UnknownAttributeList maUnknownAttributes; - css::uno::Reference< css::xml::sax::XFastTokenHandler > mxTokenHandler; - FastTokenHandlerBase *mpTokenHandler; + FastTokenHandlerBase * mpTokenHandler; }; } |