parent
5527e4fe40
commit
878bea5503
@ -0,0 +1,49 @@
|
|||||||
|
From e7cd2abfcff1673238e4c517ab614a818a4597f9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: alonso <laurent.alonso@inria.fr>
|
||||||
|
Date: Fri, 30 May 2014 12:26:34 +0200
|
||||||
|
Subject: [PATCH 1/5] fix creation of substreams for OLE2
|
||||||
|
|
||||||
|
Change-Id: Idade93bcc1981543357e849b2faf075e7a021d3e
|
||||||
|
(cherry picked from commit 78fe1a5edf1dcdec44441fdb57554333a25ac3b1)
|
||||||
|
---
|
||||||
|
writerperfect/source/common/WPXSvInputStream.cxx | 10 +++++++---
|
||||||
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
|
||||||
|
index 4fad167..e5cf65b 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())
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
@ -0,0 +1,70 @@
|
|||||||
|
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
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
From 576a7210e52b7b3dec8cb6476c8cd44d9bf5dbb1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Tardon <dtardon@redhat.com>
|
||||||
|
Date: Fri, 30 May 2014 12:43:22 +0200
|
||||||
|
Subject: [PATCH 3/5] reading from a stream must start at the beginning
|
||||||
|
|
||||||
|
Change-Id: I0c668244fffcda04a8fe34ef629754f5935cab4b
|
||||||
|
(cherry picked from commit ee016fbbe3f3af67b2b8b6fb516bf523a0e704ff)
|
||||||
|
---
|
||||||
|
writerperfect/source/common/WPXSvInputStream.cxx | 2 ++
|
||||||
|
1 file changed, 2 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/writerperfect/source/common/WPXSvInputStream.cxx b/writerperfect/source/common/WPXSvInputStream.cxx
|
||||||
|
index c9ff75a..b5786bf 100644
|
||||||
|
--- a/writerperfect/source/common/WPXSvInputStream.cxx
|
||||||
|
+++ b/writerperfect/source/common/WPXSvInputStream.cxx
|
||||||
|
@@ -468,6 +468,8 @@ WPXSvInputStreamImpl::WPXSvInputStreamImpl( Reference< XInputStream > xStream )
|
||||||
|
try
|
||||||
|
{
|
||||||
|
mnLength = mxSeekable->getLength();
|
||||||
|
+ if (0 < mxSeekable->getPosition())
|
||||||
|
+ mxSeekable->seek(0);
|
||||||
|
}
|
||||||
|
catch ( ... )
|
||||||
|
{
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
@ -0,0 +1,41 @@
|
|||||||
|
From 32aacfc76f7b57978d54bb12f80ad6112a186af7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Tardon <dtardon@redhat.com>
|
||||||
|
Date: Fri, 30 May 2014 13:29:16 +0200
|
||||||
|
Subject: [PATCH 4/5] fix filter names
|
||||||
|
|
||||||
|
Change-Id: I691d8d43ef12f5863627d1d4bef64dbd9d633e86
|
||||||
|
(cherry picked from commit 2999a87db65767b26a161b60a2e80f5afd76ef52)
|
||||||
|
---
|
||||||
|
filter/source/config/fragments/types/calc_ClarisWorks.xcu | 2 +-
|
||||||
|
filter/source/config/fragments/types/draw_ClarisWorks.xcu | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/filter/source/config/fragments/types/calc_ClarisWorks.xcu b/filter/source/config/fragments/types/calc_ClarisWorks.xcu
|
||||||
|
index fe73b41..105bae4 100644
|
||||||
|
--- a/filter/source/config/fragments/types/calc_ClarisWorks.xcu
|
||||||
|
+++ b/filter/source/config/fragments/types/calc_ClarisWorks.xcu
|
||||||
|
@@ -21,7 +21,7 @@
|
||||||
|
<prop oor:name="Extensions"><value>cwk</value></prop>
|
||||||
|
<prop oor:name="MediaType"><value>application/clarisworks</value></prop>
|
||||||
|
<prop oor:name="Preferred"><value>true</value></prop>
|
||||||
|
- <prop oor:name="PreferredFilter"><value>Claris_Works_Calc</value></prop>
|
||||||
|
+ <prop oor:name="PreferredFilter"><value>ClarisWorks_Calc</value></prop>
|
||||||
|
<prop oor:name="UIName">
|
||||||
|
<value>ClarisWorks/AppleWorks Document</value>
|
||||||
|
</prop>
|
||||||
|
diff --git a/filter/source/config/fragments/types/draw_ClarisWorks.xcu b/filter/source/config/fragments/types/draw_ClarisWorks.xcu
|
||||||
|
index 74672eb..9581d21 100644
|
||||||
|
--- a/filter/source/config/fragments/types/draw_ClarisWorks.xcu
|
||||||
|
+++ b/filter/source/config/fragments/types/draw_ClarisWorks.xcu
|
||||||
|
@@ -21,7 +21,7 @@
|
||||||
|
<prop oor:name="Extensions"><value>cwk</value></prop>
|
||||||
|
<prop oor:name="MediaType"><value>application/clarisworks</value></prop>
|
||||||
|
<prop oor:name="Preferred"><value>true</value></prop>
|
||||||
|
- <prop oor:name="PreferredFilter"><value>Claris_Works_Draw</value></prop>
|
||||||
|
+ <prop oor:name="PreferredFilter"><value>ClarisWorks_Draw</value></prop>
|
||||||
|
<prop oor:name="UIName">
|
||||||
|
<value>ClarisWorks/AppleWorks Document</value>
|
||||||
|
</prop>
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
@ -0,0 +1,27 @@
|
|||||||
|
From b8370ed2010002a500a5371a5f258c716b71eca5 Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Tardon <dtardon@redhat.com>
|
||||||
|
Date: Fri, 30 May 2014 13:30:31 +0200
|
||||||
|
Subject: [PATCH 5/5] add dummy extension
|
||||||
|
|
||||||
|
Change-Id: Ic76efa716237f197c1c73a9752f6680be49570f6
|
||||||
|
(cherry picked from commit 2b6f2beec6ceffbde287ebef295eb27bb7f35d00)
|
||||||
|
---
|
||||||
|
filter/source/config/fragments/types/calc_Mac_Wingz.xcu | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/filter/source/config/fragments/types/calc_Mac_Wingz.xcu b/filter/source/config/fragments/types/calc_Mac_Wingz.xcu
|
||||||
|
index 357a189..bde4eac 100644
|
||||||
|
--- a/filter/source/config/fragments/types/calc_Mac_Wingz.xcu
|
||||||
|
+++ b/filter/source/config/fragments/types/calc_Mac_Wingz.xcu
|
||||||
|
@@ -18,7 +18,7 @@
|
||||||
|
<node oor:name="calc_Mac_Wingz" oor:op="replace" >
|
||||||
|
<prop oor:name="DetectService"><value>com.sun.star.comp.Calc.MWAWCalcImportFilter</value></prop>
|
||||||
|
<prop oor:name="URLPattern"/>
|
||||||
|
- <prop oor:name="Extensions"><value></value></prop>
|
||||||
|
+ <prop oor:name="Extensions"><value>dummy</value></prop>
|
||||||
|
<prop oor:name="MediaType"></prop>
|
||||||
|
<prop oor:name="Preferred"><value>true</value></prop>
|
||||||
|
<prop oor:name="PreferredFilter"><value>Mac_Wingz_Calc</value></prop>
|
||||||
|
--
|
||||||
|
1.9.3
|
||||||
|
|
Loading…
Reference in new issue