From 8e1ca18f2b942397a12d50aeed2448ee859901fe Mon Sep 17 00:00:00 2001 From: "Joerg Skottke [jsk]" Date: Thu, 14 Oct 2010 08:09:38 +0200 Subject: automationooo330m9: #i115026 - Fuzzy list matching to avoid warnings if the office is installed in some special - non standard - way. As we have no standard, this applies to all installations. --- .../framework/required/includes/script_organizers.inc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/testautomation/framework/required/includes/script_organizers.inc b/testautomation/framework/required/includes/script_organizers.inc index b9ed8420134e..3a70c8051808 100755 --- a/testautomation/framework/required/includes/script_organizers.inc +++ b/testautomation/framework/required/includes/script_organizers.inc @@ -78,6 +78,7 @@ testcase tUpdtScripts dim iCurrentDialog as integer dim iDiffCount as integer + dim max_diffcount as integer hInitSingleDoc() @@ -109,25 +110,33 @@ testcase tUpdtScripts case DLG_JAVASCRIPT: ToolsMacrosOrganizeMacrosJavaScript kontext "ScriptOrganizer" hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + max_diffcount = 0 case DLG_BEANSHELL: ToolsMacrosOrganizeMacrosBeanShell kontext "ScriptOrganizer" hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + max_diffcount = 0 case DLG_PYTHON: ToolsMacrosOrganizeMacrosPython kontext "ScriptOrganizer" hGetAllNodeNames( ScriptTreeList, cScriptNamesList() ) + max_diffcount = 0 case DLG_BASIC_ORG: ToolsMacro_uno Kontext "Makro" hGetScriptNames( MakroAus, MakroListe, cScriptNamesList() ) + max_diffcount = 6 case DLG_RUN_MACRO: ToolsMacrosRunMacro kontext "ScriptSelector" hGetScriptNames( LibraryTreeList, ScriptList, cScriptNamesList() ) + max_diffcount = 6 end select printlog( "Compare to reference list, create new one if differences were found" ) - iDiffCount = hManageComparisionList( sFileIn, sFileOut, cScriptNamesList() ) - - if ( iDiffCount <> 0 ) then warnlog( "The number of scripts has changed, please review." ) + iDiffCount = abs( hManageComparisionList( sFileIn, sFileOut, cScriptNamesList() ) ) + ' Usually we should have 0 differences in the list. However, as we do not have + ' a unique way of installing the office (Root-Installation, archives and + ' others) we need a little tolerance here. If a number of bundled extensions + ' are installed, we have more scripts. + if ( iDiffCount > max_diffcount ) then warnlog( "The number of scripts has changed, please review." ) printlog( "Close <" & sDialog & ">" ) select case ( sDialog ) -- cgit