diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-07-17 13:20:13 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-07-17 13:22:57 +0200 |
commit | 461cb8fb430bfab2f67ae22d40852c3ca42841a2 (patch) | |
tree | 6292e00ca8a096242478f51550a453aecdaa6780 /sd/qa/unit/sdmodeltestbase.hxx | |
parent | a4928075958fd911d751a74b3a06e6730b557272 (diff) |
make the temp file names random in sd tests
All the temp files got the same names for the temp files which might
conflict when two tests try to get teh same temp file at the same time.
Additionally it makes the dbgutil check by Norbert for finding leaked
temp files useless.
Change-Id: I692107f7705787c360247785b8d95daf4199c2a6
Diffstat (limited to 'sd/qa/unit/sdmodeltestbase.hxx')
-rw-r--r-- | sd/qa/unit/sdmodeltestbase.hxx | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 64f5a6b20cdd..c78c980eac44 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -88,24 +88,17 @@ public: protected: /// Load the document. - sd::DrawDocShellRef loadURL( const OUString &rURL ) + sd::DrawDocShellRef loadURL( const OUString &rURL, sal_Int32 nFormat ) { - FileFormat *pFmt(0); - - for (size_t i = 0; i < SAL_N_ELEMENTS (aFileFormats); i++) - { - pFmt = aFileFormats + i; - if (pFmt->pName && rURL.endsWithIgnoreAsciiCaseAsciiL (pFmt->pName, strlen (pFmt->pName))) - break; - } + FileFormat *pFmt = getFormat(nFormat); CPPUNIT_ASSERT_MESSAGE( "missing filter info", pFmt->pName != NULL ); - sal_uInt32 nFormat = 0; + sal_uInt32 nOptions = 0; if (pFmt->nFormatType) - nFormat = SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS; + nOptions = SFX_FILTER_IMPORT | SFX_FILTER_USESOPTIONS; SfxFilter* aFilter = new SfxFilter( OUString::createFromAscii( pFmt->pFilterName ), - OUString(), pFmt->nFormatType, nFormat, + OUString(), pFmt->nFormatType, nOptions, OUString::createFromAscii( pFmt->pTypeName ), 0, OUString(), OUString::createFromAscii( pFmt->pUserData ), @@ -176,7 +169,7 @@ protected: { FileFormat* pFormat = getFormat(nExportType); OUString aExt = OUString( "." ) + OUString::createFromAscii(pFormat->pName); - utl::TempFile aTempFile(OUString(), true, &aExt); + utl::TempFile aTempFile; aTempFile.EnableKillingFile(); save(pShell, pFormat, aTempFile); if(nExportType == ODP) @@ -187,7 +180,7 @@ protected: { BootstrapFixture::validate(aTempFile.GetFileName(), test::OOXML); } - return loadURL(aTempFile.GetURL()); + return loadURL(aTempFile.GetURL(), nExportType); } /** Dump shapes in xDocShRef, and compare the dump against content of pShapesDumpFileNameBase<number>.xml. |