[Libreoffice-commits] .: l10ntools/inc l10ntools/source unusedcode.easy

Caolán McNamara caolan at kemper.freedesktop.org
Tue Mar 27 12:49:39 PDT 2012


 l10ntools/inc/xmlparse.hxx    |    6 ----
 l10ntools/source/xmlparse.cxx |   61 ------------------------------------------
 unusedcode.easy               |    2 -
 3 files changed, 69 deletions(-)

New commits:
commit a84e97e58fe0915376801f98e1c0d24470f1e1d3
Author: Santiago Martinez <smvarela at gmail.com>
Date:   Tue Mar 27 21:16:50 2012 +0200

    Remove unused code in l10ntools.

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)


More information about the Libreoffice-commits mailing list