Commits

sko...@wintermute  committed 3cf283d

#i106016# - refactor

  • Participants
  • Parent commits 39508b7

Comments (0)

Files changed (1)

File testautomation/framework/tools/includes/fileoperations.inc

     '///<ul>
     
     dim brc as boolean
-    dim cFileExt as string
-        cFileExt = cFile & hGetSuffix( "current" )
+    dim cFileExt as string : cFileExt = cFile & hGetSuffix( "current" )
     
     const CFN = "hSaveLoadDelSuccess::"
     
     '///<u>Description</u>:
     '///<ul>
     
-    dim brc as boolean
-        brc = true
+    dim brc as boolean : brc = true
         
     const CFN = "hLoadFileExpectSuccess::"
     printlog( CFN & "Enter with option: " & fpath )
 
     '///+<li>Click FileOpen (or use the menu)</li>
-    FileOpen    
+    hUseAsyncSlot( "FileOpen" )
 
     '///+<li>Enter the filename (with extension)</li>
     'printlog( " - Type the filepath/name into the entryfield" )
     
     const CFN = "hLoadFileExpectFailure::"
 
-    dim brc as boolean
-        brc = true
+    dim brc as boolean : brc = true
 
     printlog( CFN & "Enter with option: " & fpath )
 
     '///+<li>Click FileOpen</li>
-    FileOpen    
+    hUseAsyncSlot( "FileOpen" )
     Kontext "OeffnenDLG"
 
     '///+<li>Enter filepath</li>
     '///<ul>
 
     const CFN = "hSaveFileExpectSuccess::" 
-    dim brc as boolean
-        brc = true
+    dim brc as boolean : brc = true
         
     dim iDocumentCount as integer
     
     printlog( CFN & "Enter with options: " & fpath & ", " & bReplace )
 
     '///+<li>Make sure we start from the backing window</li>
-    do while ( getDocumentCount > 0 )
-        hCloseDocument()
-    loop
+    hFileCloseAll()
 
 
     '///+<li>Open a new document</li>
     hCreateDocument()
 
     '///+<li>Click &quot;Save As...&quot;</li>
-    FileSaveAs 
+    hUseAsyncSlot( "FileSaveAs" )
 
     Kontext "SpeichernDlg"
     if ( SpeichernDlg.exists( 1 ) ) then
     ' This sequence tries to save a document with an invalid name. The errormsg
     ' is closed, the filedialog cancelled and the file closed. 
     
-    dim brc as boolean
-        brc = false
+    dim brc as boolean : brc = false
         
     dim cMsg as string
         
     '///+<li>Click &quot;Save As;&quot;</li>
     printlog( "" )
     printlog( CFN & "Enter with options: " & fpath & ", " & errortype )
-    FileSaveAs
+    hUseAsyncSlot( "FileSaveAs" )
     
     '///+<li>Enter the filename</li>
     kontext "SpeichernDlg"
     '///<u>Description</u>:
     '///<ul>
     
-    dim brc as boolean
-        brc = true
+    dim brc as boolean : brc = true
         
     const CFN = "hCreateDirectoryExpectSuccess::"
     printlog( CFN & "Enter with option: " & dirname )
 
     '///+<li>Click &quot;File Open&quot;</li>
-    FileOpen    
+    hUseAsyncSlot( "FileOpen" )
 
     '///+<li>Click on &quot;New folder&quot;</li>
     Kontext "OeffnenDlg"
     endif    
 
     '///+<li>Click &quot;File Open&quot;</li>
-    FileOpen
+    hUseAsyncSlot( "FileOpen" )
     
     '///+<li>Look for the requested file, get the position from the filelist</li>
     Kontext "OeffnenDLG"
     '///<ul>
     
     '///+<li>Click &quot;File open&quot;</li>
-    FileOpen
+    hUseAsyncSlot( "FileOpen" )
     
     '///+<li>Retrieve the number of items in the filepicker window</li>
     Kontext "OeffnenDLG"
-    hGetFileCountViaFileOpen() = DateiAuswahl.getItemCount()
-    
-    '///+<li>Close &quot;File Open&quot;</li>
-    OeffnenDLG.cancel()
+    if ( OeffnenDlg.exists( 2 ) ) then
+        hGetFileCountViaFileOpen() = DateiAuswahl.getItemCount()
+        OeffnenDLG.cancel()
+    else
+        hGetFileCountViaFileOpen() = -1
+    endif
     '///</ul>    
 
 end function
     dim iCurrentObject as integer
     dim cCurrentName as string
     dim iFileOpenItemCount as integer
-    dim iPos as integer
-        iPos = 0
-    dim cPath as string
-        cPath = cName
+    
+    dim iPos as integer : iPos = 0
+    dim cPath as string : cPath = cName
 
     dim iPathItems as integer
     dim asPathList( 100 ) as string