'encoding UTF-8 Do not remove or change this line! '************************************************************************* ' ' Licensed to the Apache Software Foundation (ASF) under one ' or more contributor license agreements. See the NOTICE file ' distributed with this work for additional information ' regarding copyright ownership. The ASF licenses this file ' to you under the Apache License, Version 2.0 (the ' "License"); you may not use this file except in compliance ' with the License. You may obtain a copy of the License at ' ' http://www.apache.org/licenses/LICENSE-2.0 ' ' Unless required by applicable law or agreed to in writing, ' software distributed under the License is distributed on an ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ' KIND, either express or implied. See the License for the ' specific language governing permissions and limitations ' under the License. ' '************************************************************************* '* '* short description : XML Writer Include File '* '\*********************************************************************************** Dim Isliste(250) as string Dim OutputPath as string Dim iSecurityBefore as integer sub sxw7_03 printlog "-------------------------- SXW7_03.INC ------------------------------" call hEnablePrettyPrinting call thyperlinks call hEnablePrettyPrinting(1) call tindexes_alpha call tindex_biblio call tindex_most call tpages call tparagraph01 call tparagraph02 call tsection_main printlog "------------------------ Macros and Events --------------------------" iSecurityBefore = "" iSecurityBefore = hSetMacroSecurity(1) call tEventsToObjects call hSetMacroSecurity(iSecurityBefore) end sub '------------------------------------------------------------------------- testcase thyperlinks Dim Searchstring(9) as string Dim i as integer Dim AdditionalParameter as string printlog "+- hyperlinks.sdw" call hFileOpen (gTesttoolPath & ConvertPath("xml\optional\input\writer\hyperlinks.sdw")) if hFileSaveAsWithFilterKill (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks.sxw") , "StarOffice XML (Writer)") then '/// Closing the document also if there is a verification dialog. call hCloseDocument() sleep(3) UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks.sxw") , gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks") ) if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if if XMLWellFormed (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" else call hFileOpen (gOfficePath & ConvertPath("user\work\xml\writer\level1\hyperlinks.sxw")) sleep(2) call hCloseDocument sleep(2) ' ----------------------- ' T E X T - S T Y L E S ' ----------------------- ' Www.sun.com '------------------------------------------------------------------------- Searchstring(1) = "jump '------------------------------------------------------------------------- Searchstring(1) = "target here '------------------------------------------------------------------------- Searchstring(1) = " OpenOffice.org/Security '/// Click on the macro security button '/// Set the medium security level try if iSecurityBefore = "" then QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!" goto endsub end if catch 'if variable iSecurityBefore is not initialized and causes into an error QAErrorLog cWhereCalled & "Macro security level needs to be set before to 1 (medium)!" goto endsub endcatch '/// Load (binary) document under ...qa/qatesttool/xml/update/input/writer/events_to_objects.sdw. hFileOpen( sdw_file ) if ( NOT hAllowMacroExecution() ) then warnlog "#i80769# Macros not being loaded. Exiting test case." call hCloseDocument goto endsub end if '/// Save as StarOffice XML fileformat (.sxw). if ( hFileSaveAsWithFilterKill ( sxw_file , "StarOffice XML (Writer)" ) ) then '/// Closing the document also if there is a verification dialog. 'call hCloseDocument() hCloseDocument() 'sleep(3) '/// Close window with the document. UnpackStorage( gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects.sxw") , _ gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects") ) '/// Uncompressing .sxw files in directory
../user/work/events_to_objects/
. if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects\meta.xml")) = FALSE then warnlog "XML-file 'meta.xml' not well formed!" end if '///+Verify that XML files (styles.xml, meta.xml and content.xml) are well formed. if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects\styles.xml")) = FALSE then warnlog "XML-file 'styles.xml' not well formed!" end if if XMLWellformed (gOfficePath & ConvertPath("user\work\xml\writer\level1\events_to_objects\content.xml")) = FALSE then warnlog "XML-file 'content.xml' not well formed!" '/// If well formness is okay, load exported document. else hFileOpen( sdw_file ) hAllowMacroExecution() Kontext "DocumentWriter" DocumentWriter.TypeKeys "" , TRUE '/// Select first graphic with <SHIFT><F4> '///+ and a messagebox should be displayed. '///+ Press <RETURN> key. '///four times '///+
  1. Press <TAB> key to select the next object.
  2. and a messagebox should be displayed.
  3. Press <RETURN> key.
for l = 1 to 4 Kontext "Messagebox" if Messagebox.Exists(2) then if Messagebox.GetRT = 304 then Messagebox.OK end if else if l = 1 then warnlog "Event on Graphic failed! No Message Box occured!" end if if l = 2 then warnlog "Event on OLE object failed! No Message Box occured!" end if if l = 3 then warnlog "Event on text frame object failed! No Message Box occured!" end if if l = 4 then warnlog "Event on text frame object (frame style applied) failed! No Message Box occured!" end if end if if l <> 4 then Kontext "DocumentWriter" DocumentWriter.TypeKeys "" end if next l '/// Close document. call hCloseDocument sleep(2) 'TODO: Search for the events in source. end if else call hCloseDocument end if endcase