summaryrefslogtreecommitdiff
path: root/formula/source/ui/dlg/funcutl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'formula/source/ui/dlg/funcutl.cxx')
-rw-r--r--formula/source/ui/dlg/funcutl.cxx55
1 files changed, 39 insertions, 16 deletions
diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx
index ff60bc9e0947..7093e0f6fcff 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -42,6 +42,19 @@ ArgEdit::ArgEdit( vcl::Window* pParent, WinBits nBits )
{
}
+ArgEdit::~ArgEdit()
+{
+ dispose();
+}
+
+void ArgEdit::dispose()
+{
+ pEdPrev.clear();
+ pEdNext.clear();
+ pSlider.clear();
+ RefEdit::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeArgEdit(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new ArgEdit(pParent, WB_BORDER);
@@ -149,17 +162,17 @@ void ArgInput::InitArgInput( FixedText* pftArg, PushButton* pbtnFx,
pEdArg =pedArg;
pRefBtn=prefBtn;
- if(pBtnFx!=NULL)
+ if(pBtnFx!=nullptr)
{
pBtnFx->SetClickHdl ( LINK( this, ArgInput, FxBtnClickHdl ) );
pBtnFx->SetGetFocusHdl( LINK( this, ArgInput, FxBtnFocusHdl ) );
}
- if(pRefBtn!=NULL)
+ if(pRefBtn!=nullptr)
{
pRefBtn->SetClickHdl ( LINK( this, ArgInput, RefBtnClickHdl ) );
pRefBtn->SetGetFocusHdl( LINK( this, ArgInput, RefBtnFocusHdl ) );
}
- if(pEdArg!=NULL)
+ if(pEdArg!=nullptr)
{
pEdArg->SetGetFocusHdl ( LINK( this, ArgInput, EdFocusHdl ) );
pEdArg->SetModifyHdl ( LINK( this, ArgInput, EdModifyHdl ) );
@@ -170,14 +183,14 @@ void ArgInput::InitArgInput( FixedText* pftArg, PushButton* pbtnFx,
// Sets the Name for the Argument
void ArgInput::SetArgName(const OUString &aArg)
{
- if(pFtArg !=NULL) pFtArg->SetText(aArg );
+ if(pFtArg !=nullptr) pFtArg->SetText(aArg );
}
// Returns the Name for the Argument
OUString ArgInput::GetArgName()
{
OUString aPrivArgName;
- if(pFtArg !=NULL)
+ if(pFtArg !=nullptr)
aPrivArgName=pFtArg->GetText();
return aPrivArgName;
@@ -186,19 +199,19 @@ OUString ArgInput::GetArgName()
//Sets the Name for the Argument
void ArgInput::SetArgNameFont (const vcl::Font &aFont)
{
- if(pFtArg !=NULL) pFtArg->SetFont(aFont);
+ if(pFtArg !=nullptr) pFtArg->SetFont(aFont);
}
//Sets up the Selection for the EditBox.
void ArgInput::SetArgSelection (const Selection& rSel )
{
- if(pEdArg !=NULL) pEdArg ->SetSelection(rSel );
+ if(pEdArg !=nullptr) pEdArg ->SetSelection(rSel );
}
//Sets the Value for the Argument
void ArgInput::SetArgVal(const OUString &rVal)
{
- if(pEdArg !=NULL)
+ if(pEdArg != nullptr)
{
pEdArg ->SetRefString(rVal);
}
@@ -208,7 +221,7 @@ void ArgInput::SetArgVal(const OUString &rVal)
OUString ArgInput::GetArgVal()
{
OUString aResult;
- if(pEdArg!=NULL)
+ if(pEdArg!=nullptr)
{
aResult=pEdArg->GetText();
}
@@ -366,10 +379,8 @@ EditBox::~EditBox()
void EditBox::dispose()
{
- MultiLineEdit* pTheEdit=pMEdit;
pMEdit->Disable();
- pMEdit=NULL;
- delete pTheEdit;
+ pMEdit.clear();
Control::dispose();
}
@@ -383,14 +394,14 @@ void EditBox::SelectionChanged()
void EditBox::Resize()
{
Size aSize=GetOutputSizePixel();
- if(pMEdit!=NULL) pMEdit->SetOutputSizePixel(aSize);
+ if(pMEdit!=nullptr) pMEdit->SetOutputSizePixel(aSize);
}
// When the Control is activated, the Selection is repealed
// and the Cursor set at the end.
void EditBox::GetFocus()
{
- if(pMEdit!=NULL)
+ if(pMEdit!=nullptr)
{
pMEdit->GrabFocus();
}
@@ -402,7 +413,7 @@ bool EditBox::PreNotify( NotifyEvent& rNEvt )
{
bool nResult = true;
- if(pMEdit==NULL) return nResult;
+ if(pMEdit==nullptr) return nResult;
MouseNotifyEvent nSwitch=rNEvt.GetType();
if(nSwitch==MouseNotifyEvent::KEYINPUT)// || nSwitch==MouseNotifyEvent::KEYUP)
@@ -437,7 +448,7 @@ bool EditBox::PreNotify( NotifyEvent& rNEvt )
//first called.
IMPL_LINK_NOARG(EditBox, ChangedHdl)
{
- if(pMEdit!=NULL)
+ if(pMEdit!=nullptr)
{
Selection aNewSel=pMEdit->GetSelection();
@@ -494,6 +505,7 @@ void RefEdit::dispose()
{
aIdle.SetIdleHdl( Link() );
aIdle.Stop();
+ pLabelWidget.clear();
Edit::dispose();
}
@@ -593,6 +605,17 @@ RefButton::RefButton( vcl::Window* _pParent, WinBits nStyle ) :
SetStartImage();
}
+RefButton::~RefButton()
+{
+ dispose();
+}
+
+void RefButton::dispose()
+{
+ pRefEdit.clear();
+ ImageButton::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRefButton(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new RefButton(pParent, 0);