[Libreoffice-commits] .: Branch 'libreoffice-3-6' - 4 commits - reportdesign/inc reportdesign/source sc/inc sc/source sd/source starmath/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 14 10:34:06 PST 2013


 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 a6892bd5511bac086000efac9c865a5a148202dc
Author: Thorsten Behrens <tbehrens at 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
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index eaf5285..fcde136 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -160,7 +160,6 @@ struct XML_SERVICEMAP
 {
     const sal_Char* mpService;
     const sal_Char* mpStream;
-    sal_Bool mbPlain;
 };
 
 struct XML_SERVICES
@@ -1012,22 +1011,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;
@@ -1060,11 +1055,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 ) );
commit 28e6acb724671e72bd4e2e207a61fee0c94c432b
Author: Thorsten Behrens <tbehrens at 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
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index fe7fc36..912e57d 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -140,8 +140,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 202567b..c5189dc 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1529,7 +1529,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 )
             {
@@ -1545,7 +1545,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 )
             {
@@ -1561,7 +1561,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 )
             {
@@ -1577,7 +1577,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"));
@@ -1675,8 +1675,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!" );
@@ -1709,16 +1708,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 553724beeb7710e9dbfb70d53913fe9b37d87eed
Author: Thorsten Behrens <tbehrens at 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
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/sc/inc/xmlwrap.hxx b/sc/inc/xmlwrap.hxx
index b045c75..89aa051 100644
--- a/sc/inc/xmlwrap.hxx
+++ b/sc/inc/xmlwrap.hxx
@@ -71,7 +71,7 @@ class ScXMLImportWrapper
         com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& 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 910c4ee..050dbdc 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -632,7 +632,7 @@ sal_Bool ScXMLImportWrapper::ExportToComponent(uno::Reference<lang::XMultiServic
     uno::Reference<frame::XModel>& xModel, uno::Reference<uno::XInterface>& 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;
@@ -653,10 +653,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) );
         }
 
@@ -858,7 +856,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" );
         }
@@ -899,7 +897,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" );
         }
@@ -923,7 +921,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" );
         }
@@ -951,7 +949,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 577dd810d94374d634b46515a19127bc26dae516
Author: Thorsten Behrens <tbehrens at 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
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 34cbf54..b543f2d 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -216,8 +216,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 )
         {
@@ -326,8 +325,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!");
@@ -355,15 +353,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 4ab602b..daf9356 100644
--- a/starmath/source/mathmlexport.hxx
+++ b/starmath/source/mathmlexport.hxx
@@ -80,8 +80,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 ec13da0..58913bf 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -378,7 +378,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"),
@@ -394,7 +394,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 )
                 {
@@ -410,7 +410,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"),
@@ -424,7 +424,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!" );
@@ -555,13 +554,6 @@ sal_Bool SwXMLWriter::WriteThroughComponent(
         xSet->setPropertyValue( aPropName, 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(...))


More information about the Libreoffice-commits mailing list