[ooo-build-commit] .: 2 commits - patches/dev300 scratch/mso-dumper
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Mar 23 10:41:00 PDT 2010
patches/dev300/svx-msdff-import-connector-style-fix.diff | 9 +-
scratch/mso-dumper/src/msodraw.py | 61 +++++++++------
scratch/mso-dumper/src/xlsrecord.py | 26 ++++--
3 files changed, 65 insertions(+), 31 deletions(-)
New commits:
commit 37760b55004bbc4b4448817a3e2089d2047e1d85
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Mar 23 13:39:52 2010 -0400
(Hopefully) fixed incorrect import of MSO drawing objects.
Refer to n#588927 for details.
* patches/dev300/svx-msdff-import-connector-style-fix.diff:
diff --git a/patches/dev300/svx-msdff-import-connector-style-fix.diff b/patches/dev300/svx-msdff-import-connector-style-fix.diff
index 918cd2a..50edc50 100644
--- a/patches/dev300/svx-msdff-import-connector-style-fix.diff
+++ b/patches/dev300/svx-msdff-import-connector-style-fix.diff
@@ -1,12 +1,13 @@
diff --git svx/source/msfilter/msdffimp.cxx svx/source/msfilter/msdffimp.cxx
-index 3f023b7..3bc067e 100644
+index dae1295..645c71c 100644
--- svx/source/msfilter/msdffimp.cxx
+++ svx/source/msfilter/msdffimp.cxx
-@@ -5428,6 +5428,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
+@@ -5427,6 +5427,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
+ aSet.Put( SdrEdgeNode2VertDistItem( n2VertDist ) );
((SdrEdgeObj*)pRet)->SetEdgeTrackPath( aPoly );
++
++ pRet->SetMergedItemSet( aSet );
}
-+ pRet->SetMergedItemSet( aSet );
}
}
-
commit 1acbb33c69e744c94e03bab5ed962e69596bf903
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Tue Mar 23 01:16:41 2010 -0400
[mso-dumper] More on parsing MSODRAW.
* scratch/mso-dumper/src/msodraw.py: pick up the ClientAnchor record
which contains object's position and size in an host-specific format.
* scratch/mso-dumper/src/xlsrecord.py: OBJ record contains more flags.
diff --git a/scratch/mso-dumper/src/msodraw.py b/scratch/mso-dumper/src/msodraw.py
index 92090ad..07808e7 100644
--- a/scratch/mso-dumper/src/msodraw.py
+++ b/scratch/mso-dumper/src/msodraw.py
@@ -34,6 +34,7 @@ def indent (level):
def headerLine ():
return "+ " + "-"*58 + "+"
+
class RecordHeader:
class Type:
@@ -47,6 +48,8 @@ class RecordHeader:
FSPGR = 0xF009
FSP = 0xF00A
FOPT = 0xF00B
+ FClientAnchor = 0xF010
+ FClientData = 0xF011
FConnectorRule = 0xF012
FDGSL = 0xF119
SplitMenuColorContainer = 0xF11E
@@ -60,6 +63,8 @@ class RecordHeader:
Type.FDG: 'OfficeArtFDG',
Type.FDGGBlock: 'OfficeArtFDGGBlock',
Type.FOPT: 'OfficeArtFOPT',
+ Type.FClientAnchor: 'msofbtClientAnchor',
+ Type.FClientData: 'msofbtClientData',
Type.FSP: 'OfficeArtFSP',
Type.FSPGR: 'OfficeArtFSPGR',
Type.FConnectorRule: 'OfficeArtFConnectorRule',
@@ -493,8 +498,40 @@ class SplitMenuColorContainer:
for msocr in self.smca:
msocr.appendLines(recHdl, rh)
+
+class FClientAnchor:
+ """Excel-specific anchor data"""
+
+ def __init__ (self, strm):
+ self.flag = strm.readUnsignedInt(2)
+ self.col1 = strm.readUnsignedInt(2)
+ self.dx1 = strm.readUnsignedInt(2)
+ self.row1 = strm.readUnsignedInt(2)
+ self.dy1 = strm.readUnsignedInt(2)
+ self.col2 = strm.readUnsignedInt(2)
+ self.dx2 = strm.readUnsignedInt(2)
+ self.row2 = strm.readUnsignedInt(2)
+ self.dy2 = strm.readUnsignedInt(2)
+
+ def appendLines (self, recHdl, rh):
+ recHdl.appendLine("Client anchor (Excel):")
+ recHdl.appendLine(" cols: %d-%d rows: %d-%d"%(self.col1, self.col2, self.row1, self.row2))
+ recHdl.appendLine(" dX1: %d dY1: %d"%(self.dx1, self.dy1))
+ recHdl.appendLine(" dX2: %d dY2: %d"%(self.dx2, self.dy2))
+
# ----------------------------------------------------------------------------
+recData = {
+ RecordHeader.Type.FDG: FDG,
+ RecordHeader.Type.FSPGR: FSPGR,
+ RecordHeader.Type.FSP: FSP,
+ RecordHeader.Type.FDGGBlock: FDGGBlock,
+ RecordHeader.Type.FConnectorRule: FConnectorRule,
+ RecordHeader.Type.FDGSL: FDGSL,
+ RecordHeader.Type.FClientAnchor: FClientAnchor,
+ RecordHeader.Type.SplitMenuColorContainer: SplitMenuColorContainer
+}
+
class MSODrawHandler(globals.ByteStream):
def __init__ (self, bytes, parent):
@@ -530,30 +567,12 @@ class MSODrawHandler(globals.ByteStream):
continue
self.parent.appendLine(headerLine())
- if rh.recType == RecordHeader.Type.FDG:
- fdg = FDG(self)
- fdg.appendLines(self.parent, rh)
- elif rh.recType == RecordHeader.Type.FDGGBlock:
- fdgg = FDGGBlock(self)
- fdgg.appendLines(self.parent, rh)
+ if recData.has_key(rh.recType):
+ obj = recData[rh.recType](self)
+ obj.appendLines(self.parent, rh)
elif rh.recType == RecordHeader.Type.FOPT:
fopt = self.readFOPT(rh)
fopt.appendLines(self.parent, rh)
- elif rh.recType == RecordHeader.Type.FSPGR:
- fspgr = FSPGR(self)
- fspgr.appendLines(self.parent, rh)
- elif rh.recType == RecordHeader.Type.FSP:
- fspgr = FSP(self)
- fspgr.appendLines(self.parent, rh)
- elif rh.recType == RecordHeader.Type.FConnectorRule:
- fcon = FConnectorRule(self)
- fcon.appendLines(self.parent, rh)
- elif rh.recType == RecordHeader.Type.FDGSL:
- fdgsl = FDGSL(self)
- fdgsl.appendLines(self.parent, rh)
- elif rh.recType == RecordHeader.Type.SplitMenuColorContainer:
- smcc = SplitMenuColorContainer(self)
- smcc.appendLines(self.parent, rh)
else:
# unknown object
bytes = self.readBytes(rh.recLen)
diff --git a/scratch/mso-dumper/src/xlsrecord.py b/scratch/mso-dumper/src/xlsrecord.py
index e01b836..cd0961e 100644
--- a/scratch/mso-dumper/src/xlsrecord.py
+++ b/scratch/mso-dumper/src/xlsrecord.py
@@ -809,10 +809,12 @@ class Obj(BaseRecordHandler):
flag = self.readUnsignedInt(2)
# the rest of the bytes are reserved & should be all zero.
- self.readBytes(12)
+ unused1 = self.readUnsignedInt(4)
+ unused2 = self.readUnsignedInt(4)
+ unused3 = self.readUnsignedInt(4)
self.appendLine("common object: ")
- self.appendLine(" type: %s"%Obj.Cmo.getType(objType))
+ self.appendLine(" type: %s (0x%2.2X)"%(Obj.Cmo.getType(objType), objType))
self.appendLine(" object ID: %d"%objID)
# 0 0001h fLocked =1 if the object is locked when the sheet is protected
@@ -823,11 +825,23 @@ class Obj(BaseRecordHandler):
# 14 4000h fAutoLine =1 if the object uses automatic line style
# 15 8000h (Reserved) Reserved; must be 0 (zero)
- locked = (flag & 0x0001)
- printable = (flag & 0x0010)
- autoFill = (flag & 0x2000)
- autoLine = (flag & 0x4000)
+ locked = (flag & 0x0001) != 0 # A
+ # B
+ defaultSize = (flag & 0x0004) != 0 # C
+ published = (flag & 0x0008) != 0 # D
+ printable = (flag & 0x0010) != 0 # E
+ # F
+ # G
+ disabled = (flag & 0x0080) != 0 # H
+ UIObj = (flag & 0x0100) != 0 # I
+ recalcObj = (flag & 0x0200) != 0 # J
+ # K
+ # L
+ recalcObjAlways = (flag & 0x1000) != 0 # M
+ autoFill = (flag & 0x2000) != 0 # N
+ autoLine = (flag & 0x4000) != 0 # O
self.appendLineBoolean(" locked", locked)
+ self.appendLineBoolean(" default size", defaultSize)
self.appendLineBoolean(" printable", printable)
self.appendLineBoolean(" automatic fill style", autoFill)
self.appendLineBoolean(" automatic line style", autoLine)
More information about the ooo-build-commit
mailing list