1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "ManifestImport.hxx"
21 #include "ManifestDefines.hxx"
22 #include <PackageConstants.hxx>
23 #include <osl/diagnose.h>
24 #include <com/sun/star/xml/sax/XAttributeList.hpp>
25 #include <com/sun/star/xml/crypto/DigestID.hpp>
26 #include <com/sun/star/xml/crypto/CipherID.hpp>
27 #include <com/sun/star/beans/PropertyValue.hpp>
28 #include <comphelper/base64.hxx>
29 #include <comphelper/sequence.hxx>
31 using namespace com::sun::star::uno
;
32 using namespace com::sun::star::beans
;
33 using namespace com::sun::star
;
35 constexpr OUStringLiteral
gsFullPathProperty ( u
"FullPath" );
36 constexpr OUStringLiteral
gsMediaTypeProperty ( u
"MediaType" );
37 constexpr OUStringLiteral
gsVersionProperty ( u
"Version" );
38 constexpr OUStringLiteral
gsIterationCountProperty ( u
"IterationCount" );
39 constexpr OUStringLiteral
gsDerivedKeySizeProperty ( u
"DerivedKeySize" );
40 constexpr OUStringLiteral
gsSaltProperty ( u
"Salt" );
41 constexpr OUStringLiteral
gsInitialisationVectorProperty ( u
"InitialisationVector" );
42 constexpr OUStringLiteral
gsSizeProperty ( u
"Size" );
43 constexpr OUStringLiteral
gsDigestProperty ( u
"Digest" );
44 constexpr OUStringLiteral
gsEncryptionAlgProperty ( u
"EncryptionAlgorithm" );
45 constexpr OUStringLiteral
gsStartKeyAlgProperty ( u
"StartKeyAlgorithm" );
46 constexpr OUStringLiteral
gsDigestAlgProperty ( u
"DigestAlgorithm" );
48 ManifestImport::ManifestImport( std::vector
< Sequence
< PropertyValue
> > & rNewManVector
)
49 : bIgnoreEncryptData ( false )
50 , bPgpEncryption ( false )
51 , nDerivedKeySize( 0 )
52 , rManVector ( rNewManVector
)
57 ManifestImport::~ManifestImport()
61 void SAL_CALL
ManifestImport::startDocument( )
65 void SAL_CALL
ManifestImport::endDocument( )
69 void ManifestImport::doFileEntry(StringHashMap
&rConvertedAttribs
)
71 aSequence
.resize(PKG_SIZE_ENCR_MNFST
);
73 aSequence
[PKG_MNFST_FULLPATH
].Name
= gsFullPathProperty
;
74 aSequence
[PKG_MNFST_FULLPATH
].Value
<<= rConvertedAttribs
[ATTRIBUTE_FULL_PATH
];
75 aSequence
[PKG_MNFST_MEDIATYPE
].Name
= gsMediaTypeProperty
;
76 aSequence
[PKG_MNFST_MEDIATYPE
].Value
<<= rConvertedAttribs
[ATTRIBUTE_MEDIA_TYPE
];
78 OUString sVersion
= rConvertedAttribs
[ATTRIBUTE_VERSION
];
79 if ( sVersion
.getLength() ) {
80 aSequence
[PKG_MNFST_VERSION
].Name
= gsVersionProperty
;
81 aSequence
[PKG_MNFST_VERSION
].Value
<<= sVersion
;
84 OUString sSize
= rConvertedAttribs
[ATTRIBUTE_SIZE
];
85 if ( sSize
.getLength() ) {
86 sal_Int64 nSize
= sSize
.toInt64();
87 aSequence
[PKG_MNFST_UCOMPSIZE
].Name
= gsSizeProperty
;
88 aSequence
[PKG_MNFST_UCOMPSIZE
].Value
<<= nSize
;
92 void ManifestImport::doEncryptedKey(StringHashMap
&)
94 aKeyInfoSequence
.clear();
95 aKeyInfoSequence
.resize(3);
98 void ManifestImport::doEncryptionMethod(StringHashMap
&rConvertedAttribs
,
99 const OUString
& rAlgoAttrName
)
101 OUString aString
= rConvertedAttribs
[rAlgoAttrName
];
102 if ( aKeyInfoSequence
.size() != 3
103 || aString
!= "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" )
105 bIgnoreEncryptData
= true;
109 void ManifestImport::doEncryptedCipherValue()
111 if ( aKeyInfoSequence
.size() == 3 )
113 aKeyInfoSequence
[2].Name
= "CipherValue";
114 uno::Sequence
< sal_Int8
> aDecodeBuffer
;
115 ::comphelper::Base64::decode(aDecodeBuffer
, aCurrentCharacters
);
116 aKeyInfoSequence
[2].Value
<<= aDecodeBuffer
;
117 aCurrentCharacters
.setLength(0); // consumed
120 bIgnoreEncryptData
= true;
123 void ManifestImport::doEncryptedKeyId()
125 if ( aKeyInfoSequence
.size() == 3 )
127 aKeyInfoSequence
[0].Name
= "KeyId";
128 uno::Sequence
< sal_Int8
> aDecodeBuffer
;
129 ::comphelper::Base64::decode(aDecodeBuffer
, aCurrentCharacters
);
130 aKeyInfoSequence
[0].Value
<<= aDecodeBuffer
;
131 aCurrentCharacters
.setLength(0); // consumed
134 bIgnoreEncryptData
= true;
137 void ManifestImport::doEncryptedKeyPacket()
139 if ( aKeyInfoSequence
.size() == 3 )
141 aKeyInfoSequence
[1].Name
= "KeyPacket";
142 uno::Sequence
< sal_Int8
> aDecodeBuffer
;
143 ::comphelper::Base64::decode(aDecodeBuffer
, aCurrentCharacters
);
144 aKeyInfoSequence
[1].Value
<<= aDecodeBuffer
;
145 aCurrentCharacters
.setLength(0); // consumed
148 bIgnoreEncryptData
= true;
151 void ManifestImport::doEncryptionData(StringHashMap
&rConvertedAttribs
)
153 // If this element exists, then this stream is encrypted and we need
154 // to import the initialisation vector, salt and iteration count used
156 OUString aString
= rConvertedAttribs
[ATTRIBUTE_CHECKSUM_TYPE
];
157 if ( bIgnoreEncryptData
)
160 if ( aString
== SHA1_1K_NAME
|| aString
== SHA1_1K_URL
) {
161 aSequence
[PKG_MNFST_DIGESTALG
].Name
= gsDigestAlgProperty
;
162 aSequence
[PKG_MNFST_DIGESTALG
].Value
<<= xml::crypto::DigestID::SHA1_1K
;
163 } else if ( aString
== SHA256_1K_URL
) {
164 aSequence
[PKG_MNFST_DIGESTALG
].Name
= gsDigestAlgProperty
;
165 aSequence
[PKG_MNFST_DIGESTALG
].Value
<<= xml::crypto::DigestID::SHA256_1K
;
167 bIgnoreEncryptData
= true;
169 if ( !bIgnoreEncryptData
) {
170 aString
= rConvertedAttribs
[ATTRIBUTE_CHECKSUM
];
171 uno::Sequence
< sal_Int8
> aDecodeBuffer
;
172 ::comphelper::Base64::decode(aDecodeBuffer
, aString
);
173 aSequence
[PKG_MNFST_DIGEST
].Name
= gsDigestProperty
;
174 aSequence
[PKG_MNFST_DIGEST
].Value
<<= aDecodeBuffer
;
178 void ManifestImport::doAlgorithm(StringHashMap
&rConvertedAttribs
)
180 if ( bIgnoreEncryptData
)
183 OUString aString
= rConvertedAttribs
[ATTRIBUTE_ALGORITHM_NAME
];
184 if ( aString
== BLOWFISH_NAME
|| aString
== BLOWFISH_URL
) {
185 aSequence
[PKG_MNFST_ENCALG
].Name
= gsEncryptionAlgProperty
;
186 aSequence
[PKG_MNFST_ENCALG
].Value
<<= xml::crypto::CipherID::BLOWFISH_CFB_8
;
187 } else if ( aString
== AES256_URL
) {
188 aSequence
[PKG_MNFST_ENCALG
].Name
= gsEncryptionAlgProperty
;
189 aSequence
[PKG_MNFST_ENCALG
].Value
<<= xml::crypto::CipherID::AES_CBC_W3C_PADDING
;
190 OSL_ENSURE( !nDerivedKeySize
|| nDerivedKeySize
== 32, "Unexpected derived key length!" );
191 nDerivedKeySize
= 32;
192 } else if ( aString
== AES192_URL
) {
193 aSequence
[PKG_MNFST_ENCALG
].Name
= gsEncryptionAlgProperty
;
194 aSequence
[PKG_MNFST_ENCALG
].Value
<<= xml::crypto::CipherID::AES_CBC_W3C_PADDING
;
195 OSL_ENSURE( !nDerivedKeySize
|| nDerivedKeySize
== 24, "Unexpected derived key length!" );
196 nDerivedKeySize
= 24;
197 } else if ( aString
== AES128_URL
) {
198 aSequence
[PKG_MNFST_ENCALG
].Name
= gsEncryptionAlgProperty
;
199 aSequence
[PKG_MNFST_ENCALG
].Value
<<= xml::crypto::CipherID::AES_CBC_W3C_PADDING
;
200 OSL_ENSURE( !nDerivedKeySize
|| nDerivedKeySize
== 16, "Unexpected derived key length!" );
201 nDerivedKeySize
= 16;
203 bIgnoreEncryptData
= true;
205 if ( !bIgnoreEncryptData
) {
206 aString
= rConvertedAttribs
[ATTRIBUTE_INITIALISATION_VECTOR
];
207 uno::Sequence
< sal_Int8
> aDecodeBuffer
;
208 ::comphelper::Base64::decode(aDecodeBuffer
, aString
);
209 aSequence
[PKG_MNFST_INIVECTOR
].Name
= gsInitialisationVectorProperty
;
210 aSequence
[PKG_MNFST_INIVECTOR
].Value
<<= aDecodeBuffer
;
214 void ManifestImport::doKeyDerivation(StringHashMap
&rConvertedAttribs
)
216 if ( bIgnoreEncryptData
)
219 OUString aString
= rConvertedAttribs
[ATTRIBUTE_KEY_DERIVATION_NAME
];
220 if ( aString
== PBKDF2_NAME
|| aString
== PBKDF2_URL
) {
221 aString
= rConvertedAttribs
[ATTRIBUTE_SALT
];
222 uno::Sequence
< sal_Int8
> aDecodeBuffer
;
223 ::comphelper::Base64::decode(aDecodeBuffer
, aString
);
224 aSequence
[PKG_MNFST_SALT
].Name
= gsSaltProperty
;
225 aSequence
[PKG_MNFST_SALT
].Value
<<= aDecodeBuffer
;
227 aString
= rConvertedAttribs
[ATTRIBUTE_ITERATION_COUNT
];
228 aSequence
[PKG_MNFST_ITERATION
].Name
= gsIterationCountProperty
;
229 aSequence
[PKG_MNFST_ITERATION
].Value
<<= aString
.toInt32();
231 aString
= rConvertedAttribs
[ATTRIBUTE_KEY_SIZE
];
232 if ( aString
.getLength() ) {
233 sal_Int32 nKey
= aString
.toInt32();
234 OSL_ENSURE( !nDerivedKeySize
|| nKey
== nDerivedKeySize
, "Provided derived key length differs from the expected one!" );
235 nDerivedKeySize
= nKey
;
236 } else if ( !nDerivedKeySize
)
237 nDerivedKeySize
= 16;
238 else if ( nDerivedKeySize
!= 16 )
239 OSL_ENSURE( false, "Default derived key length differs from the expected one!" );
241 aSequence
[PKG_MNFST_DERKEYSIZE
].Name
= gsDerivedKeySizeProperty
;
242 aSequence
[PKG_MNFST_DERKEYSIZE
].Value
<<= nDerivedKeySize
;
243 } else if ( bPgpEncryption
) {
244 if ( aString
!= "PGP" )
245 bIgnoreEncryptData
= true;
247 bIgnoreEncryptData
= true;
250 void ManifestImport::doStartKeyAlg(StringHashMap
&rConvertedAttribs
)
252 OUString aString
= rConvertedAttribs
[ATTRIBUTE_START_KEY_GENERATION_NAME
];
253 if (aString
== SHA256_URL
|| aString
== SHA256_URL_ODF12
) {
254 aSequence
[PKG_MNFST_STARTALG
].Name
= gsStartKeyAlgProperty
;
255 aSequence
[PKG_MNFST_STARTALG
].Value
<<= xml::crypto::DigestID::SHA256
;
256 } else if ( aString
== SHA1_NAME
|| aString
== SHA1_URL
) {
257 aSequence
[PKG_MNFST_STARTALG
].Name
= gsStartKeyAlgProperty
;
258 aSequence
[PKG_MNFST_STARTALG
].Value
<<= xml::crypto::DigestID::SHA1
;
260 bIgnoreEncryptData
= true;
263 void SAL_CALL
ManifestImport::startElement( const OUString
& aName
, const uno::Reference
< xml::sax::XAttributeList
>& xAttribs
)
265 StringHashMap aConvertedAttribs
;
266 OUString aConvertedName
= PushNameAndNamespaces( aName
, xAttribs
, aConvertedAttribs
);
268 size_t nLevel
= aStack
.size();
274 if (aConvertedName
!= ELEMENT_MANIFEST
) //manifest:manifest
275 aStack
.back().m_bValid
= false;
279 if (aConvertedName
== ELEMENT_FILE_ENTRY
) //manifest:file-entry
280 doFileEntry(aConvertedAttribs
);
281 else if (aConvertedName
== ELEMENT_MANIFEST_KEYINFO
) //loext:keyinfo
283 else if (aConvertedName
== ELEMENT_ENCRYPTEDKEY13
) //manifest:encrypted-key
284 doEncryptedKey(aConvertedAttribs
);
286 aStack
.back().m_bValid
= false;
290 ManifestStack::reverse_iterator aIter
= aStack
.rbegin();
293 if (!aIter
->m_bValid
)
294 aStack
.back().m_bValid
= false;
295 else if (aConvertedName
== ELEMENT_ENCRYPTION_DATA
) //manifest:encryption-data
296 doEncryptionData(aConvertedAttribs
);
297 else if (aConvertedName
== ELEMENT_ENCRYPTEDKEY
) //loext:encrypted-key
298 doEncryptedKey(aConvertedAttribs
);
299 else if (aConvertedName
== ELEMENT_ENCRYPTIONMETHOD13
) //manifest:encryption-method
300 doEncryptionMethod(aConvertedAttribs
, ATTRIBUTE_ALGORITHM13
);
301 else if (aConvertedName
== ELEMENT_MANIFEST13_KEYINFO
) //manifest:keyinfo
303 else if (aConvertedName
== ELEMENT_CIPHERDATA13
) //manifest:CipherData
306 aStack
.back().m_bValid
= false;
310 ManifestStack::reverse_iterator aIter
= aStack
.rbegin();
313 if (!aIter
->m_bValid
)
314 aStack
.back().m_bValid
= false;
315 else if (aConvertedName
== ELEMENT_ALGORITHM
) //manifest:algorithm,
316 doAlgorithm(aConvertedAttribs
);
317 else if (aConvertedName
== ELEMENT_KEY_DERIVATION
) //manifest:key-derivation,
318 doKeyDerivation(aConvertedAttribs
);
319 else if (aConvertedName
== ELEMENT_START_KEY_GENERATION
) //manifest:start-key-generation
320 doStartKeyAlg(aConvertedAttribs
);
321 else if (aConvertedName
== ELEMENT_ENCRYPTIONMETHOD
) //loext:encryption-method
322 doEncryptionMethod(aConvertedAttribs
, ATTRIBUTE_ALGORITHM
);
323 else if (aConvertedName
== ELEMENT_ENCRYPTED_KEYINFO
) //loext:KeyInfo
325 else if (aConvertedName
== ELEMENT_CIPHERDATA
) //loext:CipherData
327 else if (aConvertedName
== ELEMENT_PGPDATA13
) //manifest:PGPData
329 else if (aConvertedName
== ELEMENT_CIPHERVALUE13
) //manifest:CipherValue
330 // ciphervalue action happens on endElement
331 aCurrentCharacters
= "";
333 aStack
.back().m_bValid
= false;
337 ManifestStack::reverse_iterator aIter
= aStack
.rbegin();
340 if (!aIter
->m_bValid
)
341 aStack
.back().m_bValid
= false;
342 else if (aConvertedName
== ELEMENT_PGPDATA
) //loext:PGPData
344 else if (aConvertedName
== ELEMENT_CIPHERVALUE
) //loext:CipherValue
345 // ciphervalue action happens on endElement
346 aCurrentCharacters
= "";
347 else if (aConvertedName
== ELEMENT_PGPKEYID13
) //manifest:PGPKeyID
348 // ciphervalue action happens on endElement
349 aCurrentCharacters
= "";
350 else if (aConvertedName
== ELEMENT_PGPKEYPACKET13
) //manifest:PGPKeyPacket
351 // ciphervalue action happens on endElement
352 aCurrentCharacters
= "";
354 aStack
.back().m_bValid
= false;
358 ManifestStack::reverse_iterator aIter
= aStack
.rbegin();
361 if (!aIter
->m_bValid
)
362 aStack
.back().m_bValid
= false;
363 else if (aConvertedName
== ELEMENT_PGPKEYID
) //loext:PGPKeyID
364 // ciphervalue action happens on endElement
365 aCurrentCharacters
= "";
366 else if (aConvertedName
== ELEMENT_PGPKEYPACKET
) //loext:PGPKeyPacket
367 // ciphervalue action happens on endElement
368 aCurrentCharacters
= "";
370 aStack
.back().m_bValid
= false;
374 aStack
.back().m_bValid
= false;
381 bool isEmpty(const css::beans::PropertyValue
&rProp
)
383 return rProp
.Name
.isEmpty();
387 void SAL_CALL
ManifestImport::endElement( const OUString
& aName
)
389 size_t nLevel
= aStack
.size();
393 OUString aConvertedName
= ConvertName( aName
);
394 if ( aStack
.empty() || aStack
.rbegin()->m_aConvertedName
!= aConvertedName
)
397 if ( aConvertedName
== ELEMENT_FILE_ENTRY
&& aStack
.back().m_bValid
) {
398 // root folder gets KeyInfo entry if any, for PGP encryption
399 if (!bIgnoreEncryptData
&& !aKeys
.empty() && aSequence
[PKG_MNFST_FULLPATH
].Value
.get
<OUString
>() == "/" )
401 aSequence
[PKG_SIZE_NOENCR_MNFST
].Name
= "KeyInfo";
402 aSequence
[PKG_SIZE_NOENCR_MNFST
].Value
<<= comphelper::containerToSequence(aKeys
);
404 aSequence
.erase(std::remove_if(aSequence
.begin(), aSequence
.end(),
405 isEmpty
), aSequence
.end());
407 bIgnoreEncryptData
= false;
408 rManVector
.push_back ( comphelper::containerToSequence(aSequence
) );
412 else if ( (aConvertedName
== ELEMENT_ENCRYPTEDKEY
413 || aConvertedName
== ELEMENT_ENCRYPTEDKEY13
)
414 && aStack
.back().m_bValid
) {
415 if ( !bIgnoreEncryptData
)
417 aKeys
.push_back( comphelper::containerToSequence(aKeyInfoSequence
) );
418 bPgpEncryption
= true;
420 aKeyInfoSequence
.clear();
423 // end element handling for elements with cdata
426 if (aConvertedName
== ELEMENT_CIPHERVALUE13
) //manifest:CipherValue
427 doEncryptedCipherValue();
429 aStack
.back().m_bValid
= false;
433 if (aConvertedName
== ELEMENT_CIPHERVALUE
) //loext:CipherValue
434 doEncryptedCipherValue();
435 else if (aConvertedName
== ELEMENT_PGPKEYID13
) //manifest:PGPKeyID
437 else if (aConvertedName
== ELEMENT_PGPKEYPACKET13
) //manifest:PGPKeyPacket
438 doEncryptedKeyPacket();
440 aStack
.back().m_bValid
= false;
444 if (aConvertedName
== ELEMENT_PGPKEYID
) //loext:PGPKeyID
446 else if (aConvertedName
== ELEMENT_PGPKEYPACKET
) //loext:PGPKeyPacket
447 doEncryptedKeyPacket();
449 aStack
.back().m_bValid
= false;
457 void SAL_CALL
ManifestImport::characters( const OUString
& aChars
)
459 aCurrentCharacters
.append(aChars
);
462 void SAL_CALL
ManifestImport::ignorableWhitespace( const OUString
& /*aWhitespaces*/ )
466 void SAL_CALL
ManifestImport::processingInstruction( const OUString
& /*aTarget*/, const OUString
& /*aData*/ )
470 void SAL_CALL
ManifestImport::setDocumentLocator( const uno::Reference
< xml::sax::XLocator
>& /*xLocator*/ )
474 OUString
ManifestImport::PushNameAndNamespaces( const OUString
& aName
, const uno::Reference
< xml::sax::XAttributeList
>& xAttribs
, StringHashMap
& o_aConvertedAttribs
)
476 StringHashMap aNamespaces
;
477 ::std::vector
< ::std::pair
< OUString
, OUString
> > aAttribsStrs
;
479 if ( xAttribs
.is() ) {
480 sal_Int16 nAttrCount
= xAttribs
.is() ? xAttribs
->getLength() : 0;
481 aAttribsStrs
.reserve( nAttrCount
);
483 for( sal_Int16 nInd
= 0; nInd
< nAttrCount
; nInd
++ ) {
484 OUString aAttrName
= xAttribs
->getNameByIndex( nInd
);
485 OUString aAttrValue
= xAttribs
->getValueByIndex( nInd
);
486 if ( aAttrName
.getLength() >= 5
487 && aAttrName
.startsWith("xmlns")
488 && ( aAttrName
.getLength() == 5 || aAttrName
[5] == ':' ) ) {
489 // this is a namespace declaration
490 OUString
aNsName( ( aAttrName
.getLength() == 5 ) ? OUString() : aAttrName
.copy( 6 ) );
491 aNamespaces
[aNsName
] = aAttrValue
;
493 // this is no namespace declaration
494 aAttribsStrs
.emplace_back( aAttrName
, aAttrValue
);
499 OUString aConvertedName
= ConvertNameWithNamespace( aName
, aNamespaces
);
500 if ( !aConvertedName
.getLength() )
501 aConvertedName
= ConvertName( aName
);
503 aStack
.emplace_back( aConvertedName
, std::move(aNamespaces
) );
505 for (const std::pair
<OUString
,OUString
> & rAttribsStr
: aAttribsStrs
) {
506 // convert the attribute names on filling
507 o_aConvertedAttribs
[ConvertName( rAttribsStr
.first
)] = rAttribsStr
.second
;
510 return aConvertedName
;
513 OUString
ManifestImport::ConvertNameWithNamespace( const OUString
& aName
, const StringHashMap
& aNamespaces
)
516 OUString aPureName
= aName
;
518 sal_Int32 nInd
= aName
.indexOf( ':' );
519 if ( nInd
!= -1 && nInd
< aName
.getLength() ) {
520 aNsAlias
= aName
.copy( 0, nInd
);
521 aPureName
= aName
.copy( nInd
+ 1 );
526 StringHashMap::const_iterator aIter
= aNamespaces
.find( aNsAlias
);
527 if ( aIter
!= aNamespaces
.end()
528 && ( aIter
->second
== MANIFEST_NAMESPACE
|| aIter
->second
== MANIFEST_OASIS_NAMESPACE
) ) {
529 // no check for manifest.xml consistency currently since the old versions have supported inconsistent documents as well
530 aResult
= MANIFEST_NSPREFIX
+ aPureName
;
536 OUString
ManifestImport::ConvertName( const OUString
& aName
)
538 OUString aConvertedName
;
539 for ( ManifestStack::reverse_iterator aIter
= aStack
.rbegin(); !aConvertedName
.getLength() && aIter
!= aStack
.rend(); ++aIter
) {
540 if ( !aIter
->m_aNamespaces
.empty() )
541 aConvertedName
= ConvertNameWithNamespace( aName
, aIter
->m_aNamespaces
);
544 if ( !aConvertedName
.getLength() )
545 aConvertedName
= aName
;
547 return aConvertedName
;
550 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */