summaryrefslogtreecommitdiff
path: root/sw/source/ui/frmdlg/cption.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/frmdlg/cption.cxx')
-rw-r--r--sw/source/ui/frmdlg/cption.cxx67
1 files changed, 50 insertions, 17 deletions
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 81dfcf9c75d1..719af75fdca5 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -51,14 +51,14 @@ using namespace ::com::sun::star;
class SwSequenceOptionDialog : public SvxStandardDialog
{
- ListBox* m_pLbLevel;
- Edit* m_pEdDelim;
+ VclPtr<ListBox> m_pLbLevel;
+ VclPtr<Edit> m_pEdDelim;
- ListBox* m_pLbCharStyle;
- CheckBox* m_pApplyBorderAndShadowCB;
+ VclPtr<ListBox> m_pLbCharStyle;
+ VclPtr<CheckBox> m_pApplyBorderAndShadowCB;
//#i61007# order of captions
- ListBox* m_pLbCaptionOrder;
+ VclPtr<ListBox> m_pLbCaptionOrder;
SwView& rView;
OUString aFldTypeName;
@@ -67,6 +67,7 @@ public:
SwSequenceOptionDialog( vcl::Window *pParent, SwView &rV,
const OUString& rSeqFldType );
virtual ~SwSequenceOptionDialog();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Apply() SAL_OVERRIDE;
bool IsApplyBorderAndShadow() { return m_pApplyBorderAndShadowCB->IsChecked(); }
@@ -283,18 +284,18 @@ IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton )
{
OUString sFldTypeName = m_pCategoryBox->GetText();
if(sFldTypeName == m_sNone)
- sFldTypeName = OUString();
- SwSequenceOptionDialog aDlg( pButton, rView, sFldTypeName );
- aDlg.SetApplyBorderAndShadow(bCopyAttributes);
- aDlg.SetCharacterStyle( sCharacterStyle );
- aDlg.SetOrderNumberingFirst( bOrderNumberingFirst );
- aDlg.Execute();
- bCopyAttributes = aDlg.IsApplyBorderAndShadow();
- sCharacterStyle = aDlg.GetCharacterStyle();
+ sFldTypeName.clear();
+ ScopedVclPtrInstance< SwSequenceOptionDialog > aDlg( pButton, rView, sFldTypeName );
+ aDlg->SetApplyBorderAndShadow(bCopyAttributes);
+ aDlg->SetCharacterStyle( sCharacterStyle );
+ aDlg->SetOrderNumberingFirst( bOrderNumberingFirst );
+ aDlg->Execute();
+ bCopyAttributes = aDlg->IsApplyBorderAndShadow();
+ sCharacterStyle = aDlg->GetCharacterStyle();
//#i61007# order of captions
- if( bOrderNumberingFirst != aDlg.IsOrderNumberingFirst() )
+ if( bOrderNumberingFirst != aDlg->IsOrderNumberingFirst() )
{
- bOrderNumberingFirst = aDlg.IsOrderNumberingFirst();
+ bOrderNumberingFirst = aDlg->IsOrderNumberingFirst();
SW_MOD()->GetModuleConfig()->SetCaptionOrderNumberingFirst(bOrderNumberingFirst);
ApplyCaptionOrder();
}
@@ -338,8 +339,8 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl)
IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl)
{
SfxItemSet aSet( rView.GetDocShell()->GetDoc()->GetAttrPool() );
- SwCaptionOptDlg aDlg( this, aSet );
- aDlg.Execute();
+ ScopedVclPtrInstance< SwCaptionOptDlg > aDlg( this, aSet );
+ aDlg->Execute();
return 0;
}
@@ -411,7 +412,27 @@ void SwCaptionDialog::DrawSample()
SwCaptionDialog::~SwCaptionDialog()
{
+ disposeOnce();
+}
+
+void SwCaptionDialog::dispose()
+{
delete pMgr;
+ m_pTextEdit.clear();
+ m_pCategoryBox.clear();
+ m_pFormatText.clear();
+ m_pFormatBox.clear();
+ m_pNumberingSeparatorFT.clear();
+ m_pNumberingSeparatorED.clear();
+ m_pSepText.clear();
+ m_pSepEdit.clear();
+ m_pPosText.clear();
+ m_pPosBox.clear();
+ m_pOKButton.clear();
+ m_pAutoCaptionButton.clear();
+ m_pOptionButton.clear();
+ m_pPreview.clear();
+ SvxStandardDialog::dispose();
}
SwSequenceOptionDialog::SwSequenceOptionDialog( vcl::Window *pParent, SwView &rV,
@@ -455,8 +476,20 @@ SwSequenceOptionDialog::SwSequenceOptionDialog( vcl::Window *pParent, SwView &rV
SwSequenceOptionDialog::~SwSequenceOptionDialog()
{
+ disposeOnce();
}
+void SwSequenceOptionDialog::dispose()
+{
+ m_pLbLevel.clear();
+ m_pEdDelim.clear();
+ m_pLbCharStyle.clear();
+ m_pApplyBorderAndShadowCB.clear();
+ m_pLbCaptionOrder.clear();
+ SvxStandardDialog::dispose();
+}
+
+
void SwSequenceOptionDialog::Apply()
{
SwWrtShell &rSh = rView.GetWrtShell();