[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - 6 commits - filter/source writerperfect/source

David Tardon dtardon at redhat.com
Fri May 30 11:05:37 PDT 2014


 filter/source/config/fragments/types/calc_ClarisWorks.xcu |    2 -
 filter/source/config/fragments/types/calc_Mac_Wingz.xcu   |    2 -
 filter/source/config/fragments/types/draw_ClarisWorks.xcu |    2 -
 filter/source/config/fragments/types/draw_MacPaint.xcu    |    4 +-
 filter/source/config/fragments/types/draw_Mac_Works.xcu   |    4 +-
 filter/source/config/fragments/types/draw_SuperPaint.xcu  |    4 +-
 writerperfect/source/common/WPXSvInputStream.cxx          |   28 +++++++++++---
 7 files changed, 32 insertions(+), 14 deletions(-)

New commits:
commit e3cc8cef78bb55f76ed9f4506be9c17055234283
Author: David Tardon <dtardon at redhat.com>
Date:   Fri May 30 13:30:31 2014 +0200

    add dummy extension
    
    Change-Id: Ic76efa716237f197c1c73a9752f6680be49570f6
    (cherry picked from commit 2b6f2beec6ceffbde287ebef295eb27bb7f35d00)

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>
commit 2e9b6131919604092a0dd5a44490a6fd332f1556
Author: David Tardon <dtardon at redhat.com>
Date:   Fri May 30 13:29:16 2014 +0200

    fix filter names
    
    Change-Id: I691d8d43ef12f5863627d1d4bef64dbd9d633e86
    (cherry picked from commit 2999a87db65767b26a161b60a2e80f5afd76ef52)

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>
commit 69dac0a889d40680c852ce5e6fdfe3321ba9d9ad
Author: David Tardon <dtardon at redhat.com>
Date:   Fri May 30 12:43:22 2014 +0200

    reading from a stream must start at the beginning
    
    Change-Id: I0c668244fffcda04a8fe34ef629754f5935cab4b
    (cherry picked from commit ee016fbbe3f3af67b2b8b6fb516bf523a0e704ff)

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 ( ... )
             {
commit 7099ed535f985318ebfe568f42cca6436a9653f8
Author: David Tardon <dtardon at redhat.com>
Date:   Fri May 30 12:29:40 2014 +0200

    generalize this for Zip too
    
    Change-Id: I9ca0676f056fe3f09821c208ff095beb1f3c19ac
    (cherry picked from commit aa81b089d3da838129ca44badc60a6489af11d84)

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;
 }
commit 471ade65859e61f9a06f6834b0a002d6a95d37cd
Author: alonso <laurent.alonso at inria.fr>
Date:   Fri May 30 12:26:34 2014 +0200

    fix creation of substreams for OLE2
    
    Change-Id: Idade93bcc1981543357e849b2faf075e7a021d3e
    (cherry picked from commit 78fe1a5edf1dcdec44441fdb57554333a25ac3b1)

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())
commit d8c9eec60b2a51dab98e891f1d3896cfd665ab5d
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 29 19:24:21 2014 +0200

    fix copypasta
    
    Change-Id: I397426edff584b29210b4df925677893cda35cc7
    (cherry picked from commit 8dd624128bf12e013c17b3b24c0b24135296bb8e)

diff --git a/filter/source/config/fragments/types/draw_MacPaint.xcu b/filter/source/config/fragments/types/draw_MacPaint.xcu
index 5811ea5..4cadffd 100644
--- a/filter/source/config/fragments/types/draw_MacPaint.xcu
+++ b/filter/source/config/fragments/types/draw_MacPaint.xcu
@@ -18,8 +18,8 @@
     <node oor:name="draw_MacPaint" oor:op="replace" >
         <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
         <prop oor:name="URLPattern"/>
-        <prop oor:name="Extensions"><value>wps</value></prop>
-        <prop oor:name="MediaType"><value>application/vnd.ms-works</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>MacPaint_Draw</value></prop>
         <prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/draw_Mac_Works.xcu b/filter/source/config/fragments/types/draw_Mac_Works.xcu
index 79ef12c..15dea54 100644
--- a/filter/source/config/fragments/types/draw_Mac_Works.xcu
+++ b/filter/source/config/fragments/types/draw_Mac_Works.xcu
@@ -18,8 +18,8 @@
     <node oor:name="draw_Mac_Works" oor:op="replace" >
         <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
         <prop oor:name="URLPattern"/>
-        <prop oor:name="Extensions"><value>wps</value></prop>
-        <prop oor:name="MediaType"><value>application/vnd.ms-works</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_Works_Draw</value></prop>
         <prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/draw_SuperPaint.xcu b/filter/source/config/fragments/types/draw_SuperPaint.xcu
index 6dbd4a9..6f7e349 100644
--- a/filter/source/config/fragments/types/draw_SuperPaint.xcu
+++ b/filter/source/config/fragments/types/draw_SuperPaint.xcu
@@ -18,8 +18,8 @@
     <node oor:name="draw_SuperPaint" oor:op="replace" >
         <prop oor:name="DetectService"><value>com.sun.star.comp.Draw.MWAWDrawImportFilter</value></prop>
         <prop oor:name="URLPattern"/>
-        <prop oor:name="Extensions"><value>wps</value></prop>
-        <prop oor:name="MediaType"><value>application/vnd.ms-works</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>SuperPaint_Draw</value></prop>
         <prop oor:name="UIName">


More information about the Libreoffice-commits mailing list