User: ihi Date: 2007-11-20 19:06:08+0000 Modified: dba/reportdesign/source/ui/dlg/AddField.cxx
Log: INTEGRATION: CWS reportdesign01 (1.2.28); FILE MERGED 2007/10/11 09:05:52 lla 1.2.28.2: #i82497# compile problems on linux 2007/09/07 11:24:01 oj 1.2.28.1: #i77141# add container listener File Changes: Directory: /dba/reportdesign/source/ui/dlg/ =========================================== File [changed]: AddField.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/dlg/AddField.cxx?r1=1.2&r2=1.3 Delta lines: +38 -4 -------------------- --- AddField.cxx 2007-07-09 11:56:29+0000 1.2 +++ AddField.cxx 2007-11-20 19:06:05+0000 1.3 @@ -213,6 +213,7 @@ OAddFieldWindow::OAddFieldWindow(::rptui::OReportController& _rController,Window* pParent) :FloatingWindow(pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE)) ,::comphelper::OPropertyChangeListener(m_aMutex) + ,::comphelper::OContainerListener(m_aMutex) ,m_pListBox(new OAddFieldWindowListBox( this )) ,m_rController( _rController ) ,m_nCommandType(0) @@ -249,6 +250,8 @@ { if (m_pChangeListener.is()) m_pChangeListener->dispose(); + if ( m_pContainerListener.is() ) + m_pContainerListener->dispose(); DBG_DTOR( rpt_OAddFieldWindow,NULL); } @@ -310,6 +313,9 @@ //----------------------------------------------------------------------- void OAddFieldWindow::Update() { + if ( m_pContainerListener.is() ) + m_pContainerListener->dispose(); + m_pContainerListener = NULL; m_xColumns.clear(); try @@ -344,12 +350,16 @@ m_sFilter = sFilter; // add the columns to the list - m_xColumns.clear(); uno::Reference< sdbc::XConnection> xCon = getConnection(); if ( xCon.is() && m_aCommandName.getLength() ) m_xColumns = dbtools::getFieldsByCommandDescriptor( xCon, GetCommandType(), GetCommand(), m_xHoldAlive ); if ( m_xColumns.is() ) + { lcl_addToList( *m_pListBox, m_xColumns->getElementNames() ); + uno::Reference< container::XContainer> xContainer(m_xColumns,uno::UNO_QUERY); + if ( xContainer.is() ) + m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); + } // add the parameter columns to the list Sequence< ::rtl::OUString > aParamNames( getParameterNames( m_rController.getRowSet() ) ); @@ -413,6 +423,30 @@ _rDescriptor[ ::svx::daColumnObject ] <<= m_xColumns->getByName(sColumnName); } } +// ----------------------------------------------------------------------------- +void OAddFieldWindow::_elementInserted( const container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException) +{ + if ( m_pListBox.get() ) + { + ::rtl::OUString sName; + if ( _rEvent.Accessor >>= sName ) + m_pListBox->InsertEntry(sName); + } +} +// ----------------------------------------------------------------------------- +void OAddFieldWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ + if ( m_pListBox.get() ) + { + m_pListBox->Clear(); + if ( m_xColumns.is() ) + lcl_addToList( *m_pListBox, m_xColumns->getElementNames() ); + } +} +// ----------------------------------------------------------------------------- +void OAddFieldWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) +{ +} // ============================================================================= } // namespace rptui // ============================================================================= --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
