Kaydet (Commit) 00492aff authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Ashod Nakashian

ofopxml: always generate default application/xml

MS Office always sets the application/xml entry
but LO doesn't preserve unknown entries.
Since this is a standard and always-set entry
LO should always stamp it as well.

Change-Id: I28b47634f2aa1fec233c9184deb65fd43f2f3ae8
Reviewed-on: https://gerrit.libreoffice.org/48724Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
Tested-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
üst a097077e
......@@ -1088,9 +1088,14 @@ 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;
uno::Sequence< beans::StringPair > aOverridesSequence( aManList.size() );
sal_Int32 nSeqLength = 0;
uno::Sequence< beans::StringPair > aDefaultsSequence(aManList.size());
// Add at least the application/xml default entry.
aDefaultsSequence[0].First = "xml";
aDefaultsSequence[0].Second= "application/xml";
sal_Int32 nDefSeqLength = 1;
uno::Sequence< beans::StringPair > aOverridesSequence(aManList.size());
sal_Int32 nOverSeqLength = 0;
for ( vector< uno::Sequence< beans::PropertyValue > >::const_iterator aIter = aManList.begin(),
aEnd = aManList.end();
aIter != aEnd;
......@@ -1104,13 +1109,15 @@ void ZipPackage::WriteContentTypes( ZipOutputStream& aZipOut, const vector< uno:
if ( !aType.isEmpty() )
{
// only nonempty type makes sense here
nSeqLength++;
( *aIter )[PKG_MNFST_FULLPATH].Value >>= aPath;
aOverridesSequence[nSeqLength-1].First = "/" + aPath;
aOverridesSequence[nSeqLength-1].Second = aType;
//FIXME: For now we have no way of deferentiating defaults from others.
aOverridesSequence[nOverSeqLength].First = "/" + aPath;
aOverridesSequence[nOverSeqLength].Second = aType;
++nOverSeqLength;
}
}
aOverridesSequence.realloc( nSeqLength );
aOverridesSequence.realloc(nOverSeqLength);
aDefaultsSequence.realloc(nDefSeqLength);
::comphelper::OFOPXMLHelper::WriteContentSequence(
xConTypeOutStream, aDefaultsSequence, aOverridesSequence, m_xContext );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment