diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-09 15:26:12 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-09 15:26:12 +0100 |
commit | ee712783e0478bb60adf9a4991467d1eefbc44fd (patch) | |
tree | 7b4a8e6b8000ff85e5b6201e3b454b99b65e4a09 | |
parent | a466e389aac5d666f43cfd1bc91c5686a6822c7d (diff) |
msometa: show DictionaryEntry index
-rw-r--r-- | msodumper/msometa.py | 7 |
1 files changed, 4 insertions, 3 deletions
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 |