diff options
| author | jvoisin | 2018-07-07 18:05:54 +0200 |
|---|---|---|
| committer | jvoisin | 2018-07-07 18:05:54 +0200 |
| commit | 85455a441950d4b30230dc246db598ea3ad601c7 (patch) | |
| tree | ceadb6012d6c5c58dde91d8ee5b7b4cb18ca93b6 | |
| parent | 9f631a1bb16ee60cbc893fad781f526ffc212f0f (diff) | |
Fix a mistake in office file revisions handling
| -rw-r--r-- | libmat2/office.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libmat2/office.py b/libmat2/office.py index eae84f7..14621d4 100644 --- a/libmat2/office.py +++ b/libmat2/office.py | |||
| @@ -51,7 +51,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser): | |||
| 51 | def _specific_cleanup(self, full_path: str) -> bool: | 51 | def _specific_cleanup(self, full_path: str) -> bool: |
| 52 | """ This method can be used to apply specific treatment | 52 | """ This method can be used to apply specific treatment |
| 53 | to files present in the archive.""" | 53 | to files present in the archive.""" |
| 54 | return True | 54 | return True # pragma: no cover |
| 55 | 55 | ||
| 56 | def _clean_zipinfo(self, zipinfo: zipfile.ZipInfo) -> zipfile.ZipInfo: | 56 | def _clean_zipinfo(self, zipinfo: zipfile.ZipInfo) -> zipfile.ZipInfo: |
| 57 | zipinfo.create_system = 3 # Linux | 57 | zipinfo.create_system = 3 # Linux |
| @@ -147,9 +147,9 @@ class MSOfficeParser(ArchiveBasedAbstractParser): | |||
| 147 | tree, ns = _parse_xml(full_path) | 147 | tree, ns = _parse_xml(full_path) |
| 148 | 148 | ||
| 149 | # No revisions are present | 149 | # No revisions are present |
| 150 | if tree.find('.//w:del', ns) is None: | 150 | del_presence = tree.find('.//w:del', ns) |
| 151 | return True | 151 | ins_presence = tree.find('.//w:ins', ns) |
| 152 | elif tree.find('.//w:ins', ns) is None: | 152 | if del_presence is None and ins_presence is None: |
| 153 | return True | 153 | return True |
| 154 | 154 | ||
| 155 | parent_map = {c:p for p in tree.iter() for c in p} | 155 | parent_map = {c:p for p in tree.iter() for c in p} |
