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: i_stylist.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-08-28 11:44:45 $
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 : wolfram.garten@sun.com
36 '* short description :
38 '*******************************************************************
40 ' #1 tFormatStylistBackground
41 ' #1 fGetSetPageBackground
43 '\*******************************************************************
45 testcase tFormatStylistBackground
46 '/// special test for BUG # 96364 "Background style looses functionality over PPT Ex/import" ///'
47 dim sFilter (50) as string
48 dim sFileList (30) as string
53 dim sFileName as string
54 dim Exlist(20) as string
59 QaErrorLog "This testcase does not support Asian languages. Test ends."
63 if (glLocale(5) = "") then
64 qaErrorLog("Language dependant string 'Background' is missing; get it from the stylist and insert it into the locale-file mentioned in the .bas file!")
68 '/// if not exists : gOfficePath + '\\user\\impress\\optional\\', create it ///'
69 if app.dir (ConvertPath ( gOfficePath + "user/work/impress") ) = "" then
70 app.mkdir ConvertPath ( gOfficePath + "user/work/impress")
72 if app.dir (ConvertPath ( gOfficePath + "user/work/impress/optional")) = "" then
73 app.mkdir ConvertPath ( gOfficePath + "user/work/impress/optional")
76 '/// open application ///'
80 '/// change background color via stylist ///'
81 if (iColor <> fGetSetPageBackground (iColor,0)) then
82 warnlog "Stylist background was not changed as expected :-( "+iColor
84 '/// check if it is the same in Format -> Page ///'
85 if fGetSetPageBackground (0,1) <> iColor then
86 warnlog " First stage error! Difference between stylist and menu entry :-( "+iColor
89 '/// save this in 3 formats: ///'
90 '///+ - StarImpress 5.0 ///'
91 '///+ - StarOffice 6.0 Presentation ///'
92 '///+ - Microsoft PowerPoint 97/2000/XP ///'
95 Kontext "SpeichernDlg"
97 if i=0 then x = Dateityp.GetItemCount
98 if (i) then ' set border, whenm start from beginning/end
99 y = ((i-1)*2)+1 ' set filter from beginning
101 y = x-3 ' set filter from end
103 ListAppend(sFilter(), Dateityp.GetItemText (y))
107 sFileName = convertpath( gOfficePath + "user/work/impress/optional")
108 GetFileList ( sFileName, "isty_*.*", Exlist() )
109 KillFileList ( Exlist() )
111 for i = 1 to (ListCount(sFilter()))
113 printlog "Going to save: '"+sFileName+"isty_"+(i)+"'..."
115 hFileSaveAsWithFilterKill (sFileName+"isty_"+(i), "impress8" )
116 printlog " saved with filter ("+i+"/3): "+ sFilter(i)
119 '/// close impress ///'
122 kontext ' active about information loss ?
123 if active.exists (5) then active.yes
126 '/// open just saved files ///'
127 sFileName = ConvertPath ( gOfficePath + "user/work/impress/optional/" )
128 GetFileList ( sFileName, "isty_*", sFileList() )
130 x = ListCount ( sFileList() )
132 printlog "("+i+"/"+x+"): "+sFileList(i)
133 hFileOpen ( sFileList(i) )
135 If hIsNamedDocLoaded (sFileList(i)) Then
136 printlog " used filter: " + hGetUsedFilter()
138 warnlog "document didn't get loaded"
141 '/// check if stylist, menue and prediction are as expected ///'
143 if ((fGetSetPageBackground (0,0) <> iColor) OR (fGetSetPageBackground (0,1) <> iColor)) then
144 warnlog "Background was not as expected on loading :-( "+iColor
147 '/// change background in stylist ///'
148 if (fGetSetPageBackground (iColor,0) <> iColor) then
149 warnlog "Stylist background was not changed as expected :-( "+iColor
152 '/// check if background is same in format menu ///'
153 if (fGetSetPageBackground (0,1) <> iColor) then
154 warnlog "Format menu background is wrong :-( "+iColor
162 '------------------------------------------------------------------------------