summaryrefslogtreecommitdiff
path: root/sc/source/ui/navipi/scenwnd.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/navipi/scenwnd.cxx')
-rw-r--r--sc/source/ui/navipi/scenwnd.cxx50
1 files changed, 29 insertions, 21 deletions
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 96b37d81602d..7791cfff9990 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -197,23 +197,23 @@ void ScScenarioListBox::DeleteScenario( bool bQueryBox )
ScScenarioWindow::ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_List,
const OUString& aQH_Comment)
: Window ( pParent, WB_TABSTOP | WB_DIALOGCONTROL ),
- aLbScenario ( *this ),
- aEdComment ( this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP )
+ aLbScenario ( VclPtr<ScScenarioListBox>::Create(*this) ),
+ aEdComment ( VclPtr<MultiLineEdit>::Create(this, WB_BORDER | WB_LEFT | WB_READONLY | WB_VSCROLL | WB_TABSTOP) )
{
vcl::Font aFont( GetFont() );
aFont.SetTransparent( true );
aFont.SetWeight( WEIGHT_LIGHT );
- aEdComment.SetFont( aFont );
- aEdComment.SetMaxTextLen( 512 );
- aLbScenario.SetPosPixel( Point(0,0) );
- aLbScenario.SetHelpId(HID_SC_SCENWIN_TOP);
- aEdComment.SetHelpId(HID_SC_SCENWIN_BOTTOM);
- aLbScenario.Show();
- aEdComment.Show();
-
- aLbScenario.SetQuickHelpText(aQH_List);
- aEdComment.SetQuickHelpText(aQH_Comment);
- aEdComment.SetBackground( Color( COL_LIGHTGRAY ) );
+ aEdComment->SetFont( aFont );
+ aEdComment->SetMaxTextLen( 512 );
+ aLbScenario->SetPosPixel( Point(0,0) );
+ aLbScenario->SetHelpId(HID_SC_SCENWIN_TOP);
+ aEdComment->SetHelpId(HID_SC_SCENWIN_BOTTOM);
+ aLbScenario->Show();
+ aEdComment->Show();
+
+ aLbScenario->SetQuickHelpText(aQH_List);
+ aEdComment->SetQuickHelpText(aQH_Comment);
+ aEdComment->SetBackground( Color( COL_LIGHTGRAY ) );
SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm)
@@ -226,6 +226,14 @@ ScScenarioWindow::ScScenarioWindow( vcl::Window* pParent, const OUString& aQH_Li
ScScenarioWindow::~ScScenarioWindow()
{
+ disposeOnce();
+}
+
+void ScScenarioWindow::dispose()
+{
+ aLbScenario.disposeAndClear();
+ aEdComment.disposeAndClear();
+ vcl::Window::dispose();
}
void ScScenarioWindow::Paint( const Rectangle& rRect )
@@ -242,26 +250,26 @@ void ScScenarioWindow::NotifyState( const SfxPoolItem* pState )
{
if( pState )
{
- aLbScenario.Enable();
+ aLbScenario->Enable();
if ( pState->ISA(SfxStringItem) )
{
OUString aNewEntry( static_cast<const SfxStringItem*>(pState)->GetValue() );
if ( !aNewEntry.isEmpty() )
- aLbScenario.SelectEntry( aNewEntry );
+ aLbScenario->SelectEntry( aNewEntry );
else
- aLbScenario.SetNoSelection();
+ aLbScenario->SetNoSelection();
}
else if ( pState->ISA(SfxStringListItem) )
{
- aLbScenario.UpdateEntries( static_cast<const SfxStringListItem*>(pState)->GetList() );
+ aLbScenario->UpdateEntries( static_cast<const SfxStringListItem*>(pState)->GetList() );
}
}
else
{
- aLbScenario.Disable();
- aLbScenario.SetNoSelection();
+ aLbScenario->Disable();
+ aLbScenario->SetNoSelection();
}
}
@@ -273,10 +281,10 @@ void ScScenarioWindow::SetSizePixel( const Size& rNewSize )
Window::SetSizePixel( aSize );
aSize.Height() = nHeight;
- aLbScenario.SetSizePixel( aSize );
+ aLbScenario->SetSizePixel( aSize );
aSize.Height() -= 4;
- aEdComment.SetPosSizePixel( Point( 0, nHeight+4 ), aSize );
+ aEdComment->SetPosSizePixel( Point( 0, nHeight+4 ), aSize );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */