Kaydet (Commit) 9440f6e5 authored tarafından Joseph Powers's avatar Joseph Powers

Remove DECLARE_LIST( XMLChildNodeList, XMLChildNode* )

üst f461a9b0
......@@ -133,7 +133,7 @@ public:
virtual ~XMLChildNode(){};
};
DECLARE_LIST( XMLChildNodeList, XMLChildNode * )
typedef ::std::vector< XMLChildNode* > XMLChildNodeList;
//-------------------------------------------------------------------------
......@@ -144,9 +144,9 @@ class XMLData;
class XMLParentNode : public XMLChildNode
{
private:
XMLChildNodeList *pChildList;
XMLChildNodeList* pChildList;
static int dbgcnt;
//int nParentPos;
protected:
XMLParentNode( XMLParentNode *pPar )
: XMLChildNode( pPar ), pChildList( NULL )
......@@ -173,11 +173,11 @@ public:
);
void AddChild(
XMLChildNode *pChild , int pos /// the new child
XMLChildNode *pChild , size_t pos /// the new child
);
virtual int GetPosition( ByteString id );
int RemoveChild( XMLElement *pRefElement );
size_t RemoveChild( XMLElement *pRefElement );
void RemoveAndDeleteAllChilds();
/// returns a child element which matches the given one
......
......@@ -45,11 +45,15 @@ LayoutXMLFile::SearchL10NElements( XMLParentNode* pCur, int )
/* Recurse int children, SearchL10NElements does not do that for us. */
if ( XMLChildNodeList* lst = pCur->GetChildList() )
for ( ULONG i = 0; i < lst->Count(); i++ )
if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_ELEMENT )
HandleElement( ( XMLElement* )lst->GetObject( i ) );
else if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_COMMENT )
lst->Remove( i-- );
for ( size_t i = 0; i < lst->size(); i++ )
if ( (*lst)[ i ]->GetNodeType() == XML_NODE_TYPE_ELEMENT )
HandleElement( ( XMLElement* )(*lst)[ i ] );
else if ( (*lst)[ i ]->GetNodeType() == XML_NODE_TYPE_COMMENT ) {
XMLChildNodeList::iterator it = lst->begin();
::std::advance( it, i );
lst->erase( it );
i--;
}
}
std::vector<XMLAttribute*>
......
......@@ -214,7 +214,6 @@ translateElement( XMLElement* element, ByteString const& lang,
{
ByteString translation;
entry->GetText( translation, STRING_TYP_TEXT, lang, true );
// ByteString original = removeContent( element );
if ( !translation.Len() )
translation = BSTRING( ( *i )->GetValue() );
delete translateAttribute( attributes, **i , STRING( translation ) );
......@@ -250,17 +249,23 @@ static void make_directory( ByteString const& name )
static void insertMarker( XMLParentNode *p, ByteString const& file )
{
if ( XMLChildNodeList* lst = p->GetChildList() )
if ( lst->Count() )
if ( !lst->empty() )
{
ULONG i = 1;
size_t i = 1;
// Skip newline, if possible.
if ( lst->Count() > 1
&& lst->GetObject( 2 )->GetNodeType() == XML_NODE_TYPE_DEFAULT )
if ( lst->size() > 2
&& (*lst)[ 2 ]->GetNodeType() == XML_NODE_TYPE_DEFAULT )
i++;
OUString marker = OUString(RTL_CONSTASCII_USTRINGPARAM("\n NOTE: This file has been generated automagically by transex3/layout/tralay,\n from source template: "))
+ STRING( file )
+ OUString(RTL_CONSTASCII_USTRINGPARAM(".\n Do not edit, changes will be lost.\n"));
lst->Insert( new XMLComment( marker, 0 ), i );
if ( i < lst->size() ) {
XMLChildNodeList::iterator it = lst->begin();
::std::advance( it, i );
lst->insert( it, new XMLComment( marker, 0 ) );
} else {
lst->push_back( new XMLComment( marker, 0 ) );
}
}
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment