'encoding UTF-8 Do not remove or change this line! '************************************************************************** * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 * only, as published by the Free Software Foundation. * * OpenOffice.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details * (a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see * * for a copy of the LGPLv3 License. * '/************************************************************************ '* '* owner : joerg.skottke@sun.com '* '* short description : Macros with all security-levels '* '\****************************************************************************** sub tMacroSecurityLevelsControlModule dim iApplication as integer for iApplication = 1 to 6 printlog( "" ) printlog( hNumericDocType( iApplication ) ) call tMacroSecurityLevels( "current" ) call tMacroSecurityLevels( "645" ) next iApplication end sub '******************************************************************************* testcase tMacroSecurityLevels( cFileFormat ) printlog( "Check macro execution behavior for all macro security levels" ) dim cWorkFile as string cWorkFile = gTesttoolPath & "framework\optional\input\BasicDocs\" cWorkFile = cWorkFile & "basic" & hGetSuffix( cFileFormat ) cWorkFile = convertpath( cWorkFile ) cWorkFile = convertToURL( cWorkFile ) dim iSecLevel as integer dim brc as boolean ' We have quite a bunch of possible combinations here. Some trigger a security warning ' others do not. Depending on the security level we either get no warning at all, the ' "classic" Security Warning or a message that the macros will not be executed (Blocked) ' |---------------------------------------------------------| ' | Trusted | Security Level / Warning displayed | ' | Path | Low | Medium | High | Very High | ' |---------------------------------------------------------| ' | Yes*) | No | No | No | No | ' |---------------------------------------------------------| ' | No | No | Yes | Blocked | Blocked | ' |---------------------------------------------------------| ' *) Covered by test "f_sec_trusted_path.bas" printlog( "Load a document with macro for each of the four security levels" ) for iSecLevel = 0 to 3 printlog( "Set macro security level to " & iSecLevel ) hSetMacroSecurityAPI( iSecLevel ) printlog( "Load document..." ) hFileOpen( cWorkFile ) printlog( "Check security level dependent behavior" ) select case iSecLevel case 0 : brc = hIdentifyExecutedMacro() if ( not brc ) then if ( gApplication = "MATH" ) then qaerrorlog( "#i68291# Math document forgets eventbinding" ) else warnlog( "#i53711# Macro was not found/executed" ) endif endif case 1 : brc = hAllowMacroExecution() if ( not brc ) then warnlog( "Macro execution warning missing, chek the file/security settings" ) endif brc = hIdentifyExecutedMacro() if ( not brc ) then if ( gApplication = "MATH" ) then qaerrorlog( "#i68291# Math document forgets eventbinding" ) else warnlog( "#i53711# Macro was not found/executed" ) endif endif case 2 : brc = hHandleActivesOnLoad( 1 , 1 ) if ( not brc ) then qaerrorlog( "#i53710# unexpected second messagebox" ) endif brc = hIdentifyExecutedMacro() if ( brc ) then warnlog( "Macro was executed" ) endif case 3 : brc = hHandleActivesOnLoad( 1 , 0 ) brc = hIdentifyExecutedMacro() if ( brc ) then warnlog( "Macro was executed" ) endif end select printlog( "Close document" ) brc = hDestroyDocument() next iSecLevel printlog( "Reset security level to default" ) hSetMacroSecurityAPI( GC_MACRO_SECURITY_LEVEL_DEFAULT ) endcase '******************************************************************************* function hIdentifyExecutedMacro() as boolean dim cMessage as string const CFN = "hIdentifyExecutedMacro::" sleep( 1 ) kontext "active" if ( active.exists( 3 ) ) then cMessage = active.getText() if ( cMessage = "TTMacro3" ) then printlog( CFN & "The Macro has been executed" ) hIdentifyExecutedMacro() = true active.ok() else warnlog( CFN & "The WRONG macro/dialog is open" ) hIdentifyExecutedMacro() = false hHandleActivesOnLoad( 0 , 2 ) endif else printlog( CFN & "No macro/dialog is open" ) hIdentifyExecutedMacro() = false endif end function ue='distro/lhm/libreoffice-7-4+backports'>distro/lhm/libreoffice-7-4+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/soltools
AgeCommit message (Expand)Author
2016-06-23tdf#99589 - tolower / toupper - dangerous to Turks ...Gökhan Gurbetoğlu
2016-04-10Drop redundant parenthesis.Pedro Giffuni
2016-03-10Avoid reserved identifierStephan Bergmann
2016-03-10Avoid reserved identifiersStephan Bergmann
2016-03-04-Werror,-WundefStephan Bergmann
2016-03-04-Werror,-Wunused-macrosStephan Bergmann
2016-02-23new loplugin: commaoperatorNoel Grandin
2016-02-17use consistent #define checks for the Windows platformNoel Grandin
2016-02-16use consistent #define checks for the Windows platformNoel Grandin
2016-01-26-Werror,-Wunused-parameter (clang-cl)Stephan Bergmann
2016-01-10Fix typosAndrea Gelmini
2015-11-23loplugin:unusedfields in soltools/Noel Grandin
2015-11-10loplugin:nullptr (automatic rewrite; Mac-specific code)Stephan Bergmann
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
2015-10-02loplugin:unusedmethodsNoel Grandin
2015-09-30Fix typosAndrea Gelmini
2015-07-04Fix typosAndrea Gelmini
2015-06-16-fsanitize=nonnull-attributeStephan Bergmann
2015-04-02loplugin:staticmethodsNoel Grandin
2015-03-02V804: Decreased performanceCaolán McNamara
2015-02-23remove unnecessary parenthesis in return statementsNoel Grandin
2015-01-08brute-force find-and-remove of unused #define constants.Noel Grandin
2014-12-09warning C4267: conversion from 'size_t' to 'int' (MSVC 64-bit)Stephan Bergmann
2014-12-09warning C4267: conversion from 'size_t' to 'int' (MSVC 64-bit)Stephan Bergmann
2014-11-06coverity#1000834 Use of untrusted string valueCaolán McNamara
2014-10-28coverity#982185 silence Unchecked return value from libraryCaolán McNamara
2014-10-04coverity#706158 Copy into fixed size bufferNorbert Thiebaud
2014-10-02coverity#1233618 Overlapping buffer in memory copyCaolán McNamara
2014-09-04coverity#1019334 Explicit null dereferencedCaolán McNamara
2014-06-24mkdepend: cleanup indentation and function declarationsNoel Grandin
2014-06-24remove use of register keyword in C filesNoel Grandin
2014-06-17-Wstrict-prototypesStephan Bergmann
2014-05-30coverity#705235 Missing break in switchCaolán McNamara
2014-05-30coverity#705236 Missing break in switchCaolán McNamara
2014-05-30coverity#705237 Missing break in switchCaolán McNamara
2014-05-27Remove unnecessary semicolonsPeter Senna Tschudin
2014-05-24coverity#982647 Missing break in switchCaolán McNamara
2014-05-22Fix some memory leak in soltools/cpp toolStephan Bergmann
2014-05-15Resolves fdo#70681: fixincludeguards.pl: all that's leftThomas Arnhold
2014-04-10Clean up function declarationStephan Bergmann
2014-04-04Move prototype to includeStephan Bergmann
2014-03-31Typo #elsif -> #elifStephan Bergmann
2013-11-17WaE: 'PATH_MAX' : macro redefinitionTor Lillqvist
2013-11-16Fix for VS 2013 compilationJesús Corrius
2013-08-30WaE: size_t/unsigned int: possible loss of dataTor Lillqvist
2013-08-22left shift of 1 by 31 places cannot be represented in type 'int'Stephan Bergmann
2013-08-21We don't seem to actually need glibc getoptTor Lillqvist
2013-07-14Mark as constTakeshi Abe