diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-03-06 22:43:34 -0500 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-03-07 14:55:43 +0100 |
commit | 98af842308727765050a6e03cdb0b25b5694bd27 (patch) | |
tree | c07161555561946bc140634c8d28cc4b85a7c337 /package | |
parent | a8f92371317d0056212063d473bb518cfbdbf874 (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.
Change-Id: I651ed691e9a4745cd2cb4b3c4d4c5fd7287b66c2
Reviewed-on: https://gerrit.libreoffice.org/50896
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index b59cca3ac22e..11d0890d67d6 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1054,11 +1054,16 @@ 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. 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; @@ -1083,7 +1088,6 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno: } } aOverridesSequence.realloc(nOverSeqLength); - aDefaultsSequence.realloc(nDefSeqLength); ::comphelper::OFOPXMLHelper::WriteContentSequence( xConTypeOutStream, aDefaultsSequence, aOverridesSequence, m_xContext ); |