[Libreoffice-commits] .: src/docdraw.py src/msodraw.py
Miklos Vajna
vmiklos at kemper.freedesktop.org
Wed Dec 5 01:29:39 PST 2012
src/docdraw.py | 16 +---------------
src/msodraw.py | 6 ++++++
2 files changed, 7 insertions(+), 15 deletions(-)
New commits:
commit 66646354c3abeac0fbff2368487a44e554311fb6
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Wed Dec 5 10:29:31 2012 +0100
docdraw: use msodraw.IDCL
diff --git a/src/docdraw.py b/src/docdraw.py
index f3cd9d3..87a3ea1 100644
--- a/src/docdraw.py
+++ b/src/docdraw.py
@@ -30,20 +30,6 @@ class OfficeArtFDGG(DOCDirStream):
assert self.pos == self.officeArtFDGGBlock.pos + OfficeArtFDGG.size
self.officeArtFDGGBlock.pos = self.pos
-class OfficeArtIDCL(DOCDirStream):
- """The OfficeArtIDCL record specifies a file identifier cluster, which is used to group shape identifiers within a drawing."""
- def __init__(self, officeArtFDGGBlock):
- DOCDirStream.__init__(self, officeArtFDGGBlock.bytes)
- self.pos = officeArtFDGGBlock.pos
- self.officeArtFDGGBlock = officeArtFDGGBlock
-
- def dump(self):
- print '<officeArtIDCL type="OfficeArtIDCL" pos="%d">' % self.pos
- self.printAndSet("dgid", self.readuInt32())
- self.printAndSet("cspidCur", self.readuInt32())
- print '</officeArtIDCL>'
- self.officeArtFDGGBlock.pos = self.pos
-
class OfficeArtFDGGBlock(DOCDirStream):
"""The OfficeArtFDGGBlock record specifies document-wide information about all of the drawings that have been saved in the file."""
def __init__(self, officeArtDggContainer, pos):
@@ -57,7 +43,7 @@ class OfficeArtFDGGBlock(DOCDirStream):
self.head.dump()
for i in range(self.head.cidcl - 1):
print '<Rgidcl index="%d">' % i
- OfficeArtIDCL(self).dump()
+ msodraw.IDCL(self).dumpXml(self)
print '</Rgidcl>'
print '</drawingGroup>'
diff --git a/src/msodraw.py b/src/msodraw.py
index fd286df..66f5531 100644
--- a/src/msodraw.py
+++ b/src/msodraw.py
@@ -170,6 +170,12 @@ class IDCL:
recHdl.appendLine(" drawing ID: %d"%self.dgid)
recHdl.appendLine(" cspidCur: 0x%8.8X"%self.cspidCur)
+ def dumpXml(self, recHdl):
+ recHdl.appendLine('<idcl type="OfficeArtIDCL">')
+ recHdl.appendLine('<dgid value="%d"/>' % self.dgid)
+ recHdl.appendLine('<cspidCur value="0x%8.8X"/>' % self.cspidCur)
+ recHdl.appendLine('</idcl>')
+
class FDGG:
def __init__ (self, strm):
self.spidMax = strm.readUnsignedInt(4) # current max shape ID
More information about the Libreoffice-commits
mailing list