summaryrefslogtreecommitdiff
path: root/automation
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-08-19 11:46:53 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-08-19 11:46:53 +0000
commitd38143393f1d69dcb90a6fc1cbf35bfebdcca150 (patch)
tree4da367f65144102fd21193788de1728e9b9dd820 /automation
parentaffd865c0c169be7448349133b155d4bc6eaf3b9 (diff)
INTEGRATION: CWS gh15 (1.39.4); FILE MERGED
2008/08/07 15:47:56 gh 1.39.4.1: #i86540# call BASIC sub 'startTheOffice' if available on automatic restart of the office
Diffstat (limited to 'automation')
-rw-r--r--automation/source/testtool/objtest.cxx25
1 files changed, 18 insertions, 7 deletions
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx
index 383d472a7269..9ec57698187d 100644
--- a/automation/source/testtool/objtest.cxx
+++ b/automation/source/testtool/objtest.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: objtest.cxx,v $
- * $Revision: 1.39 $
+ * $Revision: 1.40 $
*
* This file is part of OpenOffice.org.
*
@@ -1335,18 +1335,29 @@ void TestToolObj::SendViaSocket()
}
if ( !pCommunicationManager->IsCommunicationRunning() )
- if ( !pCommunicationManager->StartCommunication( ProgPath, pImpl->ProgParam, pImpl->pChildEnv ) )
+ {
+ // first try to run basic sub "startTheOffice" see i86540
+ SbxVariable* pMeth = pImpl->pMyBasic->Find( CUniString( "startTheOffice" ), SbxCLASS_DONTCARE);
+ if( !pImpl->bIsStart && pMeth && pMeth->ISA(SbxMethod) )
{
- ADD_ERROR(ERR_RESTART_FAIL,GEN_RES_STR1(S_APPLICATION_START_FAILED, ProgPath));
+ pImpl->pMyBasic->Call( CUniString( "startTheOffice" ) );
}
else
{
- if ( !pImpl->bIsStart )
+ pImpl->pMyBasic->ResetError(); // reset error produced by failed Find above
+ if ( !pCommunicationManager->StartCommunication( ProgPath, pImpl->ProgParam, pImpl->pChildEnv ) )
+ {
+ ADD_ERROR(ERR_RESTART_FAIL,GEN_RES_STR1(S_APPLICATION_START_FAILED, ProgPath));
+ }
+ else
{
- ADD_ERROR(ERR_RESTART,GEN_RES_STR0(S_APPLICATION_RESTARTED));
+ if ( !pImpl->bIsStart )
+ {
+ ADD_ERROR(ERR_RESTART,GEN_RES_STR0(S_APPLICATION_RESTARTED));
+ }
}
}
-
+ }
bReturnOK = FALSE;
if ( pCommunicationManager->GetLastNewLink() )
@@ -2921,7 +2932,7 @@ SbxVariable* TestToolObj::Find( const String& aStr, SbxClassType aType)
String TestToolObj::GetRevision( String const &aSourceIn )
{
- // search $Revision: 1.39 $
+ // search $Revision: 1.40 $
xub_StrLen nPos;
if ( ( nPos = aSourceIn.SearchAscii( "$Revision:" ) ) != STRING_NOTFOUND )
return aSourceIn.Copy( nPos+ 10, aSourceIn.SearchAscii( "$", nPos+10 ) -nPos-10);