diff options
author | Michael Stahl <mst@openoffice.org> | 2010-08-12 16:13:11 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-08-12 16:13:11 +0200 |
commit | 893a7cbe2b494d34603e642c8d4ac6a06cb82349 (patch) | |
tree | 808cf3519e57317a6a7747f74666597dcce602c4 /sfx2 | |
parent | 567d3a2e14870f56155aa22823f3fd536dda6c71 (diff) |
sw33bf08: #i108078#: ::sfx2::createBaseURI(): decode content of expand URI
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/DocumentMetadataAccess.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 6b57c26f33..5336b5cfe5 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -45,6 +45,7 @@ #include <rtl/uuid.h> #include <rtl/ustrbuf.hxx> +#include <rtl/uri.hxx> #include <rtl/bootstrap.hxx> #include <comphelper/interaction.hxx> @@ -140,11 +141,19 @@ uno::Reference<rdf::XURI> createBaseURI( // #i108078# workaround non-hierarchical vnd.sun.star.expand URIs // this really should be done somewhere else, not here. ::rtl::OUString pkgURI(i_rPkgURI); - if (pkgURI.matchAsciiL(RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) + if (pkgURI.matchIgnoreAsciiCaseAsciiL( + RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.expand:"))) { // expand it here (makeAbsolute requires hierarchical URI) - pkgURI = pkgURI.copy( sizeof("vnd.sun.star.expand:") - 1 ); - ::rtl::Bootstrap::expandMacros(pkgURI); + pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") ); + if (pkgURI.getLength() != 0) { + pkgURI = ::rtl::Uri::decode( + pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8); + if (pkgURI.getLength() == 0) { + throw uno::RuntimeException(); + } + ::rtl::Bootstrap::expandMacros(pkgURI); + } } const uno::Reference<lang::XMultiComponentFactory> xServiceFactory( |