diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-06 20:54:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-07 10:29:34 +0200 |
commit | 329c1e6c0310429163a77d760acd5b3043873bc7 (patch) | |
tree | 17b335ef845e7ea779386db49bb74ce167aeb40e /sw/source | |
parent | 22ed308622c1ab07d4f00a6b8150630b5d168906 (diff) |
SvXMLItemMapEntries does not need an impl
it is module private
Change-Id: Iaceb84b6868fe1450eab748f34f131a3867d38cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139542
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/xml/xmlitmap.hxx | 9 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlitmpr.cxx | 28 |
2 files changed, 8 insertions, 29 deletions
diff --git a/sw/source/filter/xml/xmlitmap.hxx b/sw/source/filter/xml/xmlitmap.hxx index 8d5adb4af4f9..da42805c8206 100644 --- a/sw/source/filter/xml/xmlitmap.hxx +++ b/sw/source/filter/xml/xmlitmap.hxx @@ -57,23 +57,22 @@ struct SvXMLItemMapEntry : nNameSpace(nameSpace), nWhichId(whichId), eLocalName(localName), nMemberId(memberId) {} }; -class SvXMLItemMapEntries_impl; - /** this class manages an array of SvXMLItemMapEntry. It is used for optimizing the static array on startup of import or export */ class SvXMLItemMapEntries final : public SvRefBase { - std::unique_ptr<SvXMLItemMapEntries_impl> mpImpl; + SvXMLItemMapEntry const * mpEntries; + sal_uInt16 mnCount; public: explicit SvXMLItemMapEntries(SvXMLItemMapEntry const * pEntrys); virtual ~SvXMLItemMapEntries() override; SvXMLItemMapEntry const * getByName( sal_Int32 nElement ) const; - SvXMLItemMapEntry const & getByIndex( sal_uInt16 nIndex ) const; + SvXMLItemMapEntry const & getByIndex( sal_uInt16 nIndex ) const { return mpEntries[nIndex]; } - sal_uInt16 getCount() const; + sal_uInt16 getCount() const { return mnCount; } }; typedef tools::SvRef<SvXMLItemMapEntries> SvXMLItemMapEntriesRef; diff --git a/sw/source/filter/xml/xmlitmpr.cxx b/sw/source/filter/xml/xmlitmpr.cxx index 9250d079bcba..6731f086bbe3 100644 --- a/sw/source/filter/xml/xmlitmpr.cxx +++ b/sw/source/filter/xml/xmlitmpr.cxx @@ -23,24 +23,14 @@ using ::xmloff::token::IsXMLToken; using ::xmloff::token::XML_TOKEN_INVALID; -// TODO: optimize this! -class SvXMLItemMapEntries_impl -{ -public: - SvXMLItemMapEntry const * mpEntries; - sal_uInt16 mnCount; -}; - SvXMLItemMapEntries::SvXMLItemMapEntries( SvXMLItemMapEntry const * pEntries ) - : mpImpl( new SvXMLItemMapEntries_impl ) + : mpEntries(pEntries) { - mpImpl->mpEntries = pEntries; - - mpImpl->mnCount = 0; + mnCount = 0; while( pEntries->eLocalName != XML_TOKEN_INVALID ) { pEntries++; - mpImpl->mnCount++; + mnCount++; } } @@ -50,7 +40,7 @@ SvXMLItemMapEntries::~SvXMLItemMapEntries() SvXMLItemMapEntry const * SvXMLItemMapEntries::getByName( sal_Int32 nElement ) const { - SvXMLItemMapEntry const * pMap = mpImpl->mpEntries; + SvXMLItemMapEntry const * pMap = mpEntries; while( pMap && (pMap->eLocalName != XML_TOKEN_INVALID) ) { if( IsTokenInNamespace(nElement, pMap->nNameSpace) && @@ -62,14 +52,4 @@ SvXMLItemMapEntry const * SvXMLItemMapEntries::getByName( sal_Int32 nElement ) return (pMap && (pMap->eLocalName != XML_TOKEN_INVALID)) ? pMap : nullptr; } -SvXMLItemMapEntry const & SvXMLItemMapEntries::getByIndex( sal_uInt16 nIndex ) const -{ - return mpImpl->mpEntries[nIndex]; -} - -sal_uInt16 SvXMLItemMapEntries::getCount() const -{ - return mpImpl->mnCount; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |