[Libreoffice-commits] core.git: sw/qa

Miklos Vajna vmiklos at suse.cz
Fri Apr 26 06:27:36 PDT 2013


 sw/qa/extras/inc/swmodeltestbase.hxx     |   11 +++++++++++
 sw/qa/extras/odfexport/odfexport.cxx     |    8 +-------
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx |    7 +------
 3 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 127caae6f7ec97ba1387e2e737f499e149d134ab
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Apr 26 15:23:21 2013 +0200

    SwModelTestBase: add save(), next to load() and reload()
    
    Change-Id: I15405dd6be64da689257aed50ba847f3741df3a1

diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index c367b8f..5419a8c 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -288,6 +288,17 @@ protected:
         calcLayout();
     }
 
+    /// Save the loaded document to a tempfile. Can be used to check the resulting docx/odt directly as a ZIP file.
+    void save(OUString aFilter, utl::TempFile& rTempFile)
+    {
+        rTempFile.EnableKillingFile();
+        uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
+        uno::Sequence<beans::PropertyValue> aFilterArgs(1);
+        aFilterArgs[0].Name = "FilterName";
+        aFilterArgs[0].Value <<= aFilter;
+        xStorable->storeToURL(rTempFile.GetURL(), aFilterArgs);
+    }
+
     void finish()
     {
         sal_uInt32 nEndTime = osl_getGlobalTimer();
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 5c4c408..436759a 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -152,14 +152,8 @@ void Test::testFdo58949()
      * and replacement image) OLE objects using UNO, so we'll check the zip file directly.
      */
 
-    // Create the zip file.
     utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
-    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    uno::Sequence<beans::PropertyValue> aFilterArgs(1);
-    aFilterArgs[0].Name = "FilterName";
-    aFilterArgs[0].Value <<= OUString("writer8");
-    xStorable->storeToURL(aTempFile.GetURL(), aFilterArgs);
+    save("writer8", aTempFile);
 
     uno::Sequence<uno::Any> aArgs(1);
     aArgs[0] <<= OUString(aTempFile.GetURL());
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 41b335b..0def6ef 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -578,12 +578,7 @@ void Test::testCellBtlr()
 
     // Create the zip file.
     utl::TempFile aTempFile;
-    aTempFile.EnableKillingFile();
-    uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    uno::Sequence<beans::PropertyValue> aFilterArgs(1);
-    aFilterArgs[0].Name = "FilterName";
-    aFilterArgs[0].Value <<= OUString("Office Open XML Text");
-    xStorable->storeToURL(aTempFile.GetURL(), aFilterArgs);
+    save("Office Open XML Text", aTempFile);
 
     // Read the XML stream we're interested in.
     uno::Sequence<uno::Any> aArgs(1);


More information about the Libreoffice-commits mailing list