summaryrefslogtreecommitdiff
path: root/extensions/source/bibliography/bibview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/source/bibliography/bibview.cxx')
-rw-r--r--extensions/source/bibliography/bibview.cxx45
1 files changed, 30 insertions, 15 deletions
diff --git a/extensions/source/bibliography/bibview.cxx b/extensions/source/bibliography/bibview.cxx
index 2d715d040d5a..dd13a1e2453d 100644
--- a/extensions/source/bibliography/bibview.cxx
+++ b/extensions/source/bibliography/bibview.cxx
@@ -52,16 +52,22 @@ namespace bib
,m_pDatMan( _pManager )
,m_xDatMan( _pManager )
,m_pGeneralPage( NULL )
+ ,m_aFormControlContainer(this)
{
if ( m_xDatMan.is() )
- connectForm( m_xDatMan );
+ m_aFormControlContainer.connectForm( m_xDatMan );
}
BibView::~BibView()
{
+ disposeOnce();
+ }
+
+ void BibView::dispose()
+ {
BibGeneralPage* pGeneralPage = m_pGeneralPage;
- m_pGeneralPage = NULL;
+ m_pGeneralPage.clear();
pGeneralPage->CommitActiveControl();
Reference< XForm > xForm = m_pDatMan->getForm();
@@ -92,11 +98,12 @@ namespace bib
}
}
- if ( isFormConnected() )
- disconnectForm();
+ if ( m_aFormControlContainer.isFormConnected() )
+ m_aFormControlContainer.disconnectForm();
pGeneralPage->RemoveListeners();
m_xGeneralPage = NULL;
+ BibWindow::dispose();
}
void BibView::UpdatePages()
@@ -112,7 +119,8 @@ namespace bib
m_xGeneralPage = 0;
}
- m_xGeneralPage = m_pGeneralPage = new BibGeneralPage( this, m_pDatMan );
+ m_pGeneralPage = VclPtr<BibGeneralPage>::Create( this, m_pDatMan );
+ m_xGeneralPage = &m_pGeneralPage->GetFocusListener();
m_pGeneralPage->Show();
if( HasFocus() )
@@ -133,11 +141,11 @@ namespace bib
{
sErrorString += "\n";
sErrorString += BIB_RESSTR(RID_MAP_QUESTION);
- QueryBox aQuery( this, WB_YES_NO, sErrorString );
- aQuery.SetDefaultCheckBoxText();
- short nResult = aQuery.Execute();
+ ScopedVclPtrInstance< QueryBox > aQuery(this, WB_YES_NO, sErrorString);
+ aQuery->SetDefaultCheckBoxText();
+ short nResult = aQuery->Execute();
BibModul::GetConfig()->SetShowColumnAssignmentWarning(
- !aQuery.GetCheckBoxState());
+ !aQuery->GetCheckBoxState());
if( RET_YES != nResult )
{
bExecute = false;
@@ -150,18 +158,20 @@ namespace bib
}
}
- void BibView::_loaded( const EventObject& _rEvent )
+ BibViewFormControlContainer::BibViewFormControlContainer(BibView *pBibView) : mpBibView(pBibView) {}
+
+ void BibViewFormControlContainer::_loaded( const EventObject& _rEvent )
{
- UpdatePages();
+ mpBibView->UpdatePages();
FormControlContainer::_loaded( _rEvent );
- Resize();
+ mpBibView->Resize();
}
- void BibView::_reloaded( const EventObject& _rEvent )
+ void BibViewFormControlContainer::_reloaded( const EventObject& _rEvent )
{
- UpdatePages();
+ mpBibView->UpdatePages();
FormControlContainer::_loaded( _rEvent );
- Resize();
+ mpBibView->Resize();
}
IMPL_STATIC_LINK( BibView, CallMappingHdl, BibView*, EMPTYARG )
@@ -180,6 +190,11 @@ namespace bib
Window::Resize();
}
+ Reference< awt::XControlContainer > BibViewFormControlContainer::getControlContainer()
+ {
+ return mpBibView->getControlContainer();
+ }
+
Reference< awt::XControlContainer > BibView::getControlContainer()
{
Reference< awt::XControlContainer > xReturn;