msodumper/docrecord.py | 7 ++++--- msodumper/msometa.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
New commits: commit ee712783e0478bb60adf9a4991467d1eefbc44fd Author: Miklos Vajna <[email protected]> Date: Wed Dec 9 15:26:12 2015 +0100 msometa: show DictionaryEntry index diff --git a/msodumper/msometa.py b/msodumper/msometa.py index 542444c..6b8dcf2 100644 --- a/msodumper/msometa.py +++ b/msodumper/msometa.py @@ -245,13 +245,14 @@ PropertyType = { class DictionaryEntry(DOCDirStream): """"Specified by [MS-OLEPS] 2.16, represents a mapping between a property identifier and a property name.""" - def __init__(self, parent): + def __init__(self, parent, index): DOCDirStream.__init__(self, parent.bytes) self.parent = parent self.pos = parent.pos + self.index = index def dump(self): - print '<dictionaryEntry offset="%s">' % self.pos + print '<dictionaryEntry offset="%s" index="%s">' % (self.pos, self.index) self.printAndSet("PropertyIdentifier", self.readuInt32()) self.printAndSet("Length", self.readuInt32()) @@ -282,7 +283,7 @@ class Dictionary(DOCDirStream): print '<dictionary%s type="Dictionary" offset="%s">' % (self.index, self.pos) self.printAndSet("NumEntries", self.readuInt32()) for i in range(self.NumEntries): - dictionaryEntry = DictionaryEntry(self) + dictionaryEntry = DictionaryEntry(self, i) dictionaryEntry.dump() print '</dictionary%s>' % self.index commit a466e389aac5d666f43cfd1bc91c5686a6822c7d Author: Miklos Vajna <[email protected]> Date: Wed Dec 9 15:23:59 2015 +0100 docrecord: show factoidinfo index diff --git a/msodumper/docrecord.py b/msodumper/docrecord.py index d8aef44..7736a92 100644 --- a/msodumper/docrecord.py +++ b/msodumper/docrecord.py @@ -4334,13 +4334,14 @@ FTO = { class FACTOIDINFO(DOCDirStream): """Specified by [MS-DOC] 2.9.66, contains information about a smart tag bookmark in the document.""" - def __init__(self, parent): + def __init__(self, parent, index): DOCDirStream.__init__(self, parent.bytes) self.parent = parent self.pos = parent.pos + self.index = index def dump(self): - print '<factoidinfo>' + print '<factoidinfo index="%s">' % self.index self.printAndSet("dwId", self.readuInt32()) buf = self.readuInt16() self.printAndSet("fSubEntry", self.getBit(buf, 0)) @@ -4369,7 +4370,7 @@ class SttbfBkmkFactoid(DOCDirStream): for i in range(self.cData): self.printAndSet("cchData", self.readuInt16()) assert self.cchData == 0x6 - FACTOIDINFO(self).dump() + FACTOIDINFO(self, i).dump() assert self.pos == self.mainStream.fcSttbfBkmkFactoid + self.size print '</sttbfBkmkFactoid>' _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
