Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mat2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jvoisin
mat2
Merge requests
!71
Improve a bit ppt support
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Improve a bit ppt support
improve_ppt_support
into
master
Overview
0
Commits
2
Pipelines
4
Changes
1
Merged
jvoisin
requested to merge
improve_ppt_support
into
master
5 years ago
Overview
0
Commits
2
Pipelines
4
Changes
1
Expand
0
0
Merge request reports
Compare
master
version 5
f9cfe63d
5 years ago
version 4
c6f94a5b
5 years ago
version 3
c6f94a5b
5 years ago
version 2
c6f94a5b
5 years ago
version 1
4d7a9594
5 years ago
master (base)
and
latest version
latest version
22dc2356
2 commits,
5 years ago
version 5
f9cfe63d
1 commit,
5 years ago
version 4
c6f94a5b
1 commit,
5 years ago
version 3
c6f94a5b
1 commit,
5 years ago
version 2
c6f94a5b
1 commit,
5 years ago
version 1
4d7a9594
1 commit,
5 years ago
1 file
+
9
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
libmat2/office.py
+
9
−
1
Options
import
uuid
import
logging
import
os
import
re
@@ -82,7 +83,7 @@ class MSOfficeParser(ZipParser):
r
'
^(?:word|ppt)/_rels/header[0-9]*\.xml\.rels$
'
,
r
'
^ppt/slideLayouts/_rels/slideLayout[0-9]+\.xml\.rels$
'
,
r
'
^ppt/slideLayouts/slideLayout[0-9]+\.xml$
'
,
r
'
^(?:word|ppt)/tableStyles\.xml$
'
,
# https://msdn.microsoft.com/en-us/library/dd908153(v=office.12).aspx
r
'
^(?:word|ppt)/stylesWithEffects\.xml$
'
,
}))
@@ -302,6 +303,13 @@ class MSOfficeParser(ZipParser):
f
.
write
(
b
'
<?xml version=
"
1.0
"
encoding=
"
UTF-8
"
standalone=
"
yes
"
?>
'
)
f
.
write
(
b
'
<cp:coreProperties xmlns:cp=
"
http://schemas.openxmlformats.org/package/2006/metadata/core-properties
"
>
'
)
f
.
write
(
b
'
</cp:coreProperties>
'
)
elif
full_path
.
endswith
(
'
/ppt/tableStyles.xml
'
):
# pragma: no cover
# This file must be present and valid,
# so we're removing as much as we can.
with
open
(
full_path
,
'
wb
'
)
as
f
:
f
.
write
(
b
'
<?xml version=
"
1.0
"
>
'
)
uid
=
str
(
uuid
.
uuid4
()).
encode
(
'
utf-8
'
)
f
.
write
(
b
'
<a:tblStyleLst def=
"
{%s}
"
xmlns:a=
"
http://schemas.openxmlformats.org/drawingml/2006/main
"
/>
'
%
uid
)
if
self
.
__remove_rsid
(
full_path
)
is
False
:
return
False
Loading