User: vg Date: 05/03/10 08:43:51 Modified: /dba/dbaccess/source/ui/app/ AppControllerDnD.cxx
Log: INTEGRATION: CWS dba24 (1.8.4); FILE MERGED 2005/02/18 12:27:21 oj 1.8.4.3: #i42460# changes for the separation of datasource and database document(model) 2005/02/07 13:06:00 oj 1.8.4.2: #i42200# some little changes how to start a wizard 2005/02/04 11:51:12 oj 1.8.4.1: #i41998# conver file url in system url File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppControllerDnD.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppControllerDnD.cxx?r1=1.8&r2=1.9 Delta lines: +19 -15 --------------------- --- AppControllerDnD.cxx 21 Jan 2005 17:05:46 -0000 1.8 +++ AppControllerDnD.cxx 10 Mar 2005 16:43:49 -0000 1.9 @@ -505,7 +505,7 @@ { WaitObject aWO(getView()); String sConnectingContext( ModuleRes( STR_COULDNOTCONNECT_DATASOURCE ) ); - sConnectingContext.SearchAndReplaceAscii("$name$", sDataSourceName); + sConnectingContext.SearchAndReplaceAscii("$name$", getStrippedDatabaseName()); aFind->second = connect(sDataSourceName, sConnectingContext, rtl::OUString(), sal_True); // otherwise we got a loop when connecting to db throws an error @@ -518,7 +518,7 @@ // ----------------------------------------------------------------------------- sal_Bool OApplicationController::isDataSourceReadOnly() const { - Reference<XStorable> xStore(m_xDataSource,UNO_QUERY); + Reference<XStorable> xStore(m_xModel,UNO_QUERY); return !xStore.is() || xStore->isReadonly(); } // ----------------------------------------------------------------------------- @@ -559,7 +559,7 @@ { case E_REPORT: // TODO: seperate handling of forms and reports { - Reference< XReportDocumentsSupplier > xSupp(m_xDataSource,UNO_QUERY); + Reference< XReportDocumentsSupplier > xSupp(m_xModel,UNO_QUERY); OSL_ENSURE(xSupp.is(),"Data source doesn't return a XReportDocumentsSupplier -> GPF"); if ( xSupp.is() ) xElements = xSupp->getReportDocuments(); @@ -567,7 +567,7 @@ break; case E_FORM: { - Reference< XFormDocumentsSupplier > xSupp(m_xDataSource,UNO_QUERY); + Reference< XFormDocumentsSupplier > xSupp(m_xModel,UNO_QUERY); OSL_ENSURE(xSupp.is(),"Data source doesn't return a XFormDocumentsSupplier -> GPF"); if ( xSupp.is() ) xElements = xSupp->getFormDocuments(); @@ -631,11 +631,10 @@ } } - Reference<XModifiable> xModi(m_xDataSource,UNO_QUERY); + Reference<XModifiable> xModi(m_xModel,UNO_QUERY); m_bCurrentlyModified = (xModi.is() && xModi->isModified()); sal_Bool bNew = sal_False; - Reference<XModel> xModel(m_xDataSource,UNO_QUERY); - if ( bInteractive && xModel.is() && !xModel->getURL().getLength() && getView() ) + if ( bInteractive && m_xModel.is() && !m_xModel->getURL().getLength() && getView() ) { WinBits nBits(WB_STDMODAL|WB_SAVEAS); ::sfx2::FileDialogHelper aFileDlg( ::sfx2::FILESAVE_AUTOEXTENSION,static_cast<sal_uInt32>(nBits) ,getView()); @@ -662,9 +661,9 @@ try { Sequence< PropertyValue > aArgs; - xModel->attachResource(sFileName,aArgs); - attachModel(xModel); - Reference<XStorable> xStr(xModel,UNO_QUERY); + m_xModel->attachResource(sFileName,aArgs); + attachModel(m_xModel); + Reference<XStorable> xStr(m_xModel,UNO_QUERY); if ( xStr.is() ) xStr->store(); @@ -710,14 +709,14 @@ { case E_FORM: { - Reference< XFormDocumentsSupplier > xSupp(m_xDataSource,UNO_QUERY); + Reference< XFormDocumentsSupplier > xSupp(m_xModel,UNO_QUERY); if ( xSupp.is() ) xNameAccess = xSupp->getFormDocuments(); break; } case E_REPORT: { - Reference< XReportDocumentsSupplier > xSupp(m_xDataSource,UNO_QUERY); + Reference< XReportDocumentsSupplier > xSupp(m_xModel,UNO_QUERY); if ( xSupp.is() ) xNameAccess = xSupp->getReportDocuments(); break; @@ -740,10 +739,15 @@ } Reference<XConnection> xConnection; + try + { ensureConnection(xConnection); + } + catch(SQLContext& e) { showError(SQLExceptionInfo(e)); } + catch(SQLWarning& e) { showError(SQLExceptionInfo(e)); } + catch(SQLException& e) { showError(SQLExceptionInfo(e)); } OSL_ENSURE(xNameAccess.is(),"Data source doesn't return a name access -> GPF"); - ::std::auto_ptr<OLinkedDocumentsAccess> aHelper( new OLinkedDocumentsAccess(getView(), getORB(), xNameAccess,xConnection)); - return aHelper; + return ::std::auto_ptr<OLinkedDocumentsAccess>( new OLinkedDocumentsAccess(getView(), getORB(), xNameAccess,xConnection,getDatabaseName())); } // ----------------------------------------------------------------------------- TransferableHelper* OApplicationController::copyObject() --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
