Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2a5ac6f6
Kaydet (Commit)
2a5ac6f6
authored
Tem 28, 2016
tarafından
Armin Le Grand
Kaydeden (comit)
Thorsten Behrens
Agu 18, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
screenshots: unify dumping of dialog test batch file
Change-Id: Ia1e79216d9537c65f8b7362778a2e1ad3ec6c2c2
üst
51cd1024
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
126 additions
and
1358 deletions
+126
-1358
basctl-dialogs-test.cxx
basctl/qa/unit/basctl-dialogs-test.cxx
+2
-74
chart2-dialogs-test.cxx
chart2/qa/unit/chart2-dialogs-test.cxx
+2
-74
cui-dialogs-test.cxx
cui/qa/unit/cui-dialogs-test.cxx
+2
-74
dbaccess-dialogs-test.cxx
dbaccess/qa/unit/dbaccess-dialogs-test.cxx
+2
-74
desktop-dialogs-test.cxx
desktop/qa/unit/desktop-dialogs-test.cxx
+2
-74
filter-dialogs-test.cxx
filter/qa/unit/filter-dialogs-test.cxx
+2
-74
formula-dialogs-test.cxx
formula/qa/unit/formula-dialogs-test.cxx
+2
-74
fpicker-dialogs-test.cxx
fpicker/qa/unit/fpicker-dialogs-test.cxx
+2
-74
screenshot_test.hxx
include/test/screenshot_test.hxx
+14
-0
reportdesign-dialogs-test.cxx
reportdesign/qa/unit/reportdesign-dialogs-test.cxx
+2
-74
screenshots.cxx
sc/qa/unit/screenshots/screenshots.cxx
+2
-55
dialogs-test.cxx
sd/qa/unit/dialogs-test.cxx
+18
-43
sfx2-dialogs-test.cxx
sfx2/qa/unit/sfx2-dialogs-test.cxx
+2
-74
starmath-dialogs-test.cxx
starmath/qa/unit/starmath-dialogs-test.cxx
+2
-74
svtools-dialogs-test.cxx
svtools/qa/unit/svtools-dialogs-test.cxx
+2
-74
svx-dialogs-test.cxx
svx/qa/unit/svx-dialogs-test.cxx
+2
-74
CppunitTest_sw_filters_test.mk
sw/CppunitTest_sw_filters_test.mk
+0
-2
Module_sw.mk
sw/Module_sw.mk
+5
-0
sw-dialogs-test.cxx
sw/qa/unit/sw-dialogs-test.cxx
+2
-74
screenshot_test.cxx
test/source/screenshot_test.cxx
+53
-0
uui-dialogs-test.cxx
uui/qa/unit/uui-dialogs-test.cxx
+2
-74
vcl-dialogs-test.cxx
vcl/qa/unit/vcl-dialogs-test.cxx
+2
-74
xmlsecurity-dialogs-test.cxx
xmlsecurity/qa/unit/xmlsecurity-dialogs-test.cxx
+2
-74
No files found.
basctl/qa/unit/basctl-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
chart2/qa/unit/chart2-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
cui/qa/unit/cui-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
dbaccess/qa/unit/dbaccess-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
desktop/qa/unit/desktop-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
filter/qa/unit/filter-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
formula/qa/unit/formula-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
fpicker/qa/unit/fpicker-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
);
...
...
include/test/screenshot_test.hxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
;
}
};
...
...
reportdesign/qa/unit/reportdesign-dialogs-test.cxx
Dosyayı görüntüle @
2a5ac6f6
...
...
@@ -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
{