Kaydet (Commit) 127caae6 authored tarafından Miklos Vajna's avatar Miklos Vajna

SwModelTestBase: add save(), next to load() and reload()

Change-Id: I15405dd6be64da689257aed50ba847f3741df3a1
üst 8bcbc1d5
...@@ -288,6 +288,17 @@ protected: ...@@ -288,6 +288,17 @@ protected:
calcLayout(); 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() void finish()
{ {
sal_uInt32 nEndTime = osl_getGlobalTimer(); sal_uInt32 nEndTime = osl_getGlobalTimer();
......
...@@ -152,14 +152,8 @@ void Test::testFdo58949() ...@@ -152,14 +152,8 @@ void Test::testFdo58949()
* and replacement image) OLE objects using UNO, so we'll check the zip file directly. * and replacement image) OLE objects using UNO, so we'll check the zip file directly.
*/ */
// Create the zip file.
utl::TempFile aTempFile; utl::TempFile aTempFile;
aTempFile.EnableKillingFile(); save("writer8", aTempFile);
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);
uno::Sequence<uno::Any> aArgs(1); uno::Sequence<uno::Any> aArgs(1);
aArgs[0] <<= OUString(aTempFile.GetURL()); aArgs[0] <<= OUString(aTempFile.GetURL());
......
...@@ -578,12 +578,7 @@ void Test::testCellBtlr() ...@@ -578,12 +578,7 @@ void Test::testCellBtlr()
// Create the zip file. // Create the zip file.
utl::TempFile aTempFile; utl::TempFile aTempFile;
aTempFile.EnableKillingFile(); save("Office Open XML Text", aTempFile);
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);
// Read the XML stream we're interested in. // Read the XML stream we're interested in.
uno::Sequence<uno::Any> aArgs(1); uno::Sequence<uno::Any> aArgs(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment