Tag: cws_dev300_dba31c User: fs Date: 2008-09-12 19:24:19+0000 Modified: dba/dbaccess/source/ui/app/AppControllerGen.cxx
Log: XDatabaseDocumentUI::connect now throwing, not displaying the error in a message box File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppControllerGen.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerGen.cxx?r1=1.37.38.2&r2=1.37.38.3 Delta lines: +14 -7 -------------------- --- AppControllerGen.cxx 2008-09-11 07:09:50+0000 1.37.38.2 +++ AppControllerGen.cxx 2008-09-12 19:24:17+0000 1.37.38.3 @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: AppControllerGen.cxx,v $ - * $Revision: 1.37.38.2 $ + * $Revision: 1.37.38.3 $ * * This file is part of OpenOffice.org. * @@ -383,13 +383,20 @@ } // ----------------------------------------------------------------------------- -::sal_Bool SAL_CALL OApplicationController::connect( ) throw (RuntimeException) +void SAL_CALL OApplicationController::connect( ) throw (SQLException, RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ::osl::MutexGuard aGuard( getMutex() ); - - ensureConnection(); - return isConnected(); + SQLExceptionInfo aError; + SharedConnection xConnection = ensureConnection( &aError ); + if ( !xConnection.is() ) + { + if ( aError.isValid() ) + aError.doThrow(); + + // no particular error, but nonetheless could not connect -> throw a generic exception + String sConnectingContext( ModuleRes( STR_COULDNOTCONNECT_DATASOURCE ) ); + sConnectingContext.SearchAndReplaceAscii( "$name$", getStrippedDatabaseName() ); + ::dbtools::throwGenericSQLException( sConnectingContext, *this ); + } } // ----------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]