Commit 15743bfd3abaf3e35b9f9a3a2e1f92fb6b67a839
Committed by
GitHub
Merge branch 'master' into ddedev
Showing
1 changed file
with
4 additions
and
4 deletions
oletools/msodde.py
| ... | ... | @@ -89,8 +89,8 @@ TAG_W_P = "{%s}p" % NS_WORD |
| 89 | 89 | TAG_W_R = "{%s}r" % NS_WORD |
| 90 | 90 | ATTR_W_INSTR = '{%s}instr' % NS_WORD |
| 91 | 91 | ATTR_W_FLDCHARTYPE = '{%s}fldCharType' % NS_WORD |
| 92 | - | |
| 93 | 92 | LOCATIONS = ['word/document.xml','word/endnotes.xml','word/footnotes.xml','word/header1.xml','word/footer1.xml','word/header2.xml','word/footer2.xml','word/comments.xml'] |
| 93 | + | |
| 94 | 94 | # === FUNCTIONS ============================================================== |
| 95 | 95 | |
| 96 | 96 | def process_args(): |
| ... | ... | @@ -119,6 +119,7 @@ def process_file(data): |
| 119 | 119 | # fldChar can be in either a w:r element, floating alone in the w:p or spread accross w:p tags |
| 120 | 120 | # escape DDE if quoted etc |
| 121 | 121 | # (each is a chunk of a DDE link) |
| 122 | + | |
| 122 | 123 | for subs in root.iter(TAG_W_P): |
| 123 | 124 | elem = None |
| 124 | 125 | for e in subs: |
| ... | ... | @@ -150,13 +151,11 @@ def process_file(data): |
| 150 | 151 | #expand field code if QUOTED |
| 151 | 152 | ddetext += unquote(elem.text) |
| 152 | 153 | |
| 153 | - | |
| 154 | 154 | for elem in root.iter(TAG_W_FLDSIMPLE): |
| 155 | 155 | # concatenate the attribute of the field, if present: |
| 156 | 156 | if elem.attrib is not None: |
| 157 | 157 | fields.append(elem.attrib[ATTR_W_INSTR]) |
| 158 | - | |
| 159 | - | |
| 158 | + | |
| 160 | 159 | return fields |
| 161 | 160 | |
| 162 | 161 | def unquote(field): |
| ... | ... | @@ -173,6 +172,7 @@ def unquote(field): |
| 173 | 172 | ddestr += ch |
| 174 | 173 | return ddestr |
| 175 | 174 | |
| 175 | + | |
| 176 | 176 | #=== MAIN ================================================================= |
| 177 | 177 | |
| 178 | 178 | def main(): | ... | ... |