You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.4 KiB
71 lines
2.4 KiB
From 5e17fa55feb165966fbae7dedd797a841f95a5ee Mon Sep 17 00:00:00 2001
|
|
From: David Tardon <dtardon@redhat.com>
|
|
Date: Fri, 30 May 2014 12:29:40 +0200
|
|
Subject: [PATCH 2/5] generalize this for Zip too
|
|
|
|
Change-Id: I9ca0676f056fe3f09821c208ff095beb1f3c19ac
|
|
(cherry picked from commit aa81b089d3da838129ca44badc60a6489af11d84)
|
|
---
|
|
writerperfect/source/common/WPXSvInputStream.cxx | 24 ++++++++++++++++++------
|
|
1 file changed, 18 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
|
|
index e5cf65b..c9ff75a 100644
|
|
--- a/writerperfect/source/common/WPXSvInputStream.cxx
|
|
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
|
|
@@ -83,6 +83,20 @@ typedef struct
|
|
namespace
|
|
{
|
|
|
|
+rtl::OUString lcl_normalizeSubStreamPath(const rtl::OUString &rPath)
|
|
+{
|
|
+ // accept paths which begin by '/'
|
|
+ // TODO: maybe this should to a full normalization
|
|
+ if (rPath.startsWith("/") && rPath.getLength() >= 2)
|
|
+ return rPath.copy(1);
|
|
+ return rPath;
|
|
+}
|
|
+
|
|
+}
|
|
+
|
|
+namespace
|
|
+{
|
|
+
|
|
const rtl::OUString concatPath(const rtl::OUString &lhs, const rtl::OUString &rhs)
|
|
{
|
|
if (lhs.isEmpty())
|
|
@@ -174,10 +188,7 @@ void OLEStorageImpl::initialize(SvStream *const pStream)
|
|
|
|
SotStorageStreamRef OLEStorageImpl::getStream(const rtl::OUString &rPath)
|
|
{
|
|
- rtl::OUString aPath(rPath);
|
|
- // accept paths which begin by '/'
|
|
- if (aPath.startsWith("/") && aPath.getLength() >= 2)
|
|
- aPath=rPath.copy(1);
|
|
+ const rtl::OUString aPath(lcl_normalizeSubStreamPath(rPath));
|
|
NameMap_t::iterator aIt = maNameMap.find(aPath);
|
|
|
|
// For the while don't return stream in this situation.
|
|
@@ -324,7 +335,8 @@ void ZipStorageImpl::initialize()
|
|
|
|
Reference<XInputStream> ZipStorageImpl::getStream(const rtl::OUString &rPath)
|
|
{
|
|
- NameMap_t::iterator aIt = maNameMap.find(rPath);
|
|
+ const rtl::OUString aPath(lcl_normalizeSubStreamPath(rPath));
|
|
+ NameMap_t::iterator aIt = maNameMap.find(aPath);
|
|
|
|
// For the while don't return stream in this situation.
|
|
// Later, given how libcdr's zip stream implementation behaves,
|
|
@@ -333,7 +345,7 @@ Reference<XInputStream> ZipStorageImpl::getStream(const rtl::OUString &rPath)
|
|
return Reference<XInputStream>();
|
|
|
|
if (!maStreams[aIt->second].xStream.is())
|
|
- maStreams[aIt->second].xStream = createStream(rPath);
|
|
+ maStreams[aIt->second].xStream = createStream(aPath);
|
|
|
|
return maStreams[aIt->second].xStream;
|
|
}
|
|
--
|
|
1.9.3
|
|
|