summaryrefslogtreecommitdiff
path: root/comphelper/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-02 23:34:41 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-03 00:48:14 +0100
commitc9a1a2acd51224f525f6ed246e52511192215dc0 (patch)
treecb7a2daf1ce8feb6982bab38eaff1a986c2c8ff9 /comphelper/source
parent18ab7abaa9426cd27092125637fdf5fb849b4a04 (diff)
new comphelper::OStorageHelper::GetStreamAtPackageURL
Diffstat (limited to 'comphelper/source')
-rw-r--r--comphelper/source/misc/storagehelper.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index 0aee11e259ee..6fb41c9cedb9 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -598,6 +598,22 @@ uno::Reference< io::XStream > OStorageHelper::GetStreamAtPath(
return xStorage->openStreamElement( aName, nOpenMode );
}
+uno::Reference< io::XStream > OStorageHelper::GetStreamAtPackageURL(
+ uno::Reference< embed::XStorage > const& xParentStorage,
+ const ::rtl::OUString& rURL, sal_uInt32 const nOpenMode,
+ OStorageHelper::LifecycleProxy & rNastiness)
+{
+ static char const s_PkgScheme[] = "vnd.sun.star.Package:";
+ if (0 == rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength(
+ rURL.getStr(), rURL.getLength(),
+ s_PkgScheme, SAL_N_ELEMENTS(s_PkgScheme) - 1))
+ {
+ ::rtl::OUString const path(rURL.copy(SAL_N_ELEMENTS(s_PkgScheme)-1));
+ return GetStreamAtPath(xParentStorage, path, nOpenMode, rNastiness);
+ }
+ return 0;
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */