summaryrefslogtreecommitdiff
path: root/transex3
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-07-30 13:21:00 +0000
committerRüdiger Timm <rt@openoffice.org>2008-07-30 13:21:00 +0000
commit092aa054fcb21f6bea70c3c143b150646fc5f2c5 (patch)
tree1f9e7d5a8d52be2d0fbf169c51c44078a6c77cd6 /transex3
parent05120cea527b60a3df3e5c8a6792d5db52c51833 (diff)
INTEGRATION: CWS layoutdialogs (1.2.2); FILE MERGED
2008/07/30 11:29:33 rt 1.2.2.4: Update license header. 2008/04/04 09:11:45 jcn 1.2.2.3: Remove comments from template and add generated marker. 2008/03/27 13:09:52 jcn 1.2.2.2: Substitute TABs with 4 spaces. 2008/03/26 13:05:21 cl 1.2.2.1: fixing warnings
Diffstat (limited to 'transex3')
-rw-r--r--transex3/layout/layoutparse.cxx40
1 files changed, 37 insertions, 3 deletions
diff --git a/transex3/layout/layoutparse.cxx b/transex3/layout/layoutparse.cxx
index 29dd4ae4e289..0f43c9a3053f 100644
--- a/transex3/layout/layoutparse.cxx
+++ b/transex3/layout/layoutparse.cxx
@@ -1,3 +1,34 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: layoutparse.cxx,v $
+ *
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
#include "layoutparse.hxx"
#define STRING( str ) String( str, RTL_TEXTENCODING_UTF8 )
@@ -20,6 +51,8 @@ LayoutXMLFile::SearchL10NElements( XMLParentNode* pCur, int )
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-- );
}
std::vector<XMLAttribute*>
@@ -42,13 +75,14 @@ LayoutXMLFile::HandleElement( XMLElement* element )
if ( interesting.size() )
{
- ByteString id = BSTRING( interesting[0]->GetValue() );
+ std::vector<XMLAttribute*>::iterator i = interesting.begin();
+
+ ByteString id = BSTRING( (*i++)->GetValue() );
if ( mMergeMode )
InsertL10NElement( id, element );
else
- for ( std::vector<XMLAttribute*>::iterator i = ++interesting.begin();
- i != interesting.end(); ++i )
+ for ( ; i != interesting.end(); ++i )
{
ByteString attributeId = id;
ByteString value = BSTRING( ( *i )->GetValue() );