From d098f0c957824bd5dec89a799398d587ce9fb96f Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Fri, 15 Jul 2016 15:25:59 +0200 Subject: screenshots: Use UI string and fallback for UI-String only Two changes in this commit: The Dialogs to be dumped are identified in their test files using their UXMLDescription to allow later to 'find' the known dialogs and use the specialized construction for these. Also added a fallback to construct a vcl Dialog based on only the UXMLDescription and the VclBuilder. This will be constructed without any active initialization/layouting, so should only be used for unknown Dialogs. Also added a dumpDialogToPath version to the tooling that can work directly with a vcl Dialog instead of a VclAbstractDialog. Change-Id: I90abb6f59c2fcc5d534907ae7e4b9a15edc2d694 --- include/test/screenshot_test.hxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx index f07c29a9e65b..a3b0b0e6eee7 100644 --- a/include/test/screenshot_test.hxx +++ b/include/test/screenshot_test.hxx @@ -15,6 +15,7 @@ #include #include #include +#include class VclAbstractDialog; @@ -27,10 +28,23 @@ public: virtual void setUp() override; virtual void tearDown() override; - void dumpDialogToPath( VclAbstractDialog& rDialog ); + /// version for AbstractDialogs, the ones created in AbstractDialogFactories + void dumpDialogToPath(VclAbstractDialog& rDialog); + + /// version for pure vcl-based dialogs + void dumpDialogToPath(Dialog& rDialog); + + /// fallback version for dialogs for which only the UXMLDescription is known. + /// This should be used with care - no active layouting will be done, only the + /// VclBuilder will be activated for layouting. Result can thus vary drastically + /// compared to the active dialog (can be compared with dialog previewer) + void dumpDialogToPath(const OString& rUIXMLDescription); private: - void saveScreenshot( VclAbstractDialog& rDialog ); + void implSaveScreenshot(const Bitmap& rScreenshot, const OString& rScreenshotId); + void saveScreenshot(VclAbstractDialog& rDialog); + void saveScreenshot(Dialog& rDialog); + OUString m_aScreenshotDirectory; }; -- cgit v1.2.3