[Libreoffice-commits] .: 2 commits - src/docrecord.py src/docstream.py

Miklos Vajna vmiklos at kemper.freedesktop.org
Sun May 5 01:04:34 PDT 2013


 src/docrecord.py |    8 +++-----
 src/docstream.py |    7 ++-----
 2 files changed, 5 insertions(+), 10 deletions(-)

New commits:
commit 73fb8a5546b17f97075ba73c106b30943f848d82
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Sun May 5 10:04:16 2013 +0200

    PlcfHdd is already implemented

diff --git a/src/docstream.py b/src/docstream.py
index d87982c..396a8bb 100644
--- a/src/docstream.py
+++ b/src/docstream.py
@@ -404,7 +404,7 @@ class WordDocumentStream(DOCDirStream):
             value = self.readInt32()
             if i[0] == "fcClx":
                 self.printAndSet(i[0], value, silent = True)
-            if i[0] == "lcbClx":
+            elif i[0] == "lcbClx":
                 self.printAndSet(i[0], value, silent = True)
                 i[1](silent = True)
         self.pos = posOrig
@@ -414,8 +414,6 @@ class WordDocumentStream(DOCDirStream):
             hasHandler = len(i) > 1
             # the spec says these must be ignored
             needsIgnoring = ["lcbStshfOrig", "lcbPlcfBteLvc"]
-            if self.ccpHdd == 0:
-                needsIgnoring.append("lcbPlcfHdd")
             # a member needs handling if it defines the size of a struct and it's non-zero
             needsHandling = i[0].startswith("lcb") and value != 0 and (not i[0] in needsIgnoring)
             self.printAndSet(i[0], value, end = ((not hasHandler) and (not needsHandling)), offset = True)
commit f7cdf755184d6f697fe13d1242d2ca2594e3c40f
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Sun May 5 09:59:56 2013 +0200

    PlcfBkf / PlcfBkl works with CPs as well

diff --git a/src/docrecord.py b/src/docrecord.py
index 9fda05f..34e66cb 100644
--- a/src/docrecord.py
+++ b/src/docrecord.py
@@ -107,11 +107,10 @@ class PlcfBkf(DOCDirStream, PLC):
 
     def dump(self):
         print '<plcfBkf type="PlcfBkf" offset="%d" size="%d bytes">' % (self.pos, self.size)
-        offset = self.mainStream.fcMin
         pos = self.pos
         for i in range(self.getElements()):
             # aCp
-            start = offset + self.getuInt32(pos = pos)
+            start = self.getuInt32(pos = pos)
             self.aCP.append(start)
             print '<aCP index="%d" bookmarkStart="%d">' % (i, start)
             pos += 4
@@ -193,14 +192,13 @@ class PlcfBkl(DOCDirStream, PLC):
 
     def dump(self):
         print '<plcfBkl type="PlcfBkl" offset="%d" size="%d bytes">' % (self.pos, self.size)
-        offset = self.mainStream.fcMin
         pos = self.pos
         for i in range(self.getElements()):
             # aCp
-            end = offset + self.getuInt32(pos = pos)
+            end = self.getuInt32(pos = pos)
             print '<aCP index="%d" bookmarkEnd="%d">' % (i, end)
             start = self.start.aCP[i]
-            print '<transformed value="%s"/>' % self.quoteAttr(self.mainStream.retrieveOffset(start, end))
+            print '<transformed value="%s"/>' % self.quoteAttr(self.mainStream.retrieveCPs(start, end))
             pos += 4
             print '</aCP>'
         print '</plcfBkl>'
diff --git a/src/docstream.py b/src/docstream.py
index d98e0ea..d87982c 100644
--- a/src/docstream.py
+++ b/src/docstream.py
@@ -153,8 +153,7 @@ class WordDocumentStream(DOCDirStream):
 
         self.printAndSet("reserved3", self.readuInt16())
         self.printAndSet("reserved4", self.readuInt16())
-        # reserved5 in the spec, offset of first character of text according to LO ww8 import filter
-        self.printAndSet("fcMin", self.readuInt32())
+        self.printAndSet("reserved5", self.readuInt32())
         self.printAndSet("reserved6", self.readuInt32())
 
         print '</%s>' % name


More information about the Libreoffice-commits mailing list