diff options
author | Cao Cuong Ngo <cao.cuong.ngo@gmail.com> | 2013-09-21 23:36:06 +0200 |
---|---|---|
committer | Cao Cuong Ngo <cao.cuong.ngo@gmail.com> | 2013-09-26 16:15:39 +0200 |
commit | 34f4d2574987b272681b5843e8f5edc374f55fde (patch) | |
tree | 286bc62f7382aec34deb98af0565dea9b6ad4a19 /comphelper/source | |
parent | 92db3f7c397ba5508daa386e19caf2b1661ec4b4 (diff) |
CMIS file picker: it really does not like ID Mark
The file picker can't go back folder if we use
ID mark in the URL.
Conflicts:
ucb/source/ucp/cmis/cmis_content.cxx
Change-Id: I6985feec71dc23848ee022e0bab9e8515a21ffd2
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/mediadescriptor.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx index 7fd7d5fc272b..21361f565dae 100644 --- a/comphelper/source/misc/mediadescriptor.cxx +++ b/comphelper/source/misc/mediadescriptor.cxx @@ -47,6 +47,23 @@ namespace comphelper{ +namespace { + + OUString removeFragment(OUString const & uri) { + css::uno::Reference< css::uri::XUriReference > ref( + css::uri::UriReferenceFactory::create( + comphelper::getProcessComponentContext())-> + parse(uri)); + if (ref.is()) { + ref->clearFragment(); + return ref->getUriReference(); + } else { + SAL_WARN("comphelper", "cannot parse <" << uri << ">"); + return uri; + } + } +} + const OUString& MediaDescriptor::PROP_ABORTED() { static const OUString sProp("Aborted"); @@ -467,9 +484,7 @@ sal_Bool MediaDescriptor::impl_addInputStream( sal_Bool bLockFile ) css::uno::Reference< css::uno::XInterface >()); // Parse URL! Only the main part has to be used further. E.g. a jumpmark can make trouble - // We need to keep the full URL with Mark to store the Object ID - // in CMIS UCB - return impl_openStreamWithURL( sURL, bLockFile ); + return impl_openStreamWithURL( removeFragment(sURL), bLockFile ); } catch(const css::uno::Exception& ex) { |