1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: g_001.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 10:27:03 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : thorsten.bosbach@sun.com
36 '* short description : Global resource tests for the menu: File
38 '*************************************************************************
41 ' #1 tExportAsPDFButton
43 '\************************************************************************
45 testcase tFileExportAsPDF
49 sPDF = "PDF - Portable Document Format (.pdf)"
51 '/// open application ///'
54 '/// choose File->Export As PDF ... ///'
56 ' The file dialog has to come up
57 Kontext "SpeichernDlg"
58 if SpeichernDlg.exists(5) then
59 '/// the selected file type should be: 'PDF - Portable Document Format (.pdf)' ///'
60 sTemp = Dateityp.GetSelText
61 if (sTemp <> sPDF) then
62 Warnlog "filter for PDF export is missing :-( should: '" + sPDF + "'; is: '" + sTemp + "'"
64 '///+ - set Textbox 'File name' to "abc" ///'
65 Dateiname.SetText "abc"
68 if active.exists(5) then
69 ' catch active about already existing file name
70 if active.getrt = 304 then
75 ' changed with SRC680m210 - first options, then file dialog...
76 ' kept for testcase backwards compatibility
77 'warnlog "Export dialog didn't come up."
80 '/// dialog 'PDF Options' comes up ///'
81 if active.exists(5) then
82 '/// select the tab page 'General' ///'
83 active.setPage PDFOptions
85 if PDFOptions.exists(5) then
86 dialogTest(PDFOptions)
88 warnlog "Tab page 'PDF Options - General' isn't available."
91 warnlog "Dialog 'PDF Options' didn't come up"
94 if active.exists(5) then
95 '/// select the tab page 'Initial View' ///'
96 active.setPage PDFOptionsInitialView
97 kontext "PDFOptionsInitialView"
98 if PDFOptionsInitialView.exists(5) then
99 dialogTest(PDFOptionsInitialView)
101 warnlog "Tab page 'PDF Options - Initial View' isn't available."
105 if active.exists(5) then
106 '/// select the tab page 'User Interface' ///'
107 active.setPage PDFOptionsUserInterface
108 kontext "PDFOptionsUserInterface"
109 if PDFOptionsUserInterface.exists(5) then
110 dialogTest(PDFOptionsUserInterface)
112 warnlog "Tab page 'PDF Options - User Interface' isn't available."
116 if active.exists(5) then
117 '/// select the tab page 'General' ///'
118 active.setPage PDFOptions
120 '/// close the dialog with 'Cancel' ///'
121 if PDFOptions.exists(5) then
124 warnlog "Tab page 'PDF Options - General' isn't available."
127 '/// close application ///'
131 '-------------------------------------------------------------------------------
133 testcase tExportAsPDFButton
135 '/// Create new document
137 '/// Click the button 'Export Directly as PDF' on the standard toolbar.
138 Kontext "Standardbar"
140 '/// The 'Export as PDF' dialog has to come up, with the only 'File type' 'PDF - Portable Document Format'
141 Kontext "SpeichernDlg"
142 if SpeichernDlg.exists(1) then
143 sTemp = Dateityp.GetSelText
144 if InStr(sTemp, "PDF") = 0 then
145 warnlog "Filter for PDF export seems to be wrong or is missing in selection."
147 '/// Leave dialog with CANCEL button
150 warnlog "SaveAsPDF dialog did not come up."
152 '/// Close spreadsheet document.