Tag: cws_src680_odbmacros2 User: fs Date: 2008-02-06 21:46:24+0000 Modified: dba/reportdesign/source/ui/report/ReportController.cxx
Log: #i49133# some initialization-related re-factoring File Changes: Directory: /dba/reportdesign/source/ui/report/ ============================================== File [changed]: ReportController.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportController.cxx?r1=1.6.34.2&r2=1.6.34.3 Delta lines: +8 -39 -------------------- --- ReportController.cxx 2008-02-04 13:09:53+0000 1.6.34.2 +++ ReportController.cxx 2008-02-06 21:46:22+0000 1.6.34.3 @@ -4,9 +4,9 @@ * * $RCSfile: ReportController.cxx,v $ * - * $Revision: 1.6.34.2 $ + * $Revision: 1.6.34.3 $ * - * last change: $Author: fs $ $Date: 2008/02/04 13:09:53 $ + * last change: $Author: fs $ $Date: 2008/02/06 21:46:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1724,44 +1724,13 @@ // ----------------------------------------------------------------------------- void OReportController::impl_initialize( ) { - try - { - Reference< XConnection > xConn; - const ::comphelper::NamedValueCollection& rIni = getInitParams(); - if ( rIni.get_ensureType(static_cast< ::rtl::OUString>(PROPERTY_ACTIVECONNECTION),xConn) && xConn.is() ) - initializeConnection( xConn ); + OReportController_BASE::impl_initialize(); - rIni.get_ensureType(static_cast< ::rtl::OUString>(PROPERTY_REPORTNAME),m_sName); - if ( !m_sName.getLength() ) - { - static const ::rtl::OUString s_sDocumentTitle(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")); - rIni.get_ensureType(s_sDocumentTitle,m_sName); - } + const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); - - sal_Bool bFirstTry = sal_False; - if (!isConnected()) - { // whoever instantiated us did not give us a connection to share. Okay, create an own one - dbtools::isEmbeddedInDatabase(m_xReportDefinition,xConn); - if ( xConn.is() ) - initializeConnection( xConn ); - if (!isConnected()) - { - reconnect(sal_False); - bFirstTry = sal_True; - } - } - if (!isConnected()) // so what should otherwise - { - if ( !bFirstTry ) - connectionLostMessage(); - throw Exception(); - } - } - catch(const SQLException&) - { - OSL_ENSURE(sal_False, "OReportController::initialize: caught an exception!"); - } + rArguments.get_ensureType( (::rtl::OUString)PROPERTY_REPORTNAME, m_sName ); + if ( !m_sName.getLength() ) + rArguments.get_ensureType( "DocumentTitle", m_sName ); try { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
