Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Roque
cloudooo
Commits
dc619e90
Commit
dc619e90
authored
Apr 10, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minimize hardcoded blacklisted filters.
parent
1c44f35b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
11 deletions
+6
-11
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+6
-11
No files found.
cloudooo/handler/ooo/mimemapper.py
View file @
dc619e90
...
@@ -132,6 +132,12 @@ class MimeMapper(object):
...
@@ -132,6 +132,12 @@ class MimeMapper(object):
for
filter_name
,
value
in
filter_dict
.
iteritems
():
for
filter_name
,
value
in
filter_dict
.
iteritems
():
if
filter_name
in
ooo_disable_filter_name_list
:
if
filter_name
in
ooo_disable_filter_name_list
:
continue
continue
# Hardcode blacklisted filters
if
filter_name
in
[
'Text'
,
# Use 'Text (encoded)' instead
'Text (StarWriter/Web)'
,
# Use 'Text (encoded) (StarWriter/Web)' instead
]:
continue
flag
=
value
.
get
(
"Flags"
)
flag
=
value
.
get
(
"Flags"
)
# http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_2_4_2_10_Properties_of_a_Filter
# http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_2_4_2_10_Properties_of_a_Filter
# Import:0x01, Export:0x02, Template:0x04, Internal:0x08,
# Import:0x01, Export:0x02, Template:0x04, Internal:0x08,
...
@@ -142,17 +148,6 @@ class MimeMapper(object):
...
@@ -142,17 +148,6 @@ class MimeMapper(object):
if
flag
&
0x08
or
flag
&
0x1000
or
flag
&
0x2000
:
if
flag
&
0x08
or
flag
&
0x1000
or
flag
&
0x2000
:
continue
continue
ui_name
=
value
.
get
(
'UIName'
)
ui_name
=
value
.
get
(
'UIName'
)
# Hardcode blacklisted filters
# XXX It should be done in configuration file instead
if
value
.
get
(
'Name'
)
in
[
'Text'
,
# Use 'Text Encoded' instead
'Text (Writer/Web)'
,
# Use 'Text Encoded (Writer/Web)' instead
'XHTML Calc File'
,
'XHTML Impress File'
,
'XHTML Writer File'
,
'XHTML Draw File'
,
]:
continue
filter_type
=
value
.
get
(
'Type'
)
filter_type
=
value
.
get
(
'Type'
)
filter_type_dict
=
type_dict
.
get
(
filter_type
)
filter_type_dict
=
type_dict
.
get
(
filter_type
)
if
not
ui_name
:
if
not
ui_name
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment