diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-01 20:32:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-01 20:32:29 +0000 |
commit | 5a6994870bb2fcb78372835aab59847402447a4e (patch) | |
tree | b0a3a0025314ef0b5d43f64681cc5bc31274d5cd /extensions | |
parent | 705b43516215b67683ea0436c42bf5cada7ed445 (diff) |
fold ResourceIndexAccessBase into ResourceStringIndexAccess
Change-Id: Icef518dc65d5edf4e7893df460aaae179eecfb45
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/resource/ResourceIndexAccess.cxx | 22 |
1 files 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>(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<ResMgr>& pResMgr) + explicit ResourceStringIndexAccess(const std::shared_ptr<ResMgr>& 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<bool>(m_pResMgr.get()); }; - - protected: - // m_pResMgr should never be NULL - const std::shared_ptr<ResMgr> m_pResMgr; - }; - - class ResourceStringIndexAccess : public ResourceIndexAccessBase - { - public: - explicit ResourceStringIndexAccess(const std::shared_ptr<ResMgr>& 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<OUString>::get(); }; + private: + // m_pResMgr should never be NULL + const std::shared_ptr<ResMgr> m_pResMgr; }; } |