screenshots: unify dumping of dialog test batch file
Change-Id: Ia1e79216d9537c65f8b7362778a2e1ad3ec6c2c2
This commit is contained in:
committed by
Thorsten Behrens
parent
51cd1024a6
commit
2a5ac6f634
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+18
-43
@@ -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((*i).second));
|
||||
std::unique_ptr<VclAbstractDialog> pDlg(createDialogByID(5));
|
||||
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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 \
|
||||
))
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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: */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user