User: kz Date: 2007-05-10 10:26:31+0000 Log: INTEGRATION: CWS dba23a (1.27.62); FILE MERGED 2007/05/09 11:25:28 fs 1.27.62.3: RESYNC: (1.27-1.28); FILE MERGED 2007/03/13 08:42:15 fs 1.27.62.2: some slight re-factoring (class/method renaming), plus some rudimentary fix for #b6532894# 2007/02/26 09:59:20 fs 1.27.62.1: found in the course of #i74776#: container listener is not used anymore
File Changes: Directory: /dba/dbaccess/source/ui/dlg/ ======================================= File [changed]: tablespage.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/tablespage.cxx?r1=1.28&r2=1.29 Delta lines: +6 -168 --------------------- --- tablespage.cxx 2007-04-26 08:01:48+0000 1.28 +++ tablespage.cxx 2007-05-10 10:26:28+0000 1.29 @@ -123,6 +123,9 @@ #ifndef _DBAUI_TABLESSINGLEDLG_HXX_ #include "TablesSingleDlg.hxx" #endif +#ifndef TOOLS_DIAGNOSE_EX_H +#include <tools/diagnose_ex.h> +#endif //......................................................................... namespace dbaui @@ -148,7 +151,6 @@ //------------------------------------------------------------------------ OTableSubscriptionPage::OTableSubscriptionPage( Window* pParent, const SfxItemSet& _rCoreAttrs,OTableSubscriptionDialog* _pTablesDlg ) :OGenericAdministrationPage( pParent, ModuleRes(PAGE_TABLESUBSCRIPTION), _rCoreAttrs ) - ,OContainerListener( m_aNotifierMutex ) ,m_aTables (this, ModuleRes(FL_SEPARATOR1)) ,m_aTablesList (this, NULL,ModuleRes(CTL_TABLESUBSCRIPTION),sal_True) ,m_aExplanation (this, ModuleRes(FT_FILTER_EXPLANATION)) @@ -184,8 +186,6 @@ } catch (RuntimeException&) { } - retireNotifiers(); - DBG_DTOR(OTableSubscriptionPage,NULL); } @@ -227,23 +227,6 @@ } } //------------------------------------------------------------------------ - void OTableSubscriptionPage::retireNotifiers() - { - for ( AdapterArrayIterator aLoop = m_aNotifiers.begin(); - aLoop != m_aNotifiers.end(); - ++aLoop - ) - { - if ( *aLoop ) - { - ( *aLoop )->dispose(); - ( *aLoop )->release(); - ( *aLoop ) = NULL; - } - } - m_aNotifiers.clear( ); - } - //------------------------------------------------------------------------ void OTableSubscriptionPage::implCheckTables(const Sequence< ::rtl::OUString >& _rTables) { // the meta data for the current connection, used for splitting up table names @@ -338,7 +321,7 @@ // get the name of the data source we're working for SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); - DBG_ASSERT(pNameItem, "OTableSubscriptionPage::ActivatePage: missing the name attribute!"); + DBG_ASSERT(pNameItem, "OTableSubscriptionPage::implInitControls: missing the name attribute!"); String sDSName = pNameItem->GetValue(); if (bValid && sDSName.Len() && !m_xCurrentConnection.is() ) @@ -346,7 +329,7 @@ // the PropertyValues for the current dialog settings Sequence< PropertyValue > aConnectionParams; - DBG_ASSERT(m_pTablesDlg, "OTableSubscriptionPage::ActivatePage : need a parent dialog doing the translation!"); + DBG_ASSERT(m_pTablesDlg, "OTableSubscriptionPage::implInitControls: need a parent dialog doing the translation!"); if ( m_pTablesDlg ) { if (!m_pTablesDlg->getCurrentSettings(aConnectionParams)) @@ -461,13 +444,9 @@ m_bCatalogAtStart = xMeta->isCatalogAtStart(); } } - catch(SQLException&) - { - DBG_ERROR("OTableSubscriptionPage::ActivatePage : could not retrieve the qualifier separator for the used connection !"); - } catch(Exception&) { - OSL_ENSURE(0,"Exception catched!"); + DBG_UNHANDLED_EXCEPTION(); } } } @@ -528,8 +507,6 @@ } catch (RuntimeException&) { } - retireNotifiers(); - return nResult; } //------------------------------------------------------------------------ @@ -681,73 +658,6 @@ } //------------------------------------------------------------------------ - OPageSettings* OTableSubscriptionPage::createViewSettings() - { - return new OTablePageViewSettings; - } - - //------------------------------------------------------------------------ - void OTableSubscriptionPage::fillViewSettings(OPageSettings* _pSettings) - { - OTablePageViewSettings* pMySettings = static_cast<OTablePageViewSettings*>(_pSettings); - if (!pMySettings) - return; - - // collect the names of the expanded extries - EntryPredicateCheck aExpandedCheck =&SvListView::IsExpanded; - collectEntryPaths(pMySettings->aExpandedEntries, aExpandedCheck); - - // collect the names of the selected extries - EntryPredicateCheck aSelectedCheck = &SvListView::IsSelected; - collectEntryPaths(pMySettings->aSelectedEntries, aSelectedCheck); - - SvLBoxEntry* pCurEntry = m_aTablesList.GetCurEntry(); - if (pCurEntry) - { - StringArray aLocalNames; - while (pCurEntry && (pCurEntry != m_aTablesList.getAllObjectsEntry())) - { - aLocalNames.push_back(m_aTablesList.GetEntryText(pCurEntry)); - pCurEntry = m_aTablesList.GetParent(pCurEntry); - } - - const ::rtl::OUString sSeparator = ::rtl::OUString::createFromAscii("."); - - // assemble the name - pMySettings->sFocusEntry = ::rtl::OUString(); - for ( StringArray::reverse_iterator aSegments = aLocalNames.rbegin(); - aSegments != aLocalNames.rend(); - - ) - { - pMySettings->sFocusEntry += *aSegments; - if (++aSegments != aLocalNames.rend()) - pMySettings->sFocusEntry += sSeparator; - } - } - } - - //------------------------------------------------------------------------ - void OTableSubscriptionPage::restoreViewSettings(const OPageSettings* _pSettings) - { - const OTablePageViewSettings* pMySettings = static_cast<const OTablePageViewSettings*>(_pSettings); - if (!pMySettings) - return; - - // expand the entries - // TODO: some kind of collapse all - actOnEntryPaths(pMySettings->aExpandedEntries, &OTableSubscriptionPage::doExpand); - - // select the entries - m_aTablesList.SelectAll(sal_False); - actOnEntryPaths(pMySettings->aSelectedEntries, &OTableSubscriptionPage::doSelect); - - SvLBoxEntry* pFocusEntry = getEntryFromPath(pMySettings->sFocusEntry); - if (pFocusEntry) - m_aTablesList.SetCurEntry(pFocusEntry); - } - - //------------------------------------------------------------------------ IMPL_LINK( OTableSubscriptionPage, OnTreeEntryCompare, const SvSortData*, _pSortData ) { SvLBoxEntry* pLHS = static_cast<SvLBoxEntry*>(_pSortData->pLeft); @@ -917,78 +827,6 @@ return sal_True; } - //------------------------------------------------------------------------ - void OTableSubscriptionPage::_elementInserted( const ContainerEvent& _rEvent ) throw(RuntimeException) - { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - ::rtl::OUString sName; - _rEvent.Accessor >>= sName; - DBG_ASSERT( 0 != sName.getLength(), "OTableSubscriptionPage::_elementInserted: invalid accessor!" ); - - m_aTablesList.addedTable( sName ); - - // update the checks from the table filter set on the data source - try - { - Reference< XPropertySet > xDS = m_pTablesDlg->getCurrentDataSource(); - if ( xDS.is() ) - { - Sequence< ::rtl::OUString > aTableFilter; - xDS->getPropertyValue( PROPERTY_TABLEFILTER ) >>= aTableFilter; - implCompleteTablesCheck( aTableFilter ); - } - } - catch( const Exception& ) - { - } - - // update the check states - m_aTablesList.CheckButtons(); - } - - //------------------------------------------------------------------------ - void OTableSubscriptionPage::_elementRemoved( const ContainerEvent& _rEvent ) throw(RuntimeException) - { - ::vos::OGuard aGuard( Application::GetSolarMutex() ); - - ::rtl::OUString sName; - _rEvent.Accessor >>= sName; - DBG_ASSERT( 0 != sName.getLength(), "OTableSubscriptionPage::_elementRemoved: invalid accessor!" ); - - m_aTablesList.removedTable( sName ); - - m_aTablesList.CheckButtons(); - } - - //------------------------------------------------------------------------ - void OTableSubscriptionPage::_elementReplaced( const ContainerEvent& /*_rEvent*/ ) throw(RuntimeException) - { - DBG_ERROR( "OTableSubscriptionPage::_elementReplaced: not implemented!" ); - } - - //------------------------------------------------------------------------ - void OTableSubscriptionPage::_disposing(const EventObject& _rSource) throw( RuntimeException) - { - Reference< XContainer > xSource( _rSource.Source, UNO_QUERY ); - - // look for the notifier which caused this - for ( AdapterArrayIterator aSearch = m_aNotifiers.begin(); - aSearch != m_aNotifiers.end(); - ++aSearch - ) - { - if ( *aSearch - && ( *aSearch )->getContainer().get() == xSource.get() - ) - { - ( *aSearch )->release(); - m_aNotifiers.erase( aSearch ); - break; - } - } - // not interested in - } // ----------------------------------------------------------------------- void OTableSubscriptionPage::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/) { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
