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
'///+- Press <TAB> key to select the next object.
- and a messagebox should be displayed.
- 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