From 8f79f22a8d4b1c2d209c55cd618c24428960088f Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Tue, 6 Mar 2018 22:43:34 -0500 Subject: 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/50856 Tested-by: Jenkins Reviewed-by: Jan Holesovsky --- package/source/zippackage/ZipPackage.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'package/source') diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index cddda58e68a5..a04580dcaeae 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1088,10 +1088,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(1); - // 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"; + 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; -- cgit