summaryrefslogtreecommitdiff
path: root/writerperfect
diff options
context:
space:
mode:
authoralonso <laurent.alonso@inria.fr>2014-05-30 12:26:34 +0200
committerDavid Tardon <dtardon@redhat.com>2014-05-30 12:53:44 +0200
commit78fe1a5edf1dcdec44441fdb57554333a25ac3b1 (patch)
treeb5d68fc481384ce44258c689a254622c25d16870 /writerperfect
parent1f0b7e5dc4299ff0c4c52fc69fa97b99d9e9e076 (diff)
fix creation of substreams for OLE2
Change-Id: Idade93bcc1981543357e849b2faf075e7a021d3e
Diffstat (limited to 'writerperfect')
-rw-r--r--writerperfect/source/common/WPXSvInputStream.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
index 4fad167784c7..e5cf65b8bb8b 100644
--- a/writerperfect/source/common/WPXSvInputStream.cxx
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
@@ -174,7 +174,11 @@ void OLEStorageImpl::initialize(SvStream *const pStream)
SotStorageStreamRef OLEStorageImpl::getStream(const rtl::OUString &rPath)
{
- NameMap_t::iterator aIt = maNameMap.find(rPath);
+ rtl::OUString aPath(rPath);
+ // accept paths which begin by '/'
+ if (aPath.startsWith("/") && aPath.getLength() >= 2)
+ aPath=rPath.copy(1);
+ 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,
@@ -183,7 +187,7 @@ SotStorageStreamRef OLEStorageImpl::getStream(const rtl::OUString &rPath)
return SotStorageStreamRef();
if (!maStreams[aIt->second].stream.ref.Is())
- maStreams[aIt->second].stream.ref = createStream(rPath);
+ maStreams[aIt->second].stream.ref = createStream(aPath);
return maStreams[aIt->second].stream.ref;
}
@@ -206,7 +210,7 @@ void OLEStorageImpl::traverse(const SotStorageRef &rStorage, const rtl::OUString
{
if (aIt->IsStream())
{
- maStreams.push_back(OLEStreamData(rtl::OUStringToOString(aIt->GetName(), RTL_TEXTENCODING_UTF8)));
+ maStreams.push_back(OLEStreamData(rtl::OUStringToOString(concatPath(rPath, aIt->GetName()), RTL_TEXTENCODING_UTF8)));
maNameMap[concatPath(rPath, aIt->GetName())] = maStreams.size() - 1;
}
else if (aIt->IsStorage())