From 5a6994870bb2fcb78372835aab59847402447a4e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 1 Jan 2017 20:32:29 +0000 Subject: fold ResourceIndexAccessBase into ResourceStringIndexAccess Change-Id: Icef518dc65d5edf4e7893df460aaae179eecfb45 --- extensions/source/resource/ResourceIndexAccess.cxx | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/extensions/source/resource/ResourceIndexAccess.cxx b/extensions/source/resource/ResourceIndexAccess.cxx index 2edb7ccc91c1..dfb918146833 100644 --- a/extensions/source/resource/ResourceIndexAccess.cxx +++ b/extensions/source/resource/ResourceIndexAccess.cxx @@ -37,10 +37,10 @@ namespace return std::shared_ptr(ResMgr::CreateResMgr(sEncName.getStr())); } - class ResourceIndexAccessBase : public cppu::WeakImplHelper< css::container::XIndexAccess> + class ResourceStringIndexAccess : public cppu::WeakImplHelper< css::container::XIndexAccess> { public: - explicit ResourceIndexAccessBase(const std::shared_ptr& pResMgr) + explicit ResourceStringIndexAccess(const std::shared_ptr& pResMgr) : m_pResMgr(pResMgr) { OSL_ENSURE(m_pResMgr, "no resource manager given"); @@ -49,25 +49,15 @@ namespace // XIndexAccess virtual ::sal_Int32 SAL_CALL getCount( ) throw (css::uno::RuntimeException, std::exception) override { return m_pResMgr.get() ? SAL_MAX_UINT16 : 0; }; + virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; // XElementAccess virtual sal_Bool SAL_CALL hasElements( ) throw (css::uno::RuntimeException, std::exception) override { return static_cast(m_pResMgr.get()); }; - - protected: - // m_pResMgr should never be NULL - const std::shared_ptr m_pResMgr; - }; - - class ResourceStringIndexAccess : public ResourceIndexAccessBase - { - public: - explicit ResourceStringIndexAccess(const std::shared_ptr& pResMgr) - : ResourceIndexAccessBase(pResMgr) {} - // XIndexAccess - virtual css::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; - // XElementAccessBase virtual css::uno::Type SAL_CALL getElementType( ) throw (css::uno::RuntimeException, std::exception) override { return ::cppu::UnoType::get(); }; + private: + // m_pResMgr should never be NULL + const std::shared_ptr m_pResMgr; }; } -- cgit