From 878bea55030ade6050cced6da6e05a2525209c86 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Fri, 30 May 2014 20:11:22 +0200 Subject: [PATCH] add more fixes for import libs --- ...-fix-creation-of-substreams-for-OLE2.patch | 49 +++++++++++++ 0002-generalize-this-for-Zip-too.patch | 70 +++++++++++++++++++ ...a-stream-must-start-at-the-beginning.patch | 27 +++++++ 0004-fix-filter-names.patch | 41 +++++++++++ 0005-add-dummy-extension.patch | 27 +++++++ libreoffice.spec | 5 ++ 6 files changed, 219 insertions(+) create mode 100644 0001-fix-creation-of-substreams-for-OLE2.patch create mode 100644 0002-generalize-this-for-Zip-too.patch create mode 100644 0003-reading-from-a-stream-must-start-at-the-beginning.patch create mode 100644 0004-fix-filter-names.patch create mode 100644 0005-add-dummy-extension.patch diff --git a/0001-fix-creation-of-substreams-for-OLE2.patch b/0001-fix-creation-of-substreams-for-OLE2.patch new file mode 100644 index 0000000..94b75b6 --- /dev/null +++ b/0001-fix-creation-of-substreams-for-OLE2.patch @@ -0,0 +1,49 @@ +From e7cd2abfcff1673238e4c517ab614a818a4597f9 Mon Sep 17 00:00:00 2001 +From: alonso +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 + diff --git a/0002-generalize-this-for-Zip-too.patch b/0002-generalize-this-for-Zip-too.patch new file mode 100644 index 0000000..4f86b52 --- /dev/null +++ b/0002-generalize-this-for-Zip-too.patch @@ -0,0 +1,70 @@ +From 5e17fa55feb165966fbae7dedd797a841f95a5ee Mon Sep 17 00:00:00 2001 +From: David Tardon +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 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 ZipStorageImpl::getStream(const rtl::OUString &rPath) + return Reference(); + + 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 + diff --git a/0003-reading-from-a-stream-must-start-at-the-beginning.patch b/0003-reading-from-a-stream-must-start-at-the-beginning.patch new file mode 100644 index 0000000..0e7fd34 --- /dev/null +++ b/0003-reading-from-a-stream-must-start-at-the-beginning.patch @@ -0,0 +1,27 @@ +From 576a7210e52b7b3dec8cb6476c8cd44d9bf5dbb1 Mon Sep 17 00:00:00 2001 +From: David Tardon +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 + diff --git a/0004-fix-filter-names.patch b/0004-fix-filter-names.patch new file mode 100644 index 0000000..95c7161 --- /dev/null +++ b/0004-fix-filter-names.patch @@ -0,0 +1,41 @@ +From 32aacfc76f7b57978d54bb12f80ad6112a186af7 Mon Sep 17 00:00:00 2001 +From: David Tardon +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 @@ + cwk + application/clarisworks + true +- Claris_Works_Calc ++ ClarisWorks_Calc + + ClarisWorks/AppleWorks Document + +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 @@ + cwk + application/clarisworks + true +- Claris_Works_Draw ++ ClarisWorks_Draw + + ClarisWorks/AppleWorks Document + +-- +1.9.3 + diff --git a/0005-add-dummy-extension.patch b/0005-add-dummy-extension.patch new file mode 100644 index 0000000..01176f7 --- /dev/null +++ b/0005-add-dummy-extension.patch @@ -0,0 +1,27 @@ +From b8370ed2010002a500a5371a5f258c716b71eca5 Mon Sep 17 00:00:00 2001 +From: David Tardon +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 @@ + + com.sun.star.comp.Calc.MWAWCalcImportFilter + +- ++ dummy + + true + Mac_Wingz_Calc +-- +1.9.3 + diff --git a/libreoffice.spec b/libreoffice.spec index b067251..2d07f0f 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -326,6 +326,11 @@ Patch41: 0017-these-formats-are-supported-by-libmwaw-0.3.x.patch Patch42: 0018-fix-copypasta.patch Patch43: 0001-deb-749592-mysql-connector-doesn-t-work-with-remote-.patch Patch44: 0001-only-def-graphite-external-if-enable-graphite.patch +Patch45: 0001-fix-creation-of-substreams-for-OLE2.patch +Patch46: 0002-generalize-this-for-Zip-too.patch +Patch47: 0003-reading-from-a-stream-must-start-at-the-beginning.patch +Patch48: 0004-fix-filter-names.patch +Patch49: 0005-add-dummy-extension.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice