Commits

Joerg Skottke [jsk]  committed a25f033

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.

  • Participants
  • Parent commits 27ae434

Comments (0)

Files changed (1)

File testautomation/framework/required/includes/script_organizers.inc

     dim iCurrentDialog as integer
 
     dim iDiffCount as integer
+    dim max_diffcount as integer
 
     hInitSingleDoc()
 
         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() )
+        iDiffCount = abs( hManageComparisionList( sFileIn, sFileOut, cScriptNamesList() ) )
 
-        if ( iDiffCount <> 0 ) then warnlog( "The number of scripts has changed, please review." )
-
+        ' 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 )