diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-06-19 14:38:25 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-06-19 14:38:25 +0000 |
commit | 535340372e9d02d9facc29363a42f763066b50d8 (patch) | |
tree | 168a6cad3d59c103b43a613753230dcdc28e3f83 | |
parent | 110f2588d67cf32e7791fb65f531a7c4c1f443bd (diff) |
INTEGRATION: CWS jl103 (1.10.10); FILE MERGED
2008/06/13 07:28:39 jl 1.10.10.1: #i86233# uri encoding the URI attribute of the reference elements
-rw-r--r-- | xmlsecurity/source/helper/documentsignaturehelper.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index eda60f549889..37186bd2515c 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: documentsignaturehelper.cxx,v $ - * $Revision: 1.10 $ + * $Revision: 1.11 $ * * This file is part of OpenOffice.org. * @@ -42,6 +42,7 @@ #include "comphelper/documentconstants.hxx" #include <tools/debug.hxx> +#include "rtl/uri.hxx" using namespace ::com::sun::star; namespace css = ::com::sun::star; @@ -93,15 +94,22 @@ void ImplFillElementList( std::vector< rtl::OUString >& rList, const uno::Refere { if ( pNames[n] != aMetaInfName ) { + ::rtl::OUString sEncName = ::rtl::Uri::encode( + pNames[n], rtl_UriCharClassRelSegment, + rtl_UriEncodeStrict, RTL_TEXTENCODING_UTF8); + if (sEncName.getLength() == 0 && pNames[n].getLength() != 0) + throw css::uno::Exception(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Failed to encode element name of XStorage")), 0); + if ( rxStore->isStreamElement( pNames[n] ) ) { - ::rtl::OUString aFullName( rRootStorageName + pNames[n] ); - rList.push_back( aFullName ); + ::rtl::OUString aFullName( rRootStorageName + sEncName ); + rList.push_back(aFullName); } else if ( bRecursive && rxStore->isStorageElement( pNames[n] ) ) { uno::Reference < embed::XStorage > xSubStore = rxStore->openStorageElement( pNames[n], embed::ElementModes::READ ); - rtl::OUString aFullRootName( rRootStorageName + pNames[n] + aSep ); + rtl::OUString aFullRootName( rRootStorageName + sEncName + aSep ); ImplFillElementList( rList, xSubStore, aFullRootName, bRecursive ); } } |