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: ole_2.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $
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-level-1-test -> insert all OLE-Objects out of OLE-dialog into all doc-types
38 '\******************************************************************************
40 testcase tCheckTheOLEObjectDialog
41 '///check in all applications ( Writer/Calc/Draw/Impress/Masterdocument ) the names of all OLE-Objects in the OLE-Dialog
43 qaerrorlog( "#i80670# The OLE retrieval routine is broken beyond repair, redesign required" )
46 Dim lListe (10) as String : Dim lListSoll (10) as String
48 Dim iCount, sCount as Integer
50 call ClosePresentationfloat()
56 case 1 : gApplication = "WRITER"
57 case 2 : gApplication = "CALC"
58 case 3 : gApplication = "IMPRESS"
59 case 4 : gApplication = "DRAW"
60 case 5 : gApplication = "MASTERDOCUMENT"
63 lListe ( 0 ) = 0 : lListSoll ( 0 ) = 0
64 printlog "check OLE-Object-Dialog for " + gApplication
66 '///file / new / .sxw or .sxc, .sxd, .sxi, .sxm
69 '///+insert / objects / OLE-objects
72 Kontext "OLEObjektEinfuegen"
73 if ( not OLEObjektEinfuegen.exists() ) then
74 warnlog( "cannot access the OLE object dialog" )
78 '///+select 'create new'
82 '///+check all names in the list with a comparison list in [TesttoolPath]\global\input\olenames\ole_[lang-code].txt
83 for j=1 to ObjektTyp.GetItemCount
85 ListAppend ( lListe(), ObjektTyp.GetSelText )
89 iCount = ListCount ( lListe() )
91 select case gApplication
92 case "WRITER" : ListAppend ( lListSoll (), gOLECalc )
93 ListAppend ( lListSoll (), gOLEImpress )
94 ListAppend ( lListSoll (), gOLEDraw )
95 ListAppend ( lListSoll (), gOLEChart )
96 ListAppend ( lListSoll (), gOLEMath )
97 case "CALC" : ListAppend ( lListSoll (), gOLEWriter )
98 ListAppend ( lListSoll (), gOLEImpress )
99 ListAppend ( lListSoll (), gOLEDraw )
100 ListAppend ( lListSoll (), gOLEChart )
101 ListAppend ( lListSoll (), gOLEMath )
102 case "DRAW" : ListAppend ( lListSoll (), gOLECalc )
103 ListAppend ( lListSoll (), gOLEImpress )
104 ListAppend ( lListSoll (), gOLEWriter )
105 ListAppend ( lListSoll (), gOLEChart )
106 ListAppend ( lListSoll (), gOLEMath )
107 case "IMPRESS" : ListAppend ( lListSoll (), gOLECalc )
108 ListAppend ( lListSoll (), gOLEDraw )
109 ListAppend ( lListSoll (), gOLEWriter )
110 ListAppend ( lListSoll (), gOLEChart )
111 ListAppend ( lListSoll (), gOLEMath )
112 case "MASTERDOCUMENT" : ListAppend ( lListSoll (), gOLECalc )
113 ListAppend ( lListSoll (), gOLEImpress )
114 ListAppend ( lListSoll (), gOLEDraw )
115 ListAppend ( lListSoll (), gOLEChart )
116 ListAppend ( lListSoll (), gOLEMath )
119 if ( gPlatgroup = "w95" ) then
120 ListAppend ( lListSoll (), gOLEOthers )
123 ListSort ( lListSoll () )
124 sCount = ListCount ( lListSoll () )
126 if iCount <> sCount then
127 Warnlog "Expected: " + sCount + " Found: " + iCount
130 if lListe (j) <> lListSoll (j) then
131 Warnlog "Expected: '" + lListSoll (j) + "' Found: '" + lListe (j) +"'"
136 '///+cancel the dialog
137 OLEObjektEinfuegen.Cancel
138 '///+close the document and repeat it for each application