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
1c44f35b
Commit
1c44f35b
authored
Apr 10, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
differentiate extension for each export filter, otherwise the result can be unpredictable.
parent
d6c10a41
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
cloudooo/handler/ooo/mimemapper.py
cloudooo/handler/ooo/mimemapper.py
+16
-2
No files found.
cloudooo/handler/ooo/mimemapper.py
View file @
1c44f35b
...
...
@@ -97,6 +97,19 @@ class MimeMapper(object):
office_binary_path -- full path to openoffice binary
ooo_disable_filter_name_list -- a list of filter names which are disabled
"""
alternative_extension_dict
=
{
'Microsoft Excel 2007/2010 XML'
:
'ms.xlsx'
,
'Microsoft Excel 5.0 Template'
:
'5.xlt'
,
'Microsoft Excel 5.0'
:
'5.xls'
,
'Microsoft Excel 95 Template'
:
'95.xlt'
,
'Microsoft Excel 95'
:
'95.xls'
,
'Microsoft PowerPoint 2007/2010 XML AutoPlay'
:
'ms.ppsx'
,
'Microsoft PowerPoint 2007/2010 XML Template'
:
'ms.potm'
,
'Microsoft PowerPoint 2007/2010 XML'
:
'ms.pptx'
,
'Microsoft Word 2007/2010 XML'
:
'ms.docx'
,
'Microsoft Word 6.0'
:
'6.doc'
,
'Microsoft Word 95'
:
'95.doc'
,
}
uno_path
=
kw
.
get
(
"uno_path"
,
environ
.
get
(
'uno_path'
))
office_binary_path
=
kw
.
get
(
"office_binary_path"
,
environ
.
get
(
'office_binary_path'
))
...
...
@@ -132,8 +145,8 @@ class MimeMapper(object):
# Hardcode blacklisted filters
# XXX It should be done in configuration file instead
if
value
.
get
(
'Name'
)
in
[
# Use 'Text (encoded)
' instead
'Text
'
,
'Text'
,
# Use 'Text Encoded
' instead
'Text
(Writer/Web)'
,
# Use 'Text Encoded (Writer/Web)' instead
'XHTML Calc File'
,
'XHTML Impress File'
,
'XHTML Writer File'
,
...
...
@@ -176,6 +189,7 @@ class MimeMapper(object):
# In LibreOffice 3.6, ExportExtension is available.
export_extension
=
value
.
get
(
'ExportExtension'
,
filter_extension_list
[
0
])
for
ext
in
[
export_extension
,]:
ext
=
alternative_extension_dict
.
get
(
ui_name
,
ext
)
# Add (extension, ui_name) tuple by document_type.
# e.g {'com.sun.star.text.TextDocument': [('txt', 'Text'),]}
local_extension_list
=
self
.
_extension_list_by_type
.
setdefault
(
document_service_str
,
[])
...
...
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