summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx11
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx8
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx7
3 files changed, 13 insertions, 13 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index c367b8f48ace..5419a8c8a503 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 5c4c4082fc9f..436759a2813f 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 41b335bda300..0def6ef93852 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);