From be4d2cdc23c20a11a195cab8fb6a45312a814341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= Date: Mon, 9 Sep 2013 17:11:03 +0200 Subject: [PATCH] unusedcode: remove AttributeListImpl Change-Id: I9c3c0d742bc2941fcf40ad69bfb744a57b3e7be6 --- unotools/source/config/xmlaccelcfg.cxx | 140 ------------------------- unusedcode.easy | 2 - 2 files changed, 142 deletions(-) diff --git a/unotools/source/config/xmlaccelcfg.cxx b/unotools/source/config/xmlaccelcfg.cxx index 719cbf7f6058..bd598d2fc4c8 100644 --- a/unotools/source/config/xmlaccelcfg.cxx +++ b/unotools/source/config/xmlaccelcfg.cxx @@ -35,146 +35,6 @@ using namespace com::sun::star::xml::sax; #define ATTRIBUTE_MODIFIER "modifier" #define ATTRIBUTE_URL "url" -namespace { - -struct AttributeListImpl_impl; -class AttributeListImpl : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XAttributeList > -{ -protected: - ~AttributeListImpl(); - -public: - AttributeListImpl(); - AttributeListImpl( const AttributeListImpl & ); - -public: - virtual sal_Int16 SAL_CALL getLength(void) throw (::com::sun::star::uno::RuntimeException); - virtual OUString SAL_CALL getNameByIndex(sal_Int16 i) throw (::com::sun::star::uno::RuntimeException); - virtual OUString SAL_CALL getTypeByIndex(sal_Int16 i) throw (::com::sun::star::uno::RuntimeException); - virtual OUString SAL_CALL getTypeByName(const OUString& aName) throw (::com::sun::star::uno::RuntimeException); - virtual OUString SAL_CALL getValueByIndex(sal_Int16 i) throw (::com::sun::star::uno::RuntimeException); - virtual OUString SAL_CALL getValueByName(const OUString& aName) throw (::com::sun::star::uno::RuntimeException); - -public: - void addAttribute( const OUString &sName , const OUString &sType , const OUString &sValue ); - -private: - struct AttributeListImpl_impl *m_pImpl; -}; - -struct TagAttribute -{ - TagAttribute(){} - TagAttribute( const OUString &aName, const OUString &aType , const OUString &aValue ) - { - sName = aName; - sType = aType; - sValue = aValue; - } - - OUString sName; - OUString sType; - OUString sValue; -}; - -struct AttributeListImpl_impl -{ - AttributeListImpl_impl() - { - // performance improvement during adding - vecAttribute.reserve(20); - } - ::std::vector vecAttribute; -}; - - - -sal_Int16 SAL_CALL AttributeListImpl::getLength(void) throw (RuntimeException) -{ - return sal::static_int_cast< sal_Int16 >(m_pImpl->vecAttribute.size()); -} - - -AttributeListImpl::AttributeListImpl( const AttributeListImpl &r ) : - cppu::WeakImplHelper1(r) -{ - m_pImpl = new AttributeListImpl_impl; - *m_pImpl = *(r.m_pImpl); -} - -OUString AttributeListImpl::getNameByIndex(sal_Int16 i) throw (RuntimeException) -{ - if( i < sal::static_int_cast(m_pImpl->vecAttribute.size()) ) { - return m_pImpl->vecAttribute[i].sName; - } - return OUString(); -} - - -OUString AttributeListImpl::getTypeByIndex(sal_Int16 i) throw (RuntimeException) -{ - if( i < sal::static_int_cast(m_pImpl->vecAttribute.size()) ) { - return m_pImpl->vecAttribute[i].sType; - } - return OUString(); -} - -OUString AttributeListImpl::getValueByIndex(sal_Int16 i) throw (RuntimeException) -{ - if( i < sal::static_int_cast(m_pImpl->vecAttribute.size()) ) { - return m_pImpl->vecAttribute[i].sValue; - } - return OUString(); - -} - -OUString AttributeListImpl::getTypeByName( const OUString& sName ) throw (RuntimeException) -{ - ::std::vector::iterator ii = m_pImpl->vecAttribute.begin(); - - for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) { - if( (*ii).sName == sName ) { - return (*ii).sType; - } - } - return OUString(); -} - -OUString AttributeListImpl::getValueByName(const OUString& sName) throw (RuntimeException) -{ - ::std::vector::iterator ii = m_pImpl->vecAttribute.begin(); - - for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) { - if( (*ii).sName == sName ) { - return (*ii).sValue; - } - } - return OUString(); -} - - -AttributeListImpl::AttributeListImpl() -{ - m_pImpl = new AttributeListImpl_impl; -} - - - -AttributeListImpl::~AttributeListImpl() -{ - delete m_pImpl; -} - - -void AttributeListImpl::addAttribute( const OUString &sName , - const OUString &sType , - const OUString &sValue ) -{ - m_pImpl->vecAttribute.push_back( TagAttribute( sName , sType , sValue ) ); -} - -} // anonymous namespace - Any SAL_CALL OReadAccelatorDocumentHandler::queryInterface( const Type & rType ) throw( RuntimeException ) { Any a = ::cppu::queryInterface( rType ,(static_cast< XDocumentHandler* >(this))); diff --git a/unusedcode.easy b/unusedcode.easy index 676f777af1fc..de647fb989c9 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -1,5 +1,3 @@ -(anonymous namespace)::AttributeListImpl::AttributeListImpl() -(anonymous namespace)::AttributeListImpl::addAttribute(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&) (anonymous namespace)::Coverage::test_start(rtl::OUString) (anonymous namespace)::StringToken::toInt32(int&) const (anonymous namespace)::StringTokenizer::StringTokenizer(rtl::OUString const&, unsigned short)