reportdesign/inc/ReportDefinition.hxx | 3 -- reportdesign/source/core/api/ReportDefinition.cxx | 24 +++++++--------------- sc/inc/xmlwrap.hxx | 2 - sc/source/filter/xml/xmlwrap.cxx | 14 +++++------- sd/source/filter/xml/sdxmlwrp.cxx | 21 ++++++------------- starmath/source/mathmlexport.cxx | 16 ++------------ starmath/source/mathmlexport.hxx | 3 -- sw/source/filter/xml/wrtxml.cxx | 18 ++++------------ sw/source/filter/xml/wrtxml.hxx | 3 -- 9 files changed, 33 insertions(+), 71 deletions(-)
New commits: commit 899c338ccde3053aaa9751cd932fc0bdefca9d95 Author: Thorsten Behrens <tbehr...@suse.com> Date: Wed Nov 14 16:42:11 2012 +0100 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 diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx index 3362891..6e34b32 100644 --- a/starmath/source/mathmlexport.cxx +++ b/starmath/source/mathmlexport.cxx @@ -209,8 +209,7 @@ sal_Bool SmXMLExportWrapper::Export(SfxMedium &rMedium) bRet = WriteThroughComponent( xStg, xModelComp, "meta.xml", xServiceFactory, xInfoSet, (bOASIS ? "com.sun.star.comp.Math.XMLOasisMetaExporter" - : "com.sun.star.comp.Math.XMLMetaExporter"), - sal_False); + : "com.sun.star.comp.Math.XMLMetaExporter")); } if ( bRet ) { @@ -318,8 +317,7 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent( const sal_Char* pStreamName, Reference<lang::XMultiServiceFactory> & rFactory, Reference<beans::XPropertySet> & rPropSet, - const sal_Char* pComponentName, - sal_Bool bCompress + const sal_Char* pComponentName ) { OSL_ENSURE(xStorage.is(), "Need storage!"); @@ -347,15 +345,7 @@ sal_Bool SmXMLExportWrapper::WriteThroughComponent( uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY ); xSet->setPropertyValue( aPropName, aAny ); - if ( !bCompress ) - { - aPropName = "Compressed"; - sal_Bool bFalse = sal_False; - aAny.setValue( &bFalse, ::getBooleanCppuType() ); - xSet->setPropertyValue( aPropName, aAny ); - } - - // even plain stream must be encrypted in encrypted document + // all streams must be encrypted in encrypted document OUString aTmpPropName( "UseCommonStoragePasswordEncryption" ); sal_Bool bTrue = sal_True; aAny.setValue( &bTrue, ::getBooleanCppuType() ); diff --git a/starmath/source/mathmlexport.hxx b/starmath/source/mathmlexport.hxx index c0e7743..c4cc22e 100644 --- a/starmath/source/mathmlexport.hxx +++ b/starmath/source/mathmlexport.hxx @@ -70,8 +70,7 @@ public: ::com::sun::star::lang::XMultiServiceFactory > & rFactory, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPropSet, - const sal_Char* pComponentName, - sal_Bool bCompress=sal_True ); + const sal_Char* pComponentName ); }; //////////////////////////////////////////////////////////// diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index 48f7953..0a82b8e 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -379,7 +379,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, xModelComp, "meta.xml", xServiceFactory, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaExporter" : "com.sun.star.comp.Writer.XMLMetaExporter"), - aEmptyArgs, aProps, sal_True ) ) + aEmptyArgs, aProps ) ) { bWarn = sal_True; sWarnFile = String( RTL_CONSTASCII_STRINGPARAM("meta.xml"), @@ -395,7 +395,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, xModelComp, "settings.xml", xServiceFactory, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter" : "com.sun.star.comp.Writer.XMLSettingsExporter"), - aEmptyArgs, aProps, sal_False ) ) + aEmptyArgs, aProps ) ) { if( !bWarn ) { @@ -411,7 +411,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, xModelComp, "styles.xml", xServiceFactory, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesExporter" : "com.sun.star.comp.Writer.XMLStylesExporter"), - aFilterArgs, aProps, sal_False ) ) + aFilterArgs, aProps ) ) { bErr = sal_True; sErrFile = String( RTL_CONSTASCII_STRINGPARAM("styles.xml"), @@ -425,7 +425,7 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg, xModelComp, "content.xml", xServiceFactory, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentExporter" : "com.sun.star.comp.Writer.XMLContentExporter"), - aFilterArgs, aProps, sal_False ) ) + aFilterArgs, aProps ) ) { bErr = sal_True; sErrFile = String( RTL_CONSTASCII_STRINGPARAM("content.xml"), @@ -524,8 +524,7 @@ sal_Bool SwXMLWriter::WriteThroughComponent( const uno::Reference<lang::XMultiServiceFactory> & rFactory, const sal_Char* pServiceName, const Sequence<Any> & rArguments, - const Sequence<beans::PropertyValue> & rMediaDesc, - sal_Bool bPlainStream ) + const Sequence<beans::PropertyValue> & rMediaDesc ) { OSL_ENSURE( xStg.is(), "Need storage!" ); OSL_ENSURE( NULL != pStreamName, "Need stream name!" ); @@ -554,13 +553,6 @@ sal_Bool SwXMLWriter::WriteThroughComponent( xSet->setPropertyValue( rtl::OUString("MediaType"), aAny ); 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 sal_Bool bTrue = sal_True; diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx index b53b952..db790d9 100644 --- a/sw/source/filter/xml/wrtxml.hxx +++ b/sw/source/filter/xml/wrtxml.hxx @@ -82,8 +82,7 @@ private: ::com::sun::star::uno::Any> & rArguments, /// output descriptor const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue> & rMediaDesc, - sal_Bool bPlainStream ); /// neither compress nor encrypt + ::com::sun::star::beans::PropertyValue> & rMediaDesc ); /// write a single output stream /// (to be called either directly or by WriteThroughComponent(...)) commit 54ba550c31c7de1e7d1bf99042883aa4ae6863c6 Author: Thorsten Behrens <tbehr...@suse.com> Date: Wed Nov 14 16:39:07 2012 +0100 Fix fdo#51121 OWA misbehaviour with uncompressed meta.xml Change Calc to save ODF with compressed meta.xml as well, since there's no reason not to. Change-Id: Ib591b0e771a6f394d955f2ea9b43d6fb7c30ecdf diff --git a/sc/inc/xmlwrap.hxx b/sc/inc/xmlwrap.hxx index 7d03f56..42ab215 100644 --- a/sc/inc/xmlwrap.hxx +++ b/sc/inc/xmlwrap.hxx @@ -62,7 +62,7 @@ class ScXMLImportWrapper com::sun::star::uno::Reference<com::sun::star::xml::sax::XWriter>& xWriter, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aDescriptor, const rtl::OUString& sName, const rtl::OUString& sMediaType, const rtl::OUString& sComponentName, - const sal_Bool bPlainText, com::sun::star::uno::Sequence<com::sun::star::uno::Any>& aArgs, + com::sun::star::uno::Sequence<com::sun::star::uno::Any>& aArgs, ScMySharedData*& pSharedData); public: diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index d059e86..435006b 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -626,7 +626,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic uno::Reference<frame::XModel>& xModel, uno::Reference<xml::sax::XWriter>& xWriter, uno::Sequence<beans::PropertyValue>& aDescriptor, const rtl::OUString& sName, const rtl::OUString& sMediaType, const rtl::OUString& sComponentName, - const sal_Bool bPlainText, uno::Sequence<uno::Any>& aArgs, ScMySharedData*& pSharedData) + uno::Sequence<uno::Any>& aArgs, ScMySharedData*& pSharedData) { sal_Bool bRet(false); uno::Reference<io::XOutputStream> xOut; @@ -647,10 +647,8 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic { xSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), uno::makeAny(sMediaType)); OUString aUseCommonPassPropName( RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") ); - if (bPlainText) - xSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed")), uno::makeAny(false)); - // even plain stream should be encrypted in encrypted documents + // advise storage impl to use common encryption xSet->setPropertyValue( aUseCommonPassPropName, uno::makeAny(sal_True) ); } @@ -846,7 +844,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) sTextMediaType, bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisMetaExporter")) : rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLMetaExporter")), - sal_True, aMetaArgs, pSharedData); + aMetaArgs, pSharedData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "meta export end" ); } @@ -887,7 +885,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) sTextMediaType, bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisStylesExporter")) : rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLStylesExporter")), - false, aStylesArgs, pSharedData); + aStylesArgs, pSharedData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "styles export end" ); } @@ -911,7 +909,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) sTextMediaType, bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisContentExporter")) : rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLContentExporter")), - false, aDocArgs, pSharedData); + aDocArgs, pSharedData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "content export end" ); } @@ -939,7 +937,7 @@ sal_Bool ScXMLImportWrapper::Export(sal_Bool bStylesOnly) sTextMediaType, bOasis ? rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLOasisSettingsExporter")) : rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Calc.XMLSettingsExporter")), - false, aSettingsArgs, pSharedData); + aSettingsArgs, pSharedData); RTL_LOGFILE_CONTEXT_TRACE( aLog, "settings export end" ); } commit 38a2e86db2d1f23b95f705bfe1b626f419f4e290 Author: Thorsten Behrens <tbehr...@suse.com> Date: Wed Nov 14 16:37:40 2012 +0100 Fix fdo#51121 OWA misbehaviour with uncompressed meta.xml Change reportdesigner to save ODF with compressed meta.xml as well, since there's no reason not to. Change-Id: I9129f83ea8e5e8a20e3b6395643e8ca93c32f04a diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx index ebe30d8..caa054e 100644 --- a/reportdesign/inc/ReportDefinition.hxx +++ b/reportdesign/inc/ReportDefinition.hxx @@ -129,8 +129,7 @@ namespace reportdesign /// output descriptor const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> & rMediaDesc, - sal_Bool bPlainStream - , const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _xStorageToSaveTo); /// neither compress nor encrypt + const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& _xStorageToSaveTo); /// write a single output stream /// (to be called either directly or by WriteThroughComponent(...)) diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 6374ef3..2588fbc 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1520,7 +1520,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS if( !WriteThroughComponent( xCom, "settings.xml", "com.sun.star.comp.report.XMLSettingsExporter", - aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) ) + aDelegatorArguments, aProps, _xStorageToSaveTo ) ) { if( !bWarn ) { @@ -1536,7 +1536,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS if( !WriteThroughComponent( xCom, "meta.xml", "com.sun.star.comp.report.XMLMetaExporter", - aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) ) + aDelegatorArguments, aProps, _xStorageToSaveTo ) ) { if( !bWarn ) { @@ -1552,7 +1552,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS if( !WriteThroughComponent( xCom, "styles.xml", "com.sun.star.comp.report.XMLStylesExporter", - aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) ) + aDelegatorArguments, aProps, _xStorageToSaveTo ) ) { if( !bWarn ) { @@ -1568,7 +1568,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS if( !WriteThroughComponent( xCom, "content.xml", "com.sun.star.comp.report.ExportFilter", - aDelegatorArguments, aProps, sal_True,_xStorageToSaveTo ) ) + aDelegatorArguments, aProps, _xStorageToSaveTo ) ) { bErr = sal_True; sErrFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")); @@ -1666,8 +1666,7 @@ sal_Bool OReportDefinition::WriteThroughComponent( const sal_Char* pServiceName, const uno::Sequence<uno::Any> & rArguments, const uno::Sequence<beans::PropertyValue> & rMediaDesc, - sal_Bool bPlainStream - ,const uno::Reference<embed::XStorage>& _xStorageToSaveTo) + const uno::Reference<embed::XStorage>& _xStorageToSaveTo) { OSL_ENSURE( NULL != pStreamName, "Need stream name!" ); OSL_ENSURE( NULL != pServiceName, "Need service name!" ); @@ -1700,16 +1699,9 @@ sal_Bool OReportDefinition::WriteThroughComponent( aAny <<= aMime; xStreamProp->setPropertyValue( aPropName, aAny ); - if( bPlainStream ) - { - aAny <<= sal_False; - xStreamProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Compressed") ), aAny ); - } - else - { - xStreamProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ), uno::makeAny(sal_True) ); - } - + // encrypt all streams + xStreamProp->setPropertyValue( "UseCommonStoragePasswordEncryption", + uno::makeAny( (sal_Bool)sal_True ) ); // set buffer and create outputstream commit 9b2440f985f8676393094140cfd919ef82161e31 Author: Thorsten Behrens <tbehr...@suse.com> Date: Wed Nov 14 16:03:48 2012 +0100 Fix fdo#51121 OWA misbehaviour with uncompressed meta.xml Change draw/impress to save ODF with compressed meta.xml as well, since there's no reason not to. Change-Id: I856e716b1e673cffe3b483628d934ab2c7d7271b diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx index 1dc3543..b77e179 100644 --- a/sd/source/filter/xml/sdxmlwrp.cxx +++ b/sd/source/filter/xml/sdxmlwrp.cxx @@ -162,7 +162,6 @@ struct XML_SERVICEMAP { const sal_Char* mpService; const sal_Char* mpStream; - sal_Bool mbPlain; }; struct XML_SERVICES @@ -1003,22 +1002,18 @@ sal_Bool SdXMLFilter::Export() XML_SERVICEMAP aServices[5]; sal_uInt16 i = 0; aServices[i ].mpService = pServiceNames->mpStyles; - aServices[i ].mpStream = sXML_styleStreamName; - aServices[i++].mbPlain = sal_False; + aServices[i++].mpStream = sXML_styleStreamName; aServices[i ].mpService = pServiceNames->mpContent; - aServices[i ].mpStream = sXML_contentStreamName; - aServices[i++].mbPlain = sal_False; + aServices[i++].mpStream = sXML_contentStreamName; aServices[i ].mpService = pServiceNames->mpSettings; - aServices[i ].mpStream = sXML_settingsStreamName; - aServices[i++].mbPlain = sal_False; + aServices[i++].mpStream = sXML_settingsStreamName; if( mrDocShell.GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) { aServices[i ].mpService = pServiceNames->mpMeta; - aServices[i ].mpStream = sXML_metaStreamName; - aServices[i++].mbPlain = sal_True; + aServices[i++].mpStream = sXML_metaStreamName; }; aServices[i].mpService = NULL; @@ -1051,11 +1046,9 @@ sal_Bool SdXMLFilter::Export() uno::Any aAny; aAny <<= OUString( "text/xml"); xProps->setPropertyValue( "MediaType" , aAny); - OUString aUseCommonPassPropName( "UseCommonStoragePasswordEncryption"); - if( pServices->mbPlain ) - xProps->setPropertyValue( "Compressed" , uno::makeAny( (sal_Bool) sal_False ) ); - // if the document is encrypted even the plain streams should be encrypted - xProps->setPropertyValue( aUseCommonPassPropName, uno::makeAny( (sal_Bool)sal_True ) ); + // encrypt all streams + xProps->setPropertyValue( "UseCommonStoragePasswordEncryption", + uno::makeAny( (sal_Bool)sal_True ) ); const OUString sStreamName( "StreamName"); xInfoSet->setPropertyValue( sStreamName, Any( sDocName ) ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits