unusedcode: remove AttributeListImpl
Change-Id: I9c3c0d742bc2941fcf40ad69bfb744a57b3e7be6
This commit is contained in:
@@ -35,146 +35,6 @@ using namespace com::sun::star::xml::sax;
|
|||||||
#define ATTRIBUTE_MODIFIER "modifier"
|
#define ATTRIBUTE_MODIFIER "modifier"
|
||||||
#define ATTRIBUTE_URL "url"
|
#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<struct TagAttribute> 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<com::sun::star::xml::sax::XAttributeList>(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<sal_Int16>(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<sal_Int16>(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<sal_Int16>(m_pImpl->vecAttribute.size()) ) {
|
|
||||||
return m_pImpl->vecAttribute[i].sValue;
|
|
||||||
}
|
|
||||||
return OUString();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
OUString AttributeListImpl::getTypeByName( const OUString& sName ) throw (RuntimeException)
|
|
||||||
{
|
|
||||||
::std::vector<struct TagAttribute>::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<struct TagAttribute>::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 SAL_CALL OReadAccelatorDocumentHandler::queryInterface( const Type & rType ) throw( RuntimeException )
|
||||||
{
|
{
|
||||||
Any a = ::cppu::queryInterface( rType ,(static_cast< XDocumentHandler* >(this)));
|
Any a = ::cppu::queryInterface( rType ,(static_cast< XDocumentHandler* >(this)));
|
||||||
|
@@ -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)::Coverage::test_start(rtl::OUString)
|
||||||
(anonymous namespace)::StringToken::toInt32(int&) const
|
(anonymous namespace)::StringToken::toInt32(int&) const
|
||||||
(anonymous namespace)::StringTokenizer::StringTokenizer(rtl::OUString const&, unsigned short)
|
(anonymous namespace)::StringTokenizer::StringTokenizer(rtl::OUString const&, unsigned short)
|
||||||
|
Reference in New Issue
Block a user