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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : oliver.craemer@oracle.com
30 '* short description : Chart resource test - section FILE
32 '************************************************************************
36 '\************************************************************************
38 testcase tChartOLE ( sCurrentApplication as STRING )
39 '///<u><b>Chart as OLE in all applicable applications</b></u>
40 dim sOutputFile as STRING
41 dim bCommitDialog as boolean
42 dim bStatusOfAgent as boolean
44 bStatusOfAgent = FALSE
46 select case sCurrentApplication
47 case ("CALC") : bCommitDialog = TRUE
48 case else : bCommitDialog = FALSE
50 printlog("Chart as OLE in " & sCurrentApplication)
51 gApplication = sCurrentApplication
53 '/// Open new document
55 '/// Disabling the Help Agent if enabled.
57 hToolsOptions ( "StarOffice", "General" )
58 Kontext "TabSonstigesAllgemein"
59 if Aktivieren.IsChecked then
61 printlog "HelpAgent was enabled. Disabling"
64 printlog "HelpAgent wasn't enabled."
66 Kontext "ToolsOptionsDlg"
68 '/// Insert default chart
77 select case ucase(sCurrentApplication)
78 case ("CALC") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".ods" )
79 case ("IMPRESS") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odp" )
80 case ("DRAW") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odg" )
81 case ("WRITER") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odt" )
82 case ("MASTERDOCUMENT") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odm" )
83 case ("HTML") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".html" )
84 case else : warnlog "The modul " & sCurrentApplication & " is not supported in this test case!"
88 if hFileSaveAsKill(sOutputFile) then
89 printlog "OK, successfully saved the test document!"
91 warnlog "Saving the test document failed!"
94 '/// Leave implace mode in Spreadsheet, Draw and Impress ...
95 '/// ... and then select Chart OLE (Green handles)
96 select case ucase(sCurrentApplication)
97 case ("CALC") : Kontext "DocumentCalc"
98 DocumentCalc.TypeKeys "<Escape>"
100 case ("IMPRESS") : call gMouseclick (99,99)
101 call gMouseclick (50,50)
102 case ("DRAW") : call gMouseclick (99,99)
103 call gMouseclick (50,50)
104 case ("WRITER") : call gMouseclick (99,99)
105 call gMouseclick (50,50)
107 case ("MASTERDOCUMENT") : call gMouseclick (99,99)
108 case ("HTML") : call gMouseclick (99,99)
109 call gMouseclick (50,50)
111 case else : warnlog "The modul " & sCurrentApplication & " is not supported in this test case!"
115 '/// Try if Edit::Object:Edit works for chart OLE
119 printlog "Edit::Object::Edit seems to work"
121 warnlog "Edit::Object::Edit seems to fail."
124 if bStatusOfAgent then
125 '/// Enabling the HelpAgent if it was enabled at the beginning.
127 hToolsOptions ( "StarOffice", "General" )
128 Kontext "TabSonstigesAllgemein"
130 Kontext "ToolsOptionsDlg"
135 gApplication = "CALC"