diff options
Diffstat (limited to 'sw/source/ui/misc/num.cxx')
-rw-r--r-- | sw/source/ui/misc/num.cxx | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index cd9c26626de3..50047f254f4f 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -163,7 +163,37 @@ SwNumPositionTabPage::SwNumPositionTabPage(vcl::Window* pParent, SwNumPositionTabPage::~SwNumPositionTabPage() { + disposeOnce(); +} + +void SwNumPositionTabPage::dispose() +{ delete pActNum; + m_pLevelLB.clear(); + m_pPositionFrame.clear(); + m_pDistBorderFT.clear(); + m_pDistBorderMF.clear(); + m_pRelativeCB.clear(); + m_pIndentFT.clear(); + m_pIndentMF.clear(); + m_pDistNumFT.clear(); + m_pDistNumMF.clear(); + m_pAlignFT.clear(); + m_pAlignLB.clear(); + m_pLabelFollowedByFT.clear(); + m_pLabelFollowedByLB.clear(); + m_pListtabFT.clear(); + m_pListtabMF.clear(); + m_pAlign2FT.clear(); + m_pAlign2LB.clear(); + m_pAlignedAtFT.clear(); + m_pAlignedAtMF.clear(); + m_pIndentAtFT.clear(); + m_pIndentAtMF.clear(); + m_pStandardPB.clear(); + m_pPreviewWIN.clear(); + pOutlineDlg.clear(); + SfxTabPage::dispose(); } void SwNumPositionTabPage::InitControls() @@ -175,9 +205,9 @@ void SwNumPositionTabPage::InitControls() USHRT_MAX != nActNumLvl; m_pDistBorderMF->Enable( !bLabelAlignmentPosAndSpaceModeActive && - ( bSingleSelection || bRelative || pOutlineDlg != 0 ) ); + ( bSingleSelection || bRelative || pOutlineDlg.get() != 0 ) ); m_pDistBorderFT->Enable( !bLabelAlignmentPosAndSpaceModeActive && - ( bSingleSelection || bRelative || pOutlineDlg != 0 ) ); + ( bSingleSelection || bRelative || pOutlineDlg.get() != 0 ) ); bool bSetDistEmpty = false; bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive; @@ -512,10 +542,10 @@ void SwNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode() m_pIndentAtMF->Show( bLabelAlignmentPosAndSpaceModeActive ); } -SfxTabPage* SwNumPositionTabPage::Create( vcl::Window* pParent, - const SfxItemSet* rAttrSet) +VclPtr<SfxTabPage> SwNumPositionTabPage::Create( vcl::Window* pParent, + const SfxItemSet* rAttrSet) { - return new SwNumPositionTabPage(pParent, *rAttrSet); + return VclPtr<SwNumPositionTabPage>::Create(pParent, *rAttrSet); } void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh) @@ -960,15 +990,15 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); // collect char styles - ListBox rCharFmtLB(this); - rCharFmtLB.Clear(); - rCharFmtLB.InsertEntry( SwViewShell::GetShellRes()->aStrNone ); + ScopedVclPtrInstance< ListBox > rCharFmtLB(this); + rCharFmtLB->Clear(); + rCharFmtLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone ); SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell(); - ::FillCharStyleListBox(rCharFmtLB, pDocShell); + ::FillCharStyleListBox(*rCharFmtLB.get(), pDocShell); std::vector<OUString> aList; - for(sal_Int32 j = 0; j < rCharFmtLB.GetEntryCount(); j++) - aList.push_back( rCharFmtLB.GetEntry(j) ); + for(sal_Int32 j = 0; j < rCharFmtLB->GetEntryCount(); j++) + aList.push_back( rCharFmtLB->GetEntry(j) ); aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ; |