diff --git a/sw/CppunitTest_sw_filters_test.mk b/sw/CppunitTest_sw_filters_test.mk index 95be87c07a03..102b8a03abc2 100644 --- a/sw/CppunitTest_sw_filters_test.mk +++ b/sw/CppunitTest_sw_filters_test.mk @@ -73,6 +73,8 @@ $(eval $(call gb_CppunitTest_use_components,sw_filters_test,\ svtools/util/svt \ sw/util/msword \ sw/util/sw \ + sw/util/swd \ + uui/util/uui \ toolkit/util/tk \ ucb/source/core/ucb1 \ ucb/source/ucp/file/ucpfile1 \ diff --git a/sw/qa/extras/rtfexport/data/i23357.odt b/sw/qa/core/exportdata/rtf/pass/i23357.odt similarity index 100% rename from sw/qa/extras/rtfexport/data/i23357.odt rename to sw/qa/core/exportdata/rtf/pass/i23357.odt diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 7c811a4e6058..7caa99ff49fa 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -91,7 +91,18 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, SwDocShellRef xDocShRef = new SwDocShell; SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ); - pSrcMed->SetFilter(pFilter); + + const SfxFilter* pImportFilter = 0; + SfxFilter* pExportFilter = 0; + if (bExport) + { + SFX_APP()->GetFilterMatcher().GuessFilter(*pSrcMed, &pImportFilter, SFX_FILTER_IMPORT, 0); + pExportFilter = pFilter; + } + else + pImportFilter = pFilter; + + pSrcMed->SetFilter(pImportFilter); if (rUserData == FILTER_TEXT_DLG) { @@ -107,10 +118,14 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, return bLoaded; } + // How come an error may be set, and still DoLoad() returns success? Strange... + if (bLoaded) + xDocShRef->ResetError(); + utl::TempFile aTempFile; aTempFile.EnableKillingFile(); SfxMedium aDstMed(aTempFile.GetURL(), STREAM_STD_WRITE); - aDstMed.SetFilter(pFilter); + aDstMed.SetFilter(pExportFilter); bool bSaved = xDocShRef->DoSaveAs(aDstMed); if (xDocShRef.Is()) xDocShRef->DoClose(); diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index b4d725405d34..b6084cbed641 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -579,11 +579,6 @@ DECLARE_RTFEXPORT_TEST(testFdo66743, "fdo66743.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(0xd8d8d8), getProperty(xCell, "BackColor")); } -DECLARE_RTFEXPORT_TEST(testI23357, "i23357.odt") -{ - // crashtest -} - #endif CPPUNIT_PLUGIN_IMPLEMENT();