diff options
Diffstat (limited to 'test/source/screenshot_test.cxx')
-rw-r--r-- | test/source/screenshot_test.cxx | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx index 92f48ee28823..dfbd2cee257c 100644 --- a/test/source/screenshot_test.cxx +++ b/test/source/screenshot_test.cxx @@ -178,16 +178,24 @@ void ScreenshotTest::dumpDialogToPath(const OString& rUIXMLDescription) if (!rUIXMLDescription.isEmpty()) { VclPtrInstance<Dialog> pDialog(Application::GetDefDialogParent(), WB_STDDIALOG | WB_SIZEABLE, Dialog::InitFlag::NoParent); - VclBuilder aBuilder(pDialog, VclBuilderContainer::getUIRootDir(), OStringToOUString(rUIXMLDescription, RTL_TEXTENCODING_UTF8)); - vcl::Window *pRoot = aBuilder.get_widget_root(); - Dialog *pRealDialog = dynamic_cast<Dialog*>(pRoot); - if (!pRealDialog) - pRealDialog = pDialog; + { + VclBuilder aBuilder(pDialog, VclBuilderContainer::getUIRootDir(), OStringToOUString(rUIXMLDescription, RTL_TEXTENCODING_UTF8)); + vcl::Window *pRoot = aBuilder.get_widget_root(); + Dialog *pRealDialog = dynamic_cast<Dialog*>(pRoot); + + if (!pRealDialog) + { + pRealDialog = pDialog; + } + + pRealDialog->SetText("LibreOffice DialogScreenshot"); + pRealDialog->SetStyle(pDialog->GetStyle() | WB_CLOSEABLE); + + dumpDialogToPath(*pRealDialog); + } - pRealDialog->SetText("LibreOffice DialogScreenshot"); - pRealDialog->SetStyle(pDialog->GetStyle() | WB_CLOSEABLE); - dumpDialogToPath(*pRealDialog); + pDialog.disposeAndClear(); } } |