Kaydet (Commit) 899c338c authored tarafından Thorsten Behrens's avatar Thorsten Behrens

Fix fdo#51121 OWA misbehaviour with uncompressed meta.xml

Change Writer and Math to save ODF with compressed meta.xml as well,
since there's no reason not to.

Change-Id: Idde0dc9eafb03f0c84e52353289d857615aa3748
üst 54ba550c
...@@ -209,8 +209,7 @@ sal_Bool SmXMLExportWrapper::Export(SfxMedium &rMedium) ...@@ -209,8 +209,7 @@ sal_Bool SmXMLExportWrapper::Export(SfxMedium &rMedium)
bRet = WriteThroughComponent( bRet = WriteThroughComponent(
xStg, xModelComp, "meta.xml", xServiceFactory, xInfoSet, xStg, xModelComp, "meta.xml", xServiceFactory, xInfoSet,
(bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaExporter" (bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaExporter"
: "com.sun.star.comp.Math.XMLMetaExporter"), : "com.sun.star.comp.Math.XMLMetaExporter"));
sal_False);
} }
if ( bRet ) if ( bRet )
{ {
...@@ -318,8 +317,7 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent( ...@@ -318,8 +317,7 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent(
const sal_Char* pStreamName, const sal_Char* pStreamName,
Reference<lang::XMultiServiceFactory> & rFactory, Reference<lang::XMultiServiceFactory> & rFactory,
Reference<beans::XPropertySet> & rPropSet, Reference<beans::XPropertySet> & rPropSet,
const sal_Char* pComponentName, const sal_Char* pComponentName
sal_Bool bCompress
) )
{ {
OSL_ENSURE(xStorage.is(), "Need storage!"); OSL_ENSURE(xStorage.is(), "Need storage!");
...@@ -347,15 +345,7 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent( ...@@ -347,15 +345,7 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent(
uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY ); uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY );
xSet->setPropertyValue( aPropName, aAny ); xSet->setPropertyValue( aPropName, aAny );
if ( !bCompress ) // all streams must be encrypted in encrypted document
{
aPropName = "Compressed";
sal_Bool bFalse = sal_False;
aAny.setValue( &bFalse, ::getBooleanCppuType() );
xSet->setPropertyValue( aPropName, aAny );
}
// even plain stream must be encrypted in encrypted document
OUString aTmpPropName( "UseCommonStoragePasswordEncryption" ); OUString aTmpPropName( "UseCommonStoragePasswordEncryption" );
sal_Bool bTrue = sal_True; sal_Bool bTrue = sal_True;
aAny.setValue( &bTrue, ::getBooleanCppuType() ); aAny.setValue( &bTrue, ::getBooleanCppuType() );
......
...@@ -70,8 +70,7 @@ public: ...@@ -70,8 +70,7 @@ public:
::com::sun::star::lang::XMultiServiceFactory > & rFactory, ::com::sun::star::lang::XMultiServiceFactory > & rFactory,
::com::sun::star::uno::Reference< ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > & rPropSet, ::com::sun::star::beans::XPropertySet > & rPropSet,
const sal_Char* pComponentName, const sal_Char* pComponentName );
sal_Bool bCompress=sal_True );
}; };
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
......
...@@ -379,7 +379,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, ...@@ -379,7 +379,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
xModelComp, "meta.xml", xServiceFactory, xModelComp, "meta.xml", xServiceFactory,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaExporter" (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaExporter"
: "com.sun.star.comp.Writer.XMLMetaExporter"), : "com.sun.star.comp.Writer.XMLMetaExporter"),
aEmptyArgs, aProps, sal_True ) ) aEmptyArgs, aProps ) )
{ {
bWarn = sal_True; bWarn = sal_True;
sWarnFile = String( RTL_CONSTASCII_STRINGPARAM("meta.xml"), sWarnFile = String( RTL_CONSTASCII_STRINGPARAM("meta.xml"),
...@@ -395,7 +395,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, ...@@ -395,7 +395,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
xModelComp, "settings.xml", xServiceFactory, xModelComp, "settings.xml", xServiceFactory,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter" (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
: "com.sun.star.comp.Writer.XMLSettingsExporter"), : "com.sun.star.comp.Writer.XMLSettingsExporter"),
aEmptyArgs, aProps, sal_False ) ) aEmptyArgs, aProps ) )
{ {
if( !bWarn ) if( !bWarn )
{ {
...@@ -411,7 +411,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, ...@@ -411,7 +411,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
xModelComp, "styles.xml", xServiceFactory, xModelComp, "styles.xml", xServiceFactory,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesExporter" (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesExporter"
: "com.sun.star.comp.Writer.XMLStylesExporter"), : "com.sun.star.comp.Writer.XMLStylesExporter"),
aFilterArgs, aProps, sal_False ) ) aFilterArgs, aProps ) )
{ {
bErr = sal_True; bErr = sal_True;
sErrFile = String( RTL_CONSTASCII_STRINGPARAM("styles.xml"), sErrFile = String( RTL_CONSTASCII_STRINGPARAM("styles.xml"),
...@@ -425,7 +425,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, ...@@ -425,7 +425,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
xModelComp, "content.xml", xServiceFactory, xModelComp, "content.xml", xServiceFactory,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentExporter" (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentExporter"
: "com.sun.star.comp.Writer.XMLContentExporter"), : "com.sun.star.comp.Writer.XMLContentExporter"),
aFilterArgs, aProps, sal_False ) ) aFilterArgs, aProps ) )
{ {
bErr = sal_True; bErr = sal_True;
sErrFile = String( RTL_CONSTASCII_STRINGPARAM("content.xml"), sErrFile = String( RTL_CONSTASCII_STRINGPARAM("content.xml"),
...@@ -524,8 +524,7 @@ sal_Bool SwXMLWriter::WriteThroughComponent( ...@@ -524,8 +524,7 @@ sal_Bool SwXMLWriter::WriteThroughComponent(
const uno::Reference<lang::XMultiServiceFactory> & rFactory, const uno::Reference<lang::XMultiServiceFactory> & rFactory,
const sal_Char* pServiceName, const sal_Char* pServiceName,
const Sequence<Any> & rArguments, const Sequence<Any> & rArguments,
const Sequence<beans::PropertyValue> & rMediaDesc, const Sequence<beans::PropertyValue> & rMediaDesc )
sal_Bool bPlainStream )
{ {
OSL_ENSURE( xStg.is(), "Need storage!" ); OSL_ENSURE( xStg.is(), "Need storage!" );
OSL_ENSURE( NULL != pStreamName, "Need stream name!" ); OSL_ENSURE( NULL != pStreamName, "Need stream name!" );
...@@ -554,13 +553,6 @@ sal_Bool SwXMLWriter::WriteThroughComponent( ...@@ -554,13 +553,6 @@ sal_Bool SwXMLWriter::WriteThroughComponent(
xSet->setPropertyValue( rtl::OUString("MediaType"), aAny ); xSet->setPropertyValue( rtl::OUString("MediaType"), aAny );
OUString aUseCommonPassPropName( RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") ); OUString aUseCommonPassPropName( RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") );
if( bPlainStream )
{
OUString aCompressPropName( RTL_CONSTASCII_USTRINGPARAM("Compressed") );
sal_Bool bFalse = sal_False;
aAny.setValue( &bFalse, ::getBooleanCppuType() );
xSet->setPropertyValue( aCompressPropName, aAny );
}
// even plain stream should be encrypted in encrypted documents // even plain stream should be encrypted in encrypted documents
sal_Bool bTrue = sal_True; sal_Bool bTrue = sal_True;
......
...@@ -82,8 +82,7 @@ private: ...@@ -82,8 +82,7 @@ private:
::com::sun::star::uno::Any> & rArguments, ::com::sun::star::uno::Any> & rArguments,
/// output descriptor /// output descriptor
const ::com::sun::star::uno::Sequence< const ::com::sun::star::uno::Sequence<
::com::sun::star::beans::PropertyValue> & rMediaDesc, ::com::sun::star::beans::PropertyValue> & rMediaDesc );
sal_Bool bPlainStream ); /// neither compress nor encrypt
/// write a single output stream /// write a single output stream
/// (to be called either directly or by WriteThroughComponent(...)) /// (to be called either directly or by WriteThroughComponent(...))
......
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