User: kz Date: 2008-03-06 18:30:08+0000 Modified: dba/dbaccess/source/ui/querydesign/querycontroller.cxx
Log: INTEGRATION: CWS odbmacros2 (1.112.2); FILE MERGED 2008/02/20 13:28:04 fs 1.112.2.5.2.1: some DBG_UNHANDLED_EXCEPTIONs 2008/02/11 11:17:17 fs 1.112.2.5: replace ShowTreeView/Button with (Enable|Show)Browser 2008/02/06 21:45:06 fs 1.112.2.4: #i49133# some initialization-related re-factoring 2008/02/04 13:08:19 fs 1.112.2.3: RESYNC: (1.112-1.114); FILE MERGED 2008/01/26 21:22:24 fs 1.112.2.2: new include necessary 2007/12/13 11:22:17 fs 1.112.2.1: #i49133# some refactoring, mostly related to the m_xCurrentFrame->m_aCurrentFrame change File Changes: Directory: /dba/dbaccess/source/ui/querydesign/ =============================================== File [changed]: querycontroller.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/querydesign/querycontroller.cxx?r1=1.114&r2=1.115 Delta lines: +22 -45 --------------------- --- querycontroller.cxx 2008-01-30 08:54:35+0000 1.114 +++ querycontroller.cxx 2008-03-06 18:30:06+0000 1.115 @@ -97,6 +97,7 @@ #include <tools/diagnose_ex.h> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> +#include <vos/mutex.hxx> extern "C" void SAL_CALL createRegistryInfo_OQueryControl() { @@ -709,26 +710,6 @@ const NamedValueCollection& rArguments( getInitParams() ); - // connection or data source name - Reference< XConnection > xConnection; - rArguments.get_ensureType( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); - if ( xConnection.is() ) - initializeConnection( xConnection ); - else - { - ::rtl::OUString sDataSourceName; - rArguments.get_ensureType( (::rtl::OUString)PROPERTY_DATASOURCENAME, sDataSourceName ); - if ( !sDataSourceName.getLength() ) - throw IllegalArgumentException( - ::rtl::OUString( String( ModuleRes( STR_NO_DATASOURCE_OR_CONNECTION ) ) ), - *this, - 1 - ); - - // TODO: respect this data source name by creating a connection, remembering it, - // and remembering that we are the owner of it - } - ::rtl::OUString sCommand; m_nCommandType = CommandType::QUERY; @@ -987,15 +968,14 @@ { ::vos::OGuard aGuard(Application::GetSolarMutex()); - Reference< XFrame > xSource(Source.Source, UNO_QUERY); - if (xSource.is() && getContainer()) + if ( getContainer() && Source.Source.is() ) { - if (xSource.get() == m_xCurrentFrame.get()) + if ( Source.Source == m_aCurrentFrame.getFrame() ) { // our frame is beeing disposed -> close the preview window (if we have one) - Reference<XFrame> xXFrame( getContainer()->getPreviewFrame()); - ::comphelper::disposeComponent( xXFrame ); + Reference< XFrame > xPreviewFrame( getContainer()->getPreviewFrame() ); + ::comphelper::disposeComponent( xPreviewFrame ); } - else if (xSource.get() == getContainer()->getPreviewFrame().get()) + else if ( Source.Source == getContainer()->getPreviewFrame() ) { getContainer()->disposingPreview(); } @@ -1142,7 +1122,7 @@ { try { - getContainer()->showPreview(m_xCurrentFrame); + getContainer()->showPreview( getFrame() ); InvalidateFeature(SID_DB_QUERY_PREVIEW); URL aWantToDispatch; @@ -1152,10 +1132,10 @@ sal_Int32 nSearchFlags = FrameSearchFlag::CHILDREN; Reference< XDispatch> xDisp; - Reference< XDispatchProvider> xProv(m_xCurrentFrame->findFrame(sFrameName,nSearchFlags),UNO_QUERY); + Reference< XDispatchProvider> xProv( getFrame()->findFrame( sFrameName, nSearchFlags ), UNO_QUERY ); if(!xProv.is()) { - xProv.set(m_xCurrentFrame,UNO_QUERY); + xProv.set( getFrame(), UNO_QUERY ); if (xProv.is()) xDisp = xProv->queryDispatch(aWantToDispatch, sFrameName, nSearchFlags); } @@ -1165,7 +1145,7 @@ } if (xDisp.is()) { - Sequence< PropertyValue> aProps(10); + Sequence< PropertyValue> aProps(9); aProps[0].Name = PROPERTY_DATASOURCENAME; aProps[0].Value <<= sDataSourceName; @@ -1175,31 +1155,28 @@ aProps[2].Name = PROPERTY_COMMAND; aProps[2].Value <<= sTranslatedStmt; - aProps[3].Name = PROPERTY_SHOWTREEVIEW; + aProps[3].Name = PROPERTY_ENABLE_BROWSER; aProps[3].Value = ::cppu::bool2any(sal_False); - aProps[4].Name = PROPERTY_SHOWTREEVIEWBUTTON; - aProps[4].Value = ::cppu::bool2any(sal_False); - - aProps[5].Name = PROPERTY_ACTIVE_CONNECTION; - aProps[5].Value <<= getConnection(); + aProps[4].Name = PROPERTY_ACTIVE_CONNECTION; + aProps[4].Value <<= getConnection(); - aProps[6].Name = PROPERTY_UPDATE_CATALOGNAME; - aProps[6].Value <<= m_sUpdateCatalogName; + aProps[5].Name = PROPERTY_UPDATE_CATALOGNAME; + aProps[5].Value <<= m_sUpdateCatalogName; - aProps[7].Name = PROPERTY_UPDATE_SCHEMANAME; - aProps[7].Value <<= m_sUpdateSchemaName; + aProps[6].Name = PROPERTY_UPDATE_SCHEMANAME; + aProps[6].Value <<= m_sUpdateSchemaName; - aProps[8].Name = PROPERTY_UPDATE_TABLENAME; - aProps[8].Value <<= m_sUpdateTableName; + aProps[7].Name = PROPERTY_UPDATE_TABLENAME; + aProps[7].Value <<= m_sUpdateTableName; - aProps[9].Name = PROPERTY_ESCAPE_PROCESSING; - aProps[9].Value = ::cppu::bool2any(m_bEscapeProcessing); + aProps[8].Name = PROPERTY_ESCAPE_PROCESSING; + aProps[8].Value = ::cppu::bool2any(m_bEscapeProcessing); xDisp->dispatch(aWantToDispatch, aProps); // check the state of the beamer // be notified when the beamer frame is closed - Reference< XComponent > xComponent(m_xCurrentFrame->findFrame(sFrameName,nSearchFlags), UNO_QUERY); + Reference< XComponent > xComponent( getFrame()->findFrame( sFrameName, nSearchFlags ), UNO_QUERY ); if (xComponent.is()) { OSL_ENSURE(Reference< XFrame >(xComponent, UNO_QUERY).get() == getContainer()->getPreviewFrame().get(), --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
