Kaydet (Commit) dac2bc38 authored tarafından Kurt Zenker's avatar Kurt Zenker

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
üst 504a55c0
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: tablespage.cxx,v $ * $RCSfile: tablespage.cxx,v $
* *
* $Revision: 1.28 $ * $Revision: 1.29 $
* *
* last change: $Author: rt $ $Date: 2007-04-26 08:01:48 $ * last change: $Author: kz $ $Date: 2007-05-10 10:26:28 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -123,6 +123,9 @@ ...@@ -123,6 +123,9 @@
#ifndef _DBAUI_TABLESSINGLEDLG_HXX_ #ifndef _DBAUI_TABLESSINGLEDLG_HXX_
#include "TablesSingleDlg.hxx" #include "TablesSingleDlg.hxx"
#endif #endif
#ifndef TOOLS_DIAGNOSE_EX_H
#include <tools/diagnose_ex.h>
#endif
//......................................................................... //.........................................................................
namespace dbaui namespace dbaui
...@@ -148,7 +151,6 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -148,7 +151,6 @@ DBG_NAME(OTableSubscriptionPage)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
OTableSubscriptionPage::OTableSubscriptionPage( Window* pParent, const SfxItemSet& _rCoreAttrs,OTableSubscriptionDialog* _pTablesDlg ) OTableSubscriptionPage::OTableSubscriptionPage( Window* pParent, const SfxItemSet& _rCoreAttrs,OTableSubscriptionDialog* _pTablesDlg )
:OGenericAdministrationPage( pParent, ModuleRes(PAGE_TABLESUBSCRIPTION), _rCoreAttrs ) :OGenericAdministrationPage( pParent, ModuleRes(PAGE_TABLESUBSCRIPTION), _rCoreAttrs )
,OContainerListener( m_aNotifierMutex )
,m_aTables (this, ModuleRes(FL_SEPARATOR1)) ,m_aTables (this, ModuleRes(FL_SEPARATOR1))
,m_aTablesList (this, NULL,ModuleRes(CTL_TABLESUBSCRIPTION),sal_True) ,m_aTablesList (this, NULL,ModuleRes(CTL_TABLESUBSCRIPTION),sal_True)
,m_aExplanation (this, ModuleRes(FT_FILTER_EXPLANATION)) ,m_aExplanation (this, ModuleRes(FT_FILTER_EXPLANATION))
...@@ -184,8 +186,6 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -184,8 +186,6 @@ DBG_NAME(OTableSubscriptionPage)
} }
catch (RuntimeException&) { } catch (RuntimeException&) { }
retireNotifiers();
DBG_DTOR(OTableSubscriptionPage,NULL); DBG_DTOR(OTableSubscriptionPage,NULL);
} }
...@@ -227,23 +227,6 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -227,23 +227,6 @@ DBG_NAME(OTableSubscriptionPage)
} }
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
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) void OTableSubscriptionPage::implCheckTables(const Sequence< ::rtl::OUString >& _rTables)
{ {
// the meta data for the current connection, used for splitting up table names // the meta data for the current connection, used for splitting up table names
...@@ -338,7 +321,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -338,7 +321,7 @@ DBG_NAME(OTableSubscriptionPage)
// get the name of the data source we're working for // get the name of the data source we're working for
SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); 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(); String sDSName = pNameItem->GetValue();
if (bValid && sDSName.Len() && !m_xCurrentConnection.is() ) if (bValid && sDSName.Len() && !m_xCurrentConnection.is() )
...@@ -346,7 +329,7 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -346,7 +329,7 @@ DBG_NAME(OTableSubscriptionPage)
// the PropertyValues for the current dialog settings // the PropertyValues for the current dialog settings
Sequence< PropertyValue > aConnectionParams; 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 )
{ {
if (!m_pTablesDlg->getCurrentSettings(aConnectionParams)) if (!m_pTablesDlg->getCurrentSettings(aConnectionParams))
...@@ -461,13 +444,9 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -461,13 +444,9 @@ DBG_NAME(OTableSubscriptionPage)
m_bCatalogAtStart = xMeta->isCatalogAtStart(); m_bCatalogAtStart = xMeta->isCatalogAtStart();
} }
} }
catch(SQLException&)
{
DBG_ERROR("OTableSubscriptionPage::ActivatePage : could not retrieve the qualifier separator for the used connection !");
}
catch(Exception&) catch(Exception&)
{ {
OSL_ENSURE(0,"Exception catched!"); DBG_UNHANDLED_EXCEPTION();
} }
} }
} }
...@@ -528,8 +507,6 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -528,8 +507,6 @@ DBG_NAME(OTableSubscriptionPage)
} }
catch (RuntimeException&) { } catch (RuntimeException&) { }
retireNotifiers();
return nResult; return nResult;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -680,73 +657,6 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -680,73 +657,6 @@ DBG_NAME(OTableSubscriptionPage)
return pParent; return pParent;
} }
//------------------------------------------------------------------------
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 ) IMPL_LINK( OTableSubscriptionPage, OnTreeEntryCompare, const SvSortData*, _pSortData )
{ {
...@@ -917,78 +827,6 @@ DBG_NAME(OTableSubscriptionPage) ...@@ -917,78 +827,6 @@ DBG_NAME(OTableSubscriptionPage)
return sal_True; 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*/) void OTableSubscriptionPage::fillControls(::std::vector< ISaveValueWrapper* >& /*_rControlList*/)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment