diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2005-03-10 15:58:53 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2005-03-10 15:58:53 +0000 |
commit | 4f2d347f071b5788e161cde4c0ee02ba30d04836 (patch) | |
tree | 67bd031d2f1be017e9286cd345bda9e1fd4e013a /extensions/source/dbpilots/commonpagesdbp.cxx | |
parent | 5704b205e27c32a1d8ddcc95863c56c341fa8323 (diff) |
INTEGRATION: CWS dba24 (1.10.28); FILE MERGED
2005/02/04 10:11:30 oj 1.10.28.1: #i41961# first use the embedded connection instead of trying to set a new one
Diffstat (limited to 'extensions/source/dbpilots/commonpagesdbp.cxx')
-rw-r--r-- | extensions/source/dbpilots/commonpagesdbp.cxx | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 7500a7ded261..89cfc31b275e 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: commonpagesdbp.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: obo $ $Date: 2005-01-05 12:42:15 $ + * last change: $Author: vg $ $Date: 2005-03-10 16:58:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -341,21 +341,6 @@ namespace dbp m_aTable.Clear(); WaitObject aWaitCursor(this); - // get the default SDB interaction handler - Reference< XMultiServiceFactory > xORB = getServiceFactory(); - Reference< XInteractionHandler > xHandler; - const ::rtl::OUString sInteractionHandlerServiceName = ::rtl::OUString::createFromAscii("com.sun.star.sdb.InteractionHandler"); - try - { - if (xORB.is()) - xHandler = Reference< XInteractionHandler >(xORB->createInstance(sInteractionHandlerServiceName), UNO_QUERY); - } - catch(Exception&) { } - if (!xHandler.is() && xORB.is()) - { - ShowServiceNotAvailableError(this, sInteractionHandlerServiceName, sal_True); - return; - } // will be the table tables of the selected data source Sequence< ::rtl::OUString > aTableNames; @@ -385,6 +370,10 @@ namespace dbp if (m_xDSContext->getByName(sCurrentDatasource) >>= xDatasource) { // connect + // get the default SDB interaction handler + Reference< XInteractionHandler > xHandler = getDialog()->getInteractionHandler(this); + if (!xHandler.is() ) + return; xConn = xDatasource->connectWithCompletion(xHandler); setFormConnection( xConn ); } @@ -423,8 +412,6 @@ namespace dbp if ( xQueries.is() ) aQueryNames = xQueries->getElementNames(); } - - setFormConnection( xConn ); } catch(SQLContext& e) { aSQLException <<= e; } catch(SQLWarning& e) { aSQLException <<= e; } @@ -436,12 +423,15 @@ namespace dbp } - if (aSQLException.hasValue() && xHandler.is()) + if ( aSQLException.hasValue() ) { // an SQLException (or derivee) was thrown ... Reference< XInteractionRequest > xRequest = new OInteractionRequest(aSQLException); try { - xHandler->handle(xRequest); + // get the default SDB interaction handler + Reference< XInteractionHandler > xHandler = getDialog()->getInteractionHandler(this); + if ( xHandler.is() ) + xHandler->handle(xRequest); } catch(Exception&) { } return; |