diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index 5f98430ebf53..3726afaeb716 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -247,26 +247,35 @@ void ScreenshotTest::processDialogBatchFile(const OUString& rFile) while (aStream.ReadLine(aNextUIFile)) { - if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment)) + try { - // first check if it's a known dialog - ScopedVclPtr pDlg(createDialogByName(aNextUIFile)); + if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment)) + { + // first check if it's a known dialog + ScopedVclPtr pDlg(createDialogByName(aNextUIFile)); - if (pDlg) - { - // known dialog, dump screenshot to path - dumpDialogToPath(*pDlg); - } - else - { - // unknown dialog, try fallback to generic created - // VclBuilder-generated instance. Keep in mind that Dialogs - // using this mechanism will probably not be layouted well - // since the setup/initialization part is missing. Thus, - // only use for fallback when only the UI file is available. - dumpDialogToPath(aNextUIFile); + if (pDlg) + { + // known dialog, dump screenshot to path + dumpDialogToPath(*pDlg); + } + else + { + // unknown dialog, try fallback to generic created + // VclBuilder-generated instance. Keep in mind that Dialogs + // using this mechanism will probably not be layouted well + // since the setup/initialization part is missing. Thus, + // only use for fallback when only the UI file is available. + dumpDialogToPath(aNextUIFile); + } } } + catch(...) + { + OString aMsg("Exception while processing "); + aMsg += aNextUIFile; + CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), false); + } } }