[Libreoffice-commits] core.git: Branch 'feature/dialog-screenshots' - basctl/qa chart2/qa cui/qa dbaccess/qa desktop/qa filter/qa formula/qa fpicker/qa include/test reportdesign/qa sc/qa sd/qa sfx2/qa starmath/qa svtools/qa svx/qa sw/CppunitTest_sw_filters_test.mk sw/Module_sw.mk sw/qa test/source uui/qa vcl/qa xmlsecurity/qa
Armin Le Grand
Armin.Le.Grand at cib.de
Thu Jul 28 10:23:56 UTC 2016
basctl/qa/unit/basctl-dialogs-test.cxx | 76 ---------------------
chart2/qa/unit/chart2-dialogs-test.cxx | 76 ---------------------
cui/qa/unit/cui-dialogs-test.cxx | 76 ---------------------
dbaccess/qa/unit/dbaccess-dialogs-test.cxx | 76 ---------------------
desktop/qa/unit/desktop-dialogs-test.cxx | 76 ---------------------
filter/qa/unit/filter-dialogs-test.cxx | 76 ---------------------
formula/qa/unit/formula-dialogs-test.cxx | 76 ---------------------
fpicker/qa/unit/fpicker-dialogs-test.cxx | 76 ---------------------
include/test/screenshot_test.hxx | 14 +++
reportdesign/qa/unit/reportdesign-dialogs-test.cxx | 76 ---------------------
sc/qa/unit/screenshots/screenshots.cxx | 57 ---------------
sd/qa/unit/dialogs-test.cxx | 61 ++++------------
sfx2/qa/unit/sfx2-dialogs-test.cxx | 76 ---------------------
starmath/qa/unit/starmath-dialogs-test.cxx | 76 ---------------------
svtools/qa/unit/svtools-dialogs-test.cxx | 76 ---------------------
svx/qa/unit/svx-dialogs-test.cxx | 76 ---------------------
sw/CppunitTest_sw_filters_test.mk | 2
sw/Module_sw.mk | 5 +
sw/qa/unit/sw-dialogs-test.cxx | 76 ---------------------
test/source/screenshot_test.cxx | 53 ++++++++++++++
uui/qa/unit/uui-dialogs-test.cxx | 76 ---------------------
vcl/qa/unit/vcl-dialogs-test.cxx | 76 ---------------------
xmlsecurity/qa/unit/xmlsecurity-dialogs-test.cxx | 76 ---------------------
23 files changed, 126 insertions(+), 1358 deletions(-)
New commits:
commit 3be95267cfa99a4e30981df0c68c964d1b291e4c
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date: Thu Jul 28 12:22:00 2016 +0200
Unified dumping of dialog test batch file
Change-Id: Ia1e79216d9537c65f8b7362778a2e1ad3ec6c2c2
diff --git a/basctl/qa/unit/basctl-dialogs-test.cxx b/basctl/qa/unit/basctl-dialogs-test.cxx
index 629cf4c..e0af831 100644
--- a/basctl/qa/unit/basctl-dialogs-test.cxx
+++ b/basctl/qa/unit/basctl-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* BasctlDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void BasctlDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("basctl/qa/unit/data/basctl-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("modules/BasicIDE/ui/organizedialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("basctl/qa/unit/data/basctl-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(BasctlDialogsTest);
diff --git a/chart2/qa/unit/chart2-dialogs-test.cxx b/chart2/qa/unit/chart2-dialogs-test.cxx
index 9a9921f..112adbf 100644
--- a/chart2/qa/unit/chart2-dialogs-test.cxx
+++ b/chart2/qa/unit/chart2-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* Chart2DialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void Chart2DialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("chart2/qa/unit/data/chart2-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("modules/schart/ui/datarangedialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("chart2/qa/unit/data/chart2-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2DialogsTest);
diff --git a/cui/qa/unit/cui-dialogs-test.cxx b/cui/qa/unit/cui-dialogs-test.cxx
index 5e819ce..58cc3b9 100644
--- a/cui/qa/unit/cui-dialogs-test.cxx
+++ b/cui/qa/unit/cui-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* CuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void CuiDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("cui/qa/unit/data/cui-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("cui/ui/customizedialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("cui/qa/unit/data/cui-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(CuiDialogsTest);
diff --git a/dbaccess/qa/unit/dbaccess-dialogs-test.cxx b/dbaccess/qa/unit/dbaccess-dialogs-test.cxx
index 6ebecd3..a95a8ce 100644
--- a/dbaccess/qa/unit/dbaccess-dialogs-test.cxx
+++ b/dbaccess/qa/unit/dbaccess-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* DbaccessDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void DbaccessDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("dbaccess/qa/unit/data/dbaccess-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("dbaccess/ui/advancedsettingsdialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("dbaccess/qa/unit/data/dbaccess-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(DbaccessDialogsTest);
diff --git a/desktop/qa/unit/desktop-dialogs-test.cxx b/desktop/qa/unit/desktop-dialogs-test.cxx
index 5768b43..ff654ff 100644
--- a/desktop/qa/unit/desktop-dialogs-test.cxx
+++ b/desktop/qa/unit/desktop-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* DesktopDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void DesktopDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("desktop/qa/unit/data/desktop-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("desktop/ui/cmdlinehelp.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("desktop/qa/unit/data/desktop-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(DesktopDialogsTest);
diff --git a/filter/qa/unit/filter-dialogs-test.cxx b/filter/qa/unit/filter-dialogs-test.cxx
index 91a891d..8cc1497 100644
--- a/filter/qa/unit/filter-dialogs-test.cxx
+++ b/filter/qa/unit/filter-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* FilterDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void FilterDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("filter/qa/unit/data/filter-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("filter/ui/pdfoptionsdialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("filter/qa/unit/data/filter-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(FilterDialogsTest);
diff --git a/formula/qa/unit/formula-dialogs-test.cxx b/formula/qa/unit/formula-dialogs-test.cxx
index 80d2d3f..97f3c90 100644
--- a/formula/qa/unit/formula-dialogs-test.cxx
+++ b/formula/qa/unit/formula-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* FormulaDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void FormulaDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("formula/qa/unit/data/formula-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("formula/ui/functionpage.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("formula/qa/unit/data/formula-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(FormulaDialogsTest);
diff --git a/fpicker/qa/unit/fpicker-dialogs-test.cxx b/fpicker/qa/unit/fpicker-dialogs-test.cxx
index 82269a1..622138d 100644
--- a/fpicker/qa/unit/fpicker-dialogs-test.cxx
+++ b/fpicker/qa/unit/fpicker-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* FpickerDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void FpickerDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("fpicker/qa/unit/data/fpicker-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("fps/ui/foldernamedialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("fpicker/qa/unit/data/fpicker-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(FpickerDialogsTest);
diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx
index 443db31..473d44a 100644
--- a/include/test/screenshot_test.hxx
+++ b/include/test/screenshot_test.hxx
@@ -68,6 +68,20 @@ public:
/// compared to the active dialog (can be compared with dialog previewer)
void dumpDialogToPath(const OString& rUIXMLDescription);
+ /// helper to process all known dialogs
+ void processAllKnownDialogs();
+
+ /// helper to process an input file containing the UXMLDescriptions
+ /// of the dialogs to dump. It will internally try to detect and open
+ /// as known dialog first. If not successful, it will then use the
+ /// fallback version to dump the dialog.
+ /// The syntax of the input file is as follows:
+ /// - emty lines are allowed
+ /// - lines starting with '#' are treated as comment
+ /// - all other lines should contain a *.ui filename in the same
+ /// notation as in the dialog constructors(see code)
+ void processDialogBatchFile(const OUString& rFile);
+
/// const access to known dialogs
const mapType& getKnownDialogs() const { return maKnownDialogs; }
};
diff --git a/reportdesign/qa/unit/reportdesign-dialogs-test.cxx b/reportdesign/qa/unit/reportdesign-dialogs-test.cxx
index ac59b80..3f37364 100644
--- a/reportdesign/qa/unit/reportdesign-dialogs-test.cxx
+++ b/reportdesign/qa/unit/reportdesign-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* ReportdesignDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void ReportdesignDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("reportdesign/qa/unit/data/reportdesign-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("modules/dbreport/ui/background.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("reportdesign/qa/unit/data/reportdesign-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(ReportdesignDialogsTest);
diff --git a/sc/qa/unit/screenshots/screenshots.cxx b/sc/qa/unit/screenshots/screenshots.cxx
index 255fe9c..c52bbc5 100644
--- a/sc/qa/unit/screenshots/screenshots.cxx
+++ b/sc/qa/unit/screenshots/screenshots.cxx
@@ -275,61 +275,8 @@ void ScScreenshotTest::testOpeningModalDialogs()
{
initializeWithDoc("empty.ods");
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("sc/qa/unit/screenshots/data/screenshots.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("sc/qa/unit/screenshots/data/screenshots.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScScreenshotTest);
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 1b0cf2b..92e3da5 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -608,58 +608,33 @@ void SdDialogsTest::openAnyDialog()
/// to dump
if (true)
{
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("sd/qa/unit/data/dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
+ processDialogBatchFile("sd/qa/unit/data/dialogs-test.txt");
}
/// example how to dump all known dialogs
if (false)
{
+ processAllKnownDialogs();
+ }
+
+ /// example how to dump exactly one known dialog
+ if (false)
+ {
// example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
// example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
// example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
+ std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID(5));
+
+ if (pDlg)
+ {
+ // known dialog, dump screenshot to path
+ dumpDialogToPath(*pDlg);
+ }
+ else
{
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
+ // unknown dialog, should not happen in this basic loop.
+ // You have probably forgotten to add a case and
+ // implementastion to createDialogByID, please do this
}
}
diff --git a/sfx2/qa/unit/sfx2-dialogs-test.cxx b/sfx2/qa/unit/sfx2-dialogs-test.cxx
index 8e144eb..42fb59e 100644
--- a/sfx2/qa/unit/sfx2-dialogs-test.cxx
+++ b/sfx2/qa/unit/sfx2-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* Sfx2DialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void Sfx2DialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("sfx2/qa/unit/data/sfx2-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("sfx/ui/documentpropertiesdialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("sfx2/qa/unit/data/sfx2-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(Sfx2DialogsTest);
diff --git a/starmath/qa/unit/starmath-dialogs-test.cxx b/starmath/qa/unit/starmath-dialogs-test.cxx
index 82f576b..2bd480d 100644
--- a/starmath/qa/unit/starmath-dialogs-test.cxx
+++ b/starmath/qa/unit/starmath-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* StarmathDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void StarmathDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("starmath/qa/unit/data/starmath-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("modules/smath/ui/printeroptions.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("starmath/qa/unit/data/starmath-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(StarmathDialogsTest);
diff --git a/svtools/qa/unit/svtools-dialogs-test.cxx b/svtools/qa/unit/svtools-dialogs-test.cxx
index 1bc1a8c..9be029e 100644
--- a/svtools/qa/unit/svtools-dialogs-test.cxx
+++ b/svtools/qa/unit/svtools-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* SvtoolsDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void SvtoolsDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("svtools/qa/unit/data/svtools-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("svt/ui/addresstemplatedialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("svtools/qa/unit/data/svtools-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(SvtoolsDialogsTest);
diff --git a/svx/qa/unit/svx-dialogs-test.cxx b/svx/qa/unit/svx-dialogs-test.cxx
index 17bbfd2..fec1e18 100644
--- a/svx/qa/unit/svx-dialogs-test.cxx
+++ b/svx/qa/unit/svx-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* SvxDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void SvxDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("svx/qa/unit/data/svx-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("svx/ui/textcontrolchardialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("svx/qa/unit/data/svx-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(SvxDialogsTest);
diff --git a/sw/CppunitTest_sw_filters_test.mk b/sw/CppunitTest_sw_filters_test.mk
index 5d07ee3..d3cf68b 100644
--- a/sw/CppunitTest_sw_filters_test.mk
+++ b/sw/CppunitTest_sw_filters_test.mk
@@ -16,11 +16,9 @@ $(eval $(call gb_CppunitTest_use_externals,sw_filters_test,\
libxml2 \
))
-ifneq ($(DISABLE_CVE_TESTS),TRUE)
$(eval $(call gb_CppunitTest_add_exception_objects,sw_filters_test, \
sw/qa/core/filters-test \
))
-endif
$(eval $(call gb_CppunitTest_use_libraries,sw_filters_test, \
sw \
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 890a051..d635f4c 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -79,8 +79,13 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
))
endif
+ifneq ($(DISABLE_CVE_TESTS),TRUE)
$(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_filters_test \
+))
+endif
+
+$(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_dialogs_test \
))
diff --git a/sw/qa/unit/sw-dialogs-test.cxx b/sw/qa/unit/sw-dialogs-test.cxx
index 651482f..ee9a855 100644
--- a/sw/qa/unit/sw-dialogs-test.cxx
+++ b/sw/qa/unit/sw-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* SwDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void SwDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("sw/qa/unit/data/sw-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("modules/swriter/ui/abstractdialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("sw/qa/unit/data/sw-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(SwDialogsTest);
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index dfbd2ce..a700b8d 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -199,4 +199,57 @@ void ScreenshotTest::dumpDialogToPath(const OString& rUIXMLDescription)
}
}
+void ScreenshotTest::processAllKnownDialogs()
+{
+ for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
+ {
+ std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
+
+ if (pDlg)
+ {
+ // known dialog, dump screenshot to path
+ dumpDialogToPath(*pDlg);
+ }
+ else
+ {
+ // unknown dialog, should not happen in this basic loop.
+ // You have probably forgotten to add a case and
+ // implementastion to createDialogByID, please do this
+ }
+ }
+}
+
+void ScreenshotTest::processDialogBatchFile(const OUString& rFile)
+{
+ test::Directories aDirectories;
+ const OUString aURL(aDirectories.getURLFromSrc(rFile));
+ SvFileStream aStream(aURL, StreamMode::READ);
+ OString aNextUIFile;
+ const OString aComment("#");
+
+ while (aStream.ReadLine(aNextUIFile))
+ {
+ if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
+ {
+ // first check if it's a known dialog
+ std::unique_ptr<VclAbstractDialog> 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);
+ }
+ }
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/uui/qa/unit/uui-dialogs-test.cxx b/uui/qa/unit/uui-dialogs-test.cxx
index f3a7d0c..c4fab13 100644
--- a/uui/qa/unit/uui-dialogs-test.cxx
+++ b/uui/qa/unit/uui-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* UuiDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void UuiDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("uui/qa/unit/data/uui-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("uui/ui/authfallback.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("uui/qa/unit/data/uui-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(UuiDialogsTest);
diff --git a/vcl/qa/unit/vcl-dialogs-test.cxx b/vcl/qa/unit/vcl-dialogs-test.cxx
index 914c52d..5ad8e10 100644
--- a/vcl/qa/unit/vcl-dialogs-test.cxx
+++ b/vcl/qa/unit/vcl-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* VclDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void VclDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("vcl/qa/unit/data/vcl-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("vcl/ui/printerpropertiesdialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("vcl/qa/unit/data/vcl-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(VclDialogsTest);
diff --git a/xmlsecurity/qa/unit/xmlsecurity-dialogs-test.cxx b/xmlsecurity/qa/unit/xmlsecurity-dialogs-test.cxx
index 95be0dc..ecb0495 100644
--- a/xmlsecurity/qa/unit/xmlsecurity-dialogs-test.cxx
+++ b/xmlsecurity/qa/unit/xmlsecurity-dialogs-test.cxx
@@ -67,80 +67,8 @@ VclAbstractDialog* XmlsecurityDialogsTest::createDialogByID(sal_uInt32 /*nID*/)
void XmlsecurityDialogsTest::openAnyDialog()
{
- /// example how to process an input file containing the UXMLDescriptions of the dialogs
- /// to dump
- if (true)
- {
- test::Directories aDirectories;
- OUString aURL = aDirectories.getURLFromSrc("xmlsecurity/qa/unit/data/xmlsecurity-dialogs-test.txt");
- SvFileStream aStream(aURL, StreamMode::READ);
- OString aNextUIFile;
- const OString aComment("#");
-
- while (aStream.ReadLine(aNextUIFile))
- {
- if (!aNextUIFile.isEmpty() && !aNextUIFile.startsWith(aComment))
- {
- // first check if it's a known dialog
- std::unique_ptr<VclAbstractDialog> 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);
- }
- }
- }
- }
-
- /// example how to dump all known dialogs
- if (false)
- {
- // example for SfxTabDialog: 5 -> "modules/sdraw/ui/drawpagedialog.ui"
- // example for TabDialog: 22 -> "modules/simpress/ui/headerfooterdialog.ui"
- // example for self-adapted wizard: 0 -> "modules/simpress/ui/publishingdialog.ui"
- for (mapType::const_iterator i = getKnownDialogs().begin(); i != getKnownDialogs().end(); i++)
- {
- std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID((*i).second));
-
- if (pDlg)
- {
- // known dialog, dump screenshot to path
- dumpDialogToPath(*pDlg);
- }
- else
- {
- // unknown dialog, should not happen in this basic loop.
- // You have probably forgotten to add a case and
- // implementastion to createDialogByID, please do this
- }
- }
- }
-
- /// example how to dump a dialog using fallback functionality
- if (false)
- {
- // 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.
- //
- // Take any example here, it's only for demonstration - using
- // even a known one to demonstrate the fallback possibility
- const OString aUIXMLDescription("xmlsec/ui/viewcertdialog.ui");
-
- dumpDialogToPath(aUIXMLDescription);
- }
+ /// process input file containing the UXMLDescriptions of the dialogs to dump
+ processDialogBatchFile("xmlsecurity/qa/unit/data/xmlsecurity-dialogs-test.txt");
}
CPPUNIT_TEST_SUITE_REGISTRATION(XmlsecurityDialogsTest);
More information about the Libreoffice-commits
mailing list