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: ch2_ole.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 14:27:01 $
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 : oliver.craemer@sun.com
36 '* short description : Chart resource test - section FILE
38 '************************************************************************
42 '\************************************************************************
44 testcase tChartOLE ( sCurrentApplication as STRING )
45 '///<u><b>Chart as OLE in all applicable applications</b></u>
46 dim sOutputFile as STRING
47 dim bCommitDialog as boolean
48 dim bStatusOfAgent as boolean
50 bStatusOfAgent = FALSE
52 select case sCurrentApplication
53 case ("CALC") : bCommitDialog = TRUE
54 case else : bCommitDialog = FALSE
56 printlog("Chart as OLE in " & sCurrentApplication)
57 gApplication = sCurrentApplication
59 '/// Open new document
61 '/// Disabling the Help Agent if enabled.
63 hToolsOptions ( "StarOffice", "General" )
64 Kontext "TabSonstigesAllgemein"
65 if Aktivieren.IsChecked then
67 printlog "HelpAgent was enabled. Disabling"
70 printlog "HelpAgent wasn't enabled."
72 Kontext "ToolsOptionsDlg"
74 '/// Insert default chart
83 select case ucase(sCurrentApplication)
84 case ("CALC") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".ods" )
85 case ("IMPRESS") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odp" )
86 case ("DRAW") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odg" )
87 case ("WRITER") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odt" )
88 case ("MASTERDOCUMENT") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".odm" )
89 case ("HTML") : sOutputFile = ( gOfficePath & ConvertPath("user\work\") & "tChartOLE_" & sCurrentApplication & ".html" )
90 case else : warnlog "The modul " & sCurrentApplication & " is not supported in this test case!"
94 if hFileSaveAsKill(sOutputFile) then
95 printlog "OK, successfully saved the test document!"
97 warnlog "Saving the test document failed!"
100 '/// Leave implace mode in Spreadsheet, Draw and Impress ...
101 '/// ... and then select Chart OLE (Green handles)
102 select case ucase(sCurrentApplication)
103 case ("CALC") : Kontext "DocumentCalc"
104 DocumentCalc.TypeKeys "<Escape>"
106 case ("IMPRESS") : call gMouseclick (99,99)
107 call gMouseclick (50,50)
108 case ("DRAW") : call gMouseclick (99,99)
109 call gMouseclick (50,50)
110 case ("WRITER") : call gMouseclick (99,99)
111 call gMouseclick (50,50)
113 case ("MASTERDOCUMENT") : call gMouseclick (99,99)
114 case ("HTML") : call gMouseclick (99,99)
115 call gMouseclick (50,50)
117 case else : warnlog "The modul " & sCurrentApplication & " is not supported in this test case!"
121 '/// Try if Edit::Object:Edit works for chart OLE
125 printlog "Edit::Object::Edit seems to work"
127 warnlog "Edit::Object::Edit seems to fail."
130 if bStatusOfAgent then
131 '/// Enabling the HelpAgent if it was enabled at the beginning.
133 hToolsOptions ( "StarOffice", "General" )
134 Kontext "TabSonstigesAllgemein"
136 Kontext "ToolsOptionsDlg"
141 gApplication = "CALC"