[Libreoffice-commits] core.git: 4 commits - sc/qa sfx2/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Wed Mar 5 00:31:56 PST 2014


 sc/qa/unit/helper/qahelper.cxx |    8 ++++++--
 sfx2/source/doc/objstor.cxx    |   22 ++++++++++++++++------
 2 files changed, 22 insertions(+), 8 deletions(-)

New commits:
commit 5490f585f09c0a24b7caab011593ab6bb6e9a318
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Mar 5 09:29:32 2014 +0100

    sal_Bool to bool
    
    Change-Id: I866946a2a987a95a41cf2b32ed089568ff94b236

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 34eadda..59335d3 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2367,9 +2367,9 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
         // put in the REAL file name, and copy all PropertyValues
         const OUString sOutputStream ( "OutputStream"  );
         const OUString sStream ( "StreamForOutput"  );
-        sal_Bool bHasOutputStream = sal_False;
-        sal_Bool bHasStream = sal_False;
-        sal_Bool bHasBaseURL = sal_False;
+        bool bHasOutputStream = false;
+        bool bHasStream = false;
+        bool bHasBaseURL = false;
         bool bHasFilterName = false;
         sal_Int32 i;
         sal_Int32 nEnd = aOldArgs.getLength();
@@ -2380,11 +2380,11 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
             if ( pOldValue[i].Name == "FileName" )
                 pNewValue[i].Value <<= OUString ( rMedium.GetName() );
             else if ( pOldValue[i].Name == sOutputStream )
-                bHasOutputStream = sal_True;
+                bHasOutputStream = true;
             else if ( pOldValue[i].Name == sStream )
-                bHasStream = sal_True;
+                bHasStream = true;
             else if ( pOldValue[i].Name == "DocumentBaseURL" )
-                bHasBaseURL = sal_True;
+                bHasBaseURL = true;
             else if( pOldValue[i].Name == "FilterName" )
                 bHasFilterName = true;
         }
commit ffc4fc97d3ade42aace321a86f8712f8de749a30
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Mar 5 09:27:44 2014 +0100

    let us use OOXML transitional in the calc export tests
    
    Now the export validation test passes and we can finally make use of it.
    
    Change-Id: Ic8a6d15f3f0aa84b35b480e3cb0fa1c54c5e6b25

diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 2c22850..7ab7a36 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -68,7 +68,7 @@ std::ostream& operator<<(std::ostream& rStrm, const Color& rColor)
 FileFormat aFileFormats[] = {
     { "ods" , "calc8", "", ODS_FORMAT_TYPE },
     { "xls" , "MS Excel 97", "calc_MS_EXCEL_97", XLS_FORMAT_TYPE },
-    { "xlsx", "Calc MS Excel 2007 XML" , "MS Excel 2007 XML", XLSX_FORMAT_TYPE },
+    { "xlsx", "Calc Office Open XML" , "Office Open XML Spreadsheet", XLSX_FORMAT_TYPE },
     { "csv" , "Text - txt - csv (StarCalc)", "generic_Text", CSV_FORMAT_TYPE },
     { "html" , "calc_HTML_WebQuery", "generic_HTML", HTML_FORMAT_TYPE },
     { "123" , "Lotus", "calc_Lotus", LOTUS123_FORMAT_TYPE },
@@ -638,6 +638,10 @@ void validate(const utl::TempFile& rTempFile, validation::ScValidationFormat eFo
             sal_Int32 nErrors = aNumber.toInt32();
             OString aMsg("validation error in OOXML export: Errors: ");
             aMsg = aMsg + OString::number(nErrors);
+            if(nErrors)
+            {
+                SAL_WARN("sc", aContent);
+            }
             CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_Int32(0), nErrors);
         }
     }
commit 702e08d1130f1e323926e37104853c7e8469db5a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Mar 5 09:27:00 2014 +0100

    make sure we always set the filter name in the media descriptor
    
    Change-Id: I659c87a0f0856a95a5f9c71180b1d595f0dc09fa

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 76e9f13..34eadda 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2370,6 +2370,7 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
         sal_Bool bHasOutputStream = sal_False;
         sal_Bool bHasStream = sal_False;
         sal_Bool bHasBaseURL = sal_False;
+        bool bHasFilterName = false;
         sal_Int32 i;
         sal_Int32 nEnd = aOldArgs.getLength();
 
@@ -2384,6 +2385,8 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
                 bHasStream = sal_True;
             else if ( pOldValue[i].Name == "DocumentBaseURL" )
                 bHasBaseURL = sal_True;
+            else if( pOldValue[i].Name == "FilterName" )
+                bHasFilterName = true;
         }
 
         if ( !bHasOutputStream )
@@ -2408,6 +2411,13 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
             aArgs[nEnd-1].Value <<= rMedium.GetBaseURL( true );
         }
 
+        if( !bHasFilterName )
+        {
+            aArgs.realloc( ++nEnd );
+            aArgs[nEnd-1].Name = "FilterName";
+            aArgs[nEnd-1].Value <<= aFilterName;
+        }
+
         return xFilter->filter( aArgs );
         }catch(const uno::Exception&)
         {}
commit 553a4d154ba37df80a0240b4ff114c274d461051
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Mar 5 08:48:44 2014 +0100

    use CPPUNIT_ASSERT_EQUAL
    
    Change-Id: I66db2bdf7bddaa6d8f1d935e28376e3d0898071f

diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 237bbce..2c22850 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -638,7 +638,7 @@ void validate(const utl::TempFile& rTempFile, validation::ScValidationFormat eFo
             sal_Int32 nErrors = aNumber.toInt32();
             OString aMsg("validation error in OOXML export: Errors: ");
             aMsg = aMsg + OString::number(nErrors);
-            CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), nErrors == 0);
+            CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), sal_Int32(0), nErrors);
         }
     }
 }


More information about the Libreoffice-commits mailing list