From a84e97e58fe0915376801f98e1c0d24470f1e1d3 Mon Sep 17 00:00:00 2001 From: Santiago Martinez Date: Tue, 27 Mar 2012 21:16:50 +0200 Subject: Remove unused code in l10ntools. --- l10ntools/inc/xmlparse.hxx | 6 ----- l10ntools/source/xmlparse.cxx | 61 ------------------------------------------- unusedcode.easy | 2 -- 3 files changed, 69 deletions(-) diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx index cd9bc2ba50fd..0731a9f453e8 100644 --- a/l10ntools/inc/xmlparse.hxx +++ b/l10ntools/inc/xmlparse.hxx @@ -169,13 +169,7 @@ public: XMLChildNode *pChild , size_t pos /// the new child ); - int RemoveChild( XMLElement *pRefElement ); void RemoveAndDeleteAllChildren(); - - /// returns a child element which matches the given one - XMLElement *GetChildElement( - XMLElement *pRefElement // the reference elelement - ); }; //------------------------------------------------------------------------- diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx index e64630864d6d..5be1f0e66e21 100644 --- a/l10ntools/source/xmlparse.cxx +++ b/l10ntools/source/xmlparse.cxx @@ -158,37 +158,6 @@ void XMLParentNode::AddChild( XMLChildNode *pChild , size_t pos ) } } -/*****************************************************************************/ -int XMLParentNode::RemoveChild( XMLElement *pRefElement ) -/*****************************************************************************/ -{ - XMLElement* a; - if ( pChildList ){ - for ( size_t i = 0; i < pChildList->size(); i++ ) { - XMLChildNode *pChild = (*pChildList)[ i ]; - if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ - a = static_cast(pChild); - rtl::OString elemid(a->GetId().toAsciiLowerCase()); - rtl::OString elemLID(a->GetLanguageId().toAsciiLowerCase()); - rtl::OString pRefLID( - pRefElement->GetLanguageId().toAsciiLowerCase()); - if (elemid == pRefElement->GetId() && elemLID == pRefLID) - { - if( pRefElement->ToOString().compareTo( a->ToOString() )==0 ){ - XMLChildNodeList::iterator it = pChildList->begin(); - ::std::advance( it, i ); - pChildList->erase( it ); - delete a; // Test - return i; - } - } - } - - } - } - return -1; -} - /*****************************************************************************/ void XMLParentNode::RemoveAndDeleteAllChildren(){ /*****************************************************************************/ @@ -199,36 +168,6 @@ void XMLParentNode::RemoveAndDeleteAllChildren(){ } } -/*****************************************************************************/ -XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement ) -/*****************************************************************************/ -{ - for ( size_t i = 0; i < pChildList->size(); i++ ) { - XMLChildNode *pChild = (*pChildList)[ i ]; - if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ) - if ((( XMLElement * ) pChild )->GetName() == - pRefElement->GetName()) - { - XMLAttributeList *pList = pRefElement->GetAttributeList(); - if ( !pList ) - return ( XMLElement * ) pChild; - - sal_Bool bMatch = sal_False; - for ( size_t j = 0; j < pList->size() && bMatch; j++ ) { - XMLAttribute *pAttribute = (*pList)[ j ]; - XMLAttribute *pCandidate = - (( XMLElement * ) pChild )->GetAttribute( - pAttribute->GetName() ); - if ( !pCandidate || !pAttribute->IsEqual( *pCandidate )) - bMatch = sal_False; - } - if ( bMatch ) - return ( XMLElement * ) pChild; - } - } - return NULL; -} - // // class XMLFile // diff --git a/unusedcode.easy b/unusedcode.easy index 54ba51203865..79a729f02e00 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -341,8 +341,6 @@ XMLFontAutoStylePoolNames_Impl::Remove(rtl::OUString*) XMLFontAutoStylePool_Impl::GetPos(XMLFontAutoStylePoolEntry_Impl const*) const XMLFontAutoStylePool_Impl::Remove(XMLFontAutoStylePoolEntry_Impl*) XMLParentNode::AddChild(XMLChildNode*, unsigned long) -XMLParentNode::GetChildElement(XMLElement*) -XMLParentNode::RemoveChild(XMLElement*) XMLPropertyBackpatcher::XMLPropertyBackpatcher(char const*) XMLPropertyBackpatcher::XMLPropertyBackpatcher(char const*, char const*, unsigned char, rtl::OUString) XMLPropertyBackpatcher::XMLPropertyBackpatcher(rtl::OUString const&, rtl::OUString const&, unsigned char, rtl::OUString) -- cgit v1.2.3