[Libreoffice-commits] core.git: extensions/source

Caolán McNamara caolanm at redhat.com
Sun Jan 1 20:30:48 UTC 2017


 extensions/source/resource/ResourceIndexAccess.cxx |   38 ---------------------
 1 file changed, 38 deletions(-)

New commits:
commit 705b43516215b67683ea0436c42bf5cada7ed445
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 1 20:30:03 2017 +0000

    so ResourceStringListIndexAccess isn't needed
    
    Change-Id: Ic25fc6f2f8f3e471a90e10c3f2319f40888520e6

diff --git a/extensions/source/resource/ResourceIndexAccess.cxx b/extensions/source/resource/ResourceIndexAccess.cxx
index 6f24b2b..2edb7cc 100644
--- a/extensions/source/resource/ResourceIndexAccess.cxx
+++ b/extensions/source/resource/ResourceIndexAccess.cxx
@@ -69,18 +69,6 @@ namespace
             virtual css::uno::Type SAL_CALL getElementType(  ) throw (css::uno::RuntimeException, std::exception) override
                 { return ::cppu::UnoType<OUString>::get(); };
     };
-
-    class ResourceStringListIndexAccess : public ResourceIndexAccessBase
-    {
-        public:
-            explicit ResourceStringListIndexAccess(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<Sequence<PropertyValue>>::get(); };
-    };
 }
 
 ResourceIndexAccess::ResourceIndexAccess(Sequence<Any> const& rArgs, Reference<XComponentContext> const&)
@@ -140,30 +128,4 @@ Any SAL_CALL ResourceStringIndexAccess::getByIndex(sal_Int32 nIdx)
     return makeAny(aId.toString());
 }
 
-Any SAL_CALL ResourceStringListIndexAccess::getByIndex(sal_Int32 nIdx)
-    throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception)
-{
-    if(nIdx > SAL_MAX_UINT16 || nIdx < 0)
-        throw IndexOutOfBoundsException();
-    SolarMutexGuard aGuard;
-
-    if(!m_pResMgr.get())
-        throw RuntimeException("resource manager not available");
-
-    const ResId aId(static_cast<sal_uInt16>(nIdx), *m_pResMgr);
-    aId.SetRT(RSC_STRINGARRAY);
-    if(!m_pResMgr->IsAvailable(aId))
-        throw RuntimeException("string list resource for id not available");
-    const ResStringArray aStringList(aId);
-    Sequence<PropertyValue> aPropList(aStringList.Count());
-    for(sal_Int32 nCount = 0; nCount != aPropList.getLength(); ++nCount)
-    {
-        aPropList[nCount].Name = aStringList.GetString(nCount);
-        aPropList[nCount].Handle = -1;
-        aPropList[nCount].Value <<= aStringList.GetValue(nCount);
-        aPropList[nCount].State = PropertyState_DIRECT_VALUE;
-    }
-    return makeAny(aPropList);
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list