diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-04-26 15:23:21 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-26 15:27:15 +0200 |
commit | 127caae6f7ec97ba1387e2e737f499e149d134ab (patch) | |
tree | 426b62ba0781800d3d610cc0539dcc8dccacaf94 /sw/qa | |
parent | 8bcbc1d51dfaa40961c12324423fbf263be78538 (diff) |
SwModelTestBase: add save(), next to load() and reload()
Change-Id: I15405dd6be64da689257aed50ba847f3741df3a1
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 11 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 7 |
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); |