Tag: cws_src680_odbmacros2 User: fs Date: 2007-12-19 06:13:28+0000 Modified: dba/dbaccess/source/ui/browser/dbloader.cxx
Log: #i49133# don't attach the DBDoc model to the loaded controllers, this is not supported by them (they don't have own models, and attaching the database document is wrong, speaking strictly) File Changes: Directory: /dba/dbaccess/source/ui/browser/ =========================================== File [changed]: dbloader.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dbloader.cxx?r1=1.31&r2=1.31.64.1 Delta lines: +42 -67 --------------------- --- dbloader.cxx 2007-08-17 13:34:32+0000 1.31 +++ dbloader.cxx 2007-12-19 06:13:26+0000 1.31.64.1 @@ -4,9 +4,9 @@ * * $RCSfile: dbloader.cxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.31.64.1 $ * - * last change: $Author: ihi $ $Date: 2007/08/17 13:34:32 $ + * last change: $Author: fs $ $Date: 2007/12/19 06:13:26 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -36,15 +36,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -//#ifndef _SFXFRAME_HXX -//#include <sfx2/frame.hxx> -//#endif #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/helper/vclunohelper.hxx> #endif #ifndef _URLOBJ_HXX //autogen #include <tools/urlobj.hxx> #endif +#ifndef TOOLS_DIAGNOSE_EX_H +#include <tools/diagnose_ex.h> +#endif #ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_ #include <toolkit/awt/vclxwindow.hxx> #endif @@ -242,18 +242,17 @@ // ich benutze nicht maURL, sondern rURL, denn zwischen dem Constructor und diesem Load hier kann sich die ::com::sun::star::util::URL des Objektes // schon geaendert haben (zum Beispiel durch Umbenennen) Reference< XController > xController; - sal_Bool bAttachModel = sal_False; if(aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_FORMGRIDVIEW) xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OFormGridView")),UNO_QUERY); - else if(aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_DATASOURCEBROWSER )// construct the control + else if(aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_DATASOURCEBROWSER ) xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ODatasourceBrowser")),UNO_QUERY); - else if ( (bAttachModel = (aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_QUERYDESIGN)) )// construct the control + else if ( aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_QUERYDESIGN ) xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OQueryDesign")),UNO_QUERY); - else if ( (bAttachModel = (aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_TABLEDESIGN)) ) // construct the control + else if ( aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_TABLEDESIGN ) xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OTableDesign")),UNO_QUERY); - else if ( (bAttachModel = (aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_RELATIONDESIGN)) )// construct the control + else if ( aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_RELATIONDESIGN ) xController.set(m_xServiceFactory->createInstance(::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ORelationDesign")),UNO_QUERY); - else if ( aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_REPORTDESIGN )// construct the control + else if ( aParser.GetMainURL(INetURLObject::DECODE_TO_IURI) == URL_COMPONENT_REPORTDESIGN ) { ::comphelper::SequenceAsHashMap lDescriptor(rArgs); sal_Bool bPreview = lDescriptor.getUnpackedValueOrDefault(INFO_PREVIEW, sal_False ); @@ -282,8 +281,6 @@ Reference<XModel> xModel; if(bSuccess) { - if ( bAttachModel ) - { PropertyValue aValue; const PropertyValue* pIter = m_aArgs.getConstArray(); const PropertyValue* pEnd = pIter + m_aArgs.getLength(); @@ -316,22 +313,9 @@ } } } - if ( (bSuccess = ( xModel.is() && xModel->getURL().getLength() != 0)) ) - { - try - { - xController->attachModel(xModel); - //xModel->setCurrentController(xController); - } - catch( const Exception& ) - { - OSL_ENSURE( sal_False, "DBContentLoader::load: caught an exception!" ); - bSuccess = sal_False; - } - } + OSL_ENSURE( ( xModel.is() && xModel->getURL().getLength() != 0 ), + "DBContentLoader::load: unable to find the database document belonging to the just loaded component!" ); - OSL_ENSURE( bSuccess, "DBContentLoader::load: missing the required arguments - could not initialize the query design!" ); - } // init controller if ( bSuccess ) { @@ -354,18 +338,9 @@ xIni->initialize(aArgs); } - catch(Exception&) - { - bSuccess = sal_False; - try - { - if ( xController.is() ) - xController->attachModel( NULL ); - } - catch( const Exception& ) + catch(const Exception&) { - OSL_ENSURE( sal_False, "DBContentLoader::load: caught an exception!" ); - } + DBG_UNHANDLED_EXCEPTION(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
