diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-03-06 22:43:34 -0500 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-26 07:46:14 +0200 |
commit | e3029244ccbd75a9e0fd9cab2e8677336b88fff5 (patch) | |
tree | 86a93d5d3ad1ebaf9ca229e3ddce6388765e8a33 /package | |
parent | cf256ad5858bea8834cb5ce49e4f76bb0b14d7dd (diff) |
oox: preserve the ContentType of custom files
Generic logic to preserve custom files with
their correct ContentType. Standard default
file extensions with respective ContentType
preserved in [Content_Types].xml.
Reviewed-on: https://gerrit.libreoffice.org/50856
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 8f79f22a8d4b1c2d209c55cd618c24428960088f)
Change-Id: I651ed691e9a4745cd2cb4b3c4d4c5fd7287b66c2
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 3d2c0ff00e4a..f7464ed8f30f 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1085,11 +1085,17 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno: // Convert vector into a uno::Sequence // TODO/LATER: use Default entries in future - uno::Sequence< beans::StringPair > aDefaultsSequence(aManList.size()); - // Add at least the application/xml default entry. + uno::Sequence< beans::StringPair > aDefaultsSequence(4); + // Add at least the standard default entries. + sal_Int32 nDefSeqLength = 1; aDefaultsSequence[0].First = "xml"; aDefaultsSequence[0].Second= "application/xml"; - sal_Int32 nDefSeqLength = 1; + aDefaultsSequence[1].First = "rels"; + aDefaultsSequence[1].Second= "application/vnd.openxmlformats-package.relationships+xml"; + aDefaultsSequence[2].First = "png"; + aDefaultsSequence[2].Second= "image/png"; + aDefaultsSequence[3].First = "jpeg"; + aDefaultsSequence[3].Second= "image/jpeg"; uno::Sequence< beans::StringPair > aOverridesSequence(aManList.size()); sal_Int32 nOverSeqLength = 0; |