This patch removes unused code as listed in unusedcode.easy
From 85de68332e5419fbf2ef58957a9c11f588fad6c1 Mon Sep 17 00:00:00 2001
From: Santiago Martinez <smvarela@gmail.com>
Date: Tue, 27 Mar 2012 21:16:50 +0200
Subject: [PATCH] Remove unused code in l10ntools.
---
l10ntools/inc/xmlparse.hxx | 6 ----
l10ntools/source/xmlparse.cxx | 61 -----------------------------------------
unusedcode.easy | 2 -
3 files changed, 0 insertions(+), 69 deletions(-)
diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index cd9bc2b..0731a9f 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 e646308..5be1f0e 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -159,37 +159,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<XMLElement* >(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(){
/*****************************************************************************/
if ( pChildList ) {
@@ -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 54ba512..79a729f 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<rtl::OUString>::XMLPropertyBackpatcher(char const*)
XMLPropertyBackpatcher<rtl::OUString>::XMLPropertyBackpatcher(char const*, char const*, unsigned
char, rtl::OUString)
XMLPropertyBackpatcher<rtl::OUString>::XMLPropertyBackpatcher(rtl::OUString const&, rtl::OUString
const&, unsigned char, rtl::OUString)
--
1.7.7.6
Context
- [PATCH] Remove unused code (l10ntools) · Santiago Martinez
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.