diff options
Diffstat (limited to 'testautomation/global/tools/includes/required/t_doc2.inc')
-rw-r--r--[-rwxr-xr-x] | testautomation/global/tools/includes/required/t_doc2.inc | 129 |
1 files changed, 0 insertions, 129 deletions
diff --git a/testautomation/global/tools/includes/required/t_doc2.inc b/testautomation/global/tools/includes/required/t_doc2.inc index 4192563b0eba..0e9af93f287c 100755..100644 --- a/testautomation/global/tools/includes/required/t_doc2.inc +++ b/testautomation/global/tools/includes/required/t_doc2.inc @@ -113,135 +113,6 @@ end sub ' '------------------------------------------------------------------------------- ' -function hEnableDocumentEditMode() as boolean - - hEnableDocumentEditMode() = false - - dim iTry as integer - - printlog( "Try to switch document to edit mode" ) - for iTry = 1 to 20 - try - kontext "Standardbar" - if ( Bearbeiten.getState( 2 ) <> 1 ) then - Bearbeiten.click() - - kontext "Active" - if ( Active.exists( 1 ) ) then - printlog( "Handle <Use copy message>" ) - hCloseDialog( Active, "yes" ) - wait( 2000 ) - printlog( "Successfully switched to edit mode" ) - hEnableDocumentEditMode() = true - exit for - endif - endif - catch - wait( 200 ) - endcatch - next iTry - -end function - -'******************************************************************************* - -function sMakeReadOnlyDocumentEditable() as boolean - - sMakeReadOnlyDocumentEditable() = hEnableDocumentEditMode() - exit function - - ' Function returns TRUE if document has been made editable and FALSE if - ' no action was required (that is: Document was not read-only) - - dim iTry as integer - dim iWait as integer - dim rc as integer - const CFN = "sMakeReadOnlyDocumentEditable::" - - if ( GVERBOSE ) then printlog( CFN & "Making document editable (create a copy) if it is readonly" ) - - ' We still run into synchronization problems with the "Make document editable" feature - ' because we do not know when this button becomes available and ready for use: The - ' document has to be loaded, then we have to wait for the toolbar to get populated. - ' One thing appears to work though: Try to execute the slot using hUseAsyncSlot. - ' This is a little bit tricky because the state of the document is altered but if - ' the slot has been executed once we know for sure that the button on the toolbar is - ' available and can check its state and - if need be - chenge the document state back. - - ' ========== Workaround begin ========== - hUseAsyncSlot( "EditDoc" ) - kontext "Active" - if ( Active.exists() ) then - if ( GVERBOSE ) then printlog( "Handling create copy message" ) - Active.yes() - wait( 1000 ) - endif - ' ========== Workaround end ========== - Kontext "Standardbar" - iWait = 0 - Do - if ( Bearbeiten.IsEnabled() ) then - try - if Bearbeiten.getState( 2 ) = 0 then - exit do - endif - catch - if ( GVERBOSE ) then printlog "Attempt " & iWait & " to make document readable failed" - iWait = iWait + 1 - wait ( 1000 ) - endcatch - else - if ( GVERBOSE ) then printlog "Attempt " & iWait & " to make document readable failed" - iWait = iWait + 1 - wait ( 1000 ) - end if - if iWait >= 5 then exit do - Loop - - if ( Bearbeiten.IsEnabled() ) then - - if ( Bearbeiten.getState( 2 ) = 0 ) then - - rc = hUseAsyncSlot("editdoc") - - if ( rc >= 0 ) then - for iTry = 1 to 2 - - - Kontext "Active" - if ( Active.exists( 5 ) ) then - - printlog( CFN & "Messagebox: " & Active.getText() ) - - try - if ( GVERBOSE ) then printlog( CFN & "Document was read-only. A copy will be used." ) - Active.Yes() - if ( GVERBOSE ) then printlog( CFN & "Closed 'use copy' message" ) - catch - if ( GVERBOSE ) then printlog( CFN & "Probing for unexpected messagebox..." ) - active.ok() - qaerrorlog( "#i100701 - Object not found message" ) - endcatch - else - printlog( CFN & "No messagebox informing about a copy being used" ) - endif - sMakeReadOnlyDocumentEditable() = TRUE - next iTry - else - printlog( CFN & "Document appears to be editable" ) - endif - else - if ( GVERBOSE ) then printlog( CFN & "Button <Bearbeiten> is pressed, document is editable" ) - sMakeReadOnlyDocumentEditable() = FALSE - endif - else - if ( GVERBOSE ) then printlog( CFN & "Control <Bearbeiten> is not enabled" ) - endif - -end function -' -'------------------------------------------------------------------------------- -' function fSelectFirstOLE() as integer 'Select first visible OLE object using Navigator 'Returns error-code: |