summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/accessibility/AccessibleShapeTreeInfo.cxx1
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx6
-rw-r--r--svx/source/dialog/_bmpmask.cxx33
-rw-r--r--svx/source/dialog/_contdlg.cxx21
-rw-r--r--svx/source/dialog/compressgraphicdialog.cxx25
-rw-r--r--svx/source/dialog/contimp.hxx8
-rw-r--r--svx/source/dialog/ctredlin.cxx52
-rw-r--r--svx/source/dialog/docrecovery.cxx47
-rw-r--r--svx/source/dialog/fontwork.cxx332
-rw-r--r--svx/source/dialog/hdft.cxx16
-rw-r--r--svx/source/dialog/imapdlg.cxx12
-rw-r--r--svx/source/dialog/linkwarn.cxx1
-rw-r--r--svx/source/dialog/optgrid.cxx27
-rw-r--r--svx/source/dialog/orienthelper.cxx2
-rw-r--r--svx/source/dialog/passwd.cxx15
-rw-r--r--svx/source/dialog/rubydialog.cxx33
-rw-r--r--svx/source/dialog/srchdlg.cxx44
-rw-r--r--svx/source/dialog/svxruler.cxx1
-rw-r--r--svx/source/fmcomp/gridcell.cxx321
-rw-r--r--svx/source/fmcomp/gridctrl.cxx6
-rw-r--r--svx/source/form/datanavi.cxx121
-rw-r--r--svx/source/form/filtnav.cxx4
-rw-r--r--svx/source/form/fmPropBrw.cxx3
-rw-r--r--svx/source/form/fmexpl.cxx4
-rw-r--r--svx/source/form/tabwin.cxx15
-rw-r--r--svx/source/form/xfm_addcondition.cxx2
-rw-r--r--svx/source/gallery2/galbrws1.cxx3
-rw-r--r--svx/source/gallery2/galbrws1.hxx2
-rw-r--r--svx/source/gallery2/galbrws2.cxx16
-rw-r--r--svx/source/inc/AccessibleFrameSelector.hxx3
-rw-r--r--svx/source/inc/GraphCtlAccessibleContext.hxx2
-rw-r--r--svx/source/inc/charmapacc.hxx2
-rw-r--r--svx/source/inc/datalistener.hxx3
-rw-r--r--svx/source/inc/datanavi.hxx134
-rw-r--r--svx/source/inc/docrecovery.hxx38
-rw-r--r--svx/source/inc/filtnav.hxx2
-rw-r--r--svx/source/inc/fmexch.hxx2
-rw-r--r--svx/source/inc/fmexpl.hxx2
-rw-r--r--svx/source/inc/fmvwimp.hxx3
-rw-r--r--svx/source/inc/gridcell.hxx12
-rw-r--r--svx/source/inc/svxrectctaccessiblecontext.hxx3
-rw-r--r--svx/source/inc/tabwin.hxx6
-rw-r--r--svx/source/inc/tbxform.hxx2
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.cxx17
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hxx20
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.cxx17
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.hxx19
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.cxx6
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.hxx4
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx23
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hxx29
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx29
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx20
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx20
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx23
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx23
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx31
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx15
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hxx13
-rw-r--r--svx/source/sidebar/tools/Popup.cxx6
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx12
-rw-r--r--svx/source/svdraw/svdedxv.cxx22
-rw-r--r--svx/source/svdraw/svdibrow.cxx17
-rw-r--r--svx/source/svdraw/svdmrkv.cxx2
-rw-r--r--svx/source/svdraw/svdpntv.cxx20
-rw-r--r--svx/source/svdraw/svdview.cxx4
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx15
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx14
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx33
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.hxx8
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx4
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx22
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx23
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx16
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx5
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx6
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx31
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx40
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx3
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx3
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx7
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx12
-rw-r--r--svx/source/unodraw/recoveryui.cxx2
-rw-r--r--svx/source/unodraw/unoshtxt.cxx2
84 files changed, 1196 insertions, 829 deletions
diff --git a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
index 3be00eee0bf4..39e5511b23e0 100644
--- a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
+++ b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
@@ -19,6 +19,7 @@
#include <svx/AccessibleShapeTreeInfo.hxx>
+#include <vcl/window.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
diff --git a/svx/source/accessibility/GraphCtlAccessibleContext.cxx b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
index 12d983ad93b9..238a351d99d0 100644
--- a/svx/source/accessibility/GraphCtlAccessibleContext.cxx
+++ b/svx/source/accessibility/GraphCtlAccessibleContext.cxx
@@ -76,7 +76,7 @@ SvxGraphCtrlAccessibleContext::SvxGraphCtrlAccessibleContext(
mnClientId( 0 ),
mbDisposed( false )
{
- if (mpControl != NULL)
+ if (mpControl != nullptr)
{
mpModel = mpControl->GetSdrModel();
if (mpModel != NULL)
@@ -478,7 +478,7 @@ void SAL_CALL SvxGraphCtrlAccessibleContext::grabFocus() throw( RuntimeException
{
::SolarMutexGuard aGuard;
- if( NULL == mpControl )
+ if( nullptr == mpControl )
throw DisposedException();
mpControl->GrabFocus();
@@ -729,7 +729,7 @@ Rectangle SvxGraphCtrlAccessibleContext::GetBoundingBoxOnScreen( void ) throw( R
{
::SolarMutexGuard aGuard;
- if( NULL == mpControl )
+ if( nullptr == mpControl )
throw DisposedException();
return Rectangle(
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index 4f79f3a4d715..535133608bb0 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -86,12 +86,13 @@ public:
class MaskSet : public ValueSet
{
- SvxBmpMask* pSvxBmpMask;
+ VclPtr<SvxBmpMask> pSvxBmpMask;
public:
MaskSet(SvxBmpMask* pMask, vcl::Window* pParent);
-
+ virtual ~MaskSet() { dispose(); }
+ virtual void dispose() SAL_OVERRIDE { pSvxBmpMask.clear(); ValueSet::dispose(); }
virtual void Select() SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
@@ -162,7 +163,7 @@ void MaskSet::onEditColor()
class MaskData
{
- SvxBmpMask* pMask;
+ VclPtr<SvxBmpMask> pMask;
bool bIsReady;
bool bExecState;
SfxBindings& rBindings;
@@ -490,12 +491,28 @@ SvxBmpMask::~SvxBmpMask()
void SvxBmpMask::dispose()
{
- delete m_pQSet1;
- delete m_pQSet2;
- delete m_pQSet3;
- delete m_pQSet4;
- delete m_pCtlPipette;
+ m_pQSet1.clear();
+ m_pQSet2.clear();
+ m_pQSet3.clear();
+ m_pQSet4.clear();
+ m_pCtlPipette.clear();
delete pData;
+ m_pTbxPipette.clear();
+ m_pBtnExec.clear();
+ m_pCbx1.clear();
+ m_pSp1.clear();
+ m_pLbColor1.clear();
+ m_pCbx2.clear();
+ m_pSp2.clear();
+ m_pLbColor2.clear();
+ m_pCbx3.clear();
+ m_pSp3.clear();
+ m_pLbColor3.clear();
+ m_pCbx4.clear();
+ m_pSp4.clear();
+ m_pLbColor4.clear();
+ m_pCbxTrans.clear();
+ m_pLbColorTrans.clear();
SfxDockingWindow::dispose();
}
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index ad604f2bc7c1..b3e041eeed30 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -86,6 +86,22 @@ SvxContourDlg::SvxContourDlg(SfxBindings* _pBindings, SfxChildWindow* pCW,
{
}
+SvxContourDlg::~SvxContourDlg()
+{
+ dispose();
+}
+
+void SvxContourDlg::dispose()
+{
+ pSuperClass.clear();
+ SfxFloatingWindow::dispose();
+}
+
+void SvxContourDlg::SetSuperClass( SvxSuperContourDlg& rSuperClass )
+{
+ pSuperClass = &rSuperClass;
+}
+
tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
const Rectangle* pRect,
const sal_uIntPtr nFlags )
@@ -285,7 +301,10 @@ void SvxSuperContourDlg::dispose()
{
SvtMiscOptions aMiscOptions;
aMiscOptions.RemoveListenerLink( LINK(this, SvxSuperContourDlg, MiscHdl) );
- delete m_pContourWnd;
+ m_pContourWnd.clear();
+ m_pTbx1.clear();
+ m_pMtfTolerance.clear();
+ m_pStbStatus.clear();
SvxContourDlg::dispose();
}
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index 336bfdc9268b..e8fc165edc79 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -65,6 +65,31 @@ CompressGraphicsDialog::CompressGraphicsDialog( vcl::Window* pParent, Graphic& r
Initialize();
}
+CompressGraphicsDialog::~CompressGraphicsDialog()
+{
+ dispose();
+}
+
+void CompressGraphicsDialog::dispose()
+{
+ m_pLabelGraphicType.clear();
+ m_pFixedText2.clear();
+ m_pFixedText3.clear();
+ m_pFixedText5.clear();
+ m_pFixedText6.clear();
+ m_pReduceResolutionCB.clear();
+ m_pMFNewWidth.clear();
+ m_pMFNewHeight.clear();
+ m_pResolutionLB.clear();
+ m_pLosslessRB.clear();
+ m_pJpegCompRB.clear();
+ m_pCompressionMF.clear();
+ m_pQualityMF.clear();
+ m_pBtnCalculate.clear();
+ m_pInterpolationCombo.clear();
+ ModalDialog::dispose();
+}
+
void CompressGraphicsDialog::Initialize()
{
get(m_pLabelGraphicType, "label-graphic-type");
diff --git a/svx/source/dialog/contimp.hxx b/svx/source/dialog/contimp.hxx
index 13bc7be668ee..432f7b91aba7 100644
--- a/svx/source/dialog/contimp.hxx
+++ b/svx/source/dialog/contimp.hxx
@@ -42,10 +42,10 @@ class SvxSuperContourDlg : public SvxContourDlg
void* pUpdateEditingObject;
void* pCheckObj;
SvxContourDlgItem aContourItem;
- ToolBox* m_pTbx1;
- MetricField* m_pMtfTolerance;
- ContourWindow* m_pContourWnd;
- StatusBar* m_pStbStatus;
+ VclPtr<ToolBox> m_pTbx1;
+ VclPtr<MetricField> m_pMtfTolerance;
+ VclPtr<ContourWindow> m_pContourWnd;
+ VclPtr<StatusBar> m_pStbStatus;
sal_uIntPtr nGrfChanged;
bool bExecState;
bool bUpdateGraphicLinked;
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 0d2e53039841..ac7957d8061c 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -423,7 +423,12 @@ SvxTPView::~SvxTPView()
void SvxTPView::dispose()
{
- delete m_pViewData;
+ m_pViewData.clear();
+ m_pAccept.clear();
+ m_pReject.clear();
+ m_pAcceptAll.clear();
+ m_pRejectAll.clear();
+ m_pUndo.clear();
TabPage::dispose();
}
@@ -597,6 +602,35 @@ SvxTPFilter::SvxTPFilter( vcl::Window * pParent)
bModified=false;
}
+SvxTPFilter::~SvxTPFilter()
+{
+ dispose();
+}
+
+void SvxTPFilter::dispose()
+{
+ pRedlinTable.clear();
+ m_pCbDate.clear();
+ m_pLbDate.clear();
+ m_pDfDate.clear();
+ m_pTfDate.clear();
+ m_pIbClock.clear();
+ m_pFtDate2.clear();
+ m_pDfDate2.clear();
+ m_pTfDate2.clear();
+ m_pIbClock2.clear();
+ m_pCbAuthor.clear();
+ m_pLbAuthor.clear();
+ m_pCbRange.clear();
+ m_pEdRange.clear();
+ m_pBtnRange.clear();
+ m_pCbAction.clear();
+ m_pLbAction.clear();
+ m_pCbComment.clear();
+ m_pEdComment.clear();
+ TabPage::dispose();
+}
+
void SvxTPFilter::SetRedlinTable(SvxRedlinTable* pTable)
{
pRedlinTable=pTable;
@@ -963,7 +997,7 @@ void SvxTPFilter::DeactivatePage()
{
if(bModified)
{
- if(pRedlinTable!=NULL)
+ if(pRedlinTable!=nullptr)
{
pRedlinTable->SetFilterDate(IsDate());
pRedlinTable->SetDateTimeMode(GetDateMode());
@@ -1016,7 +1050,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF)
if(m_pDfDate->GetText().isEmpty())
m_pDfDate->SetDate(aDate);
- if(pRedlinTable!=NULL)
+ if(pRedlinTable!=nullptr)
pRedlinTable->SetFirstDate(m_pDfDate->GetDate());
}
else if (m_pDfDate2==pTF)
@@ -1024,7 +1058,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF)
if(m_pDfDate2->GetText().isEmpty())
m_pDfDate2->SetDate(aDate);
- if(pRedlinTable!=NULL)
+ if(pRedlinTable!=nullptr)
pRedlinTable->SetLastDate(m_pDfDate2->GetDate());
}
else if (m_pTfDate==pTF)
@@ -1032,7 +1066,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF)
if(m_pTfDate->GetText().isEmpty())
m_pTfDate->SetTime(aTime);
- if(pRedlinTable!=NULL)
+ if(pRedlinTable!=nullptr)
pRedlinTable->SetFirstTime(m_pTfDate->GetTime());
}
else if (m_pTfDate2==pTF)
@@ -1040,7 +1074,7 @@ IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF)
if(m_pTfDate2->GetText().isEmpty())
m_pTfDate2->SetTime(aTime);
- if(pRedlinTable!=NULL)
+ if(pRedlinTable!=nullptr)
pRedlinTable->SetLastTime(m_pTfDate2->GetTime());
}
@@ -1084,11 +1118,9 @@ SvxAcceptChgCtr::~SvxAcceptChgCtr()
void SvxAcceptChgCtr::dispose()
{
- delete pTPView;
- pTPView = NULL;
- delete pTPFilter;
- pTPFilter = NULL;
disposeBuilder();
+ pTPFilter.clear();
+ pTPView.clear();
TabControl::dispose();
}
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index f704de3a0cd1..9de79a90c576 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -666,6 +666,19 @@ SaveDialog::SaveDialog(vcl::Window* pParent, RecoveryCore* pCore)
}
}
+SaveDialog::~SaveDialog()
+{
+ dispose();
+}
+
+void SaveDialog::dispose()
+{
+ m_pTitleFT.clear();
+ m_pFileListLB.clear();
+ m_pOkBtn.clear();
+ Dialog::dispose();
+}
+
IMPL_LINK_NOARG(SaveDialog, OKButtonHdl)
{
// start crash-save with progress
@@ -696,6 +709,17 @@ SaveProgressDialog::SaveProgressDialog(vcl::Window* pParent, RecoveryCore* pCore
m_xProgress = css::uno::Reference< css::task::XStatusIndicator >(static_cast< css::task::XStatusIndicator* >(pProgress), css::uno::UNO_QUERY_THROW);
}
+SaveProgressDialog::~SaveProgressDialog()
+{
+ dispose();
+}
+
+void SaveProgressDialog::dispose()
+{
+ m_pProgrParent.clear();
+ ModalDialog::dispose();
+}
+
short SaveProgressDialog::Execute()
{
::SolarMutexGuard aLock;
@@ -908,8 +932,12 @@ RecoveryDialog::~RecoveryDialog()
void RecoveryDialog::dispose()
{
- delete m_pFileListLB;
- m_pFileListLB = NULL;
+ m_pFileListLB.clear();
+ m_pTitleFT.clear();
+ m_pDescrFT.clear();
+ m_pProgrParent.clear();
+ m_pNextBtn.clear();
+ m_pCancelBtn.clear();
Dialog::dispose();
}
@@ -1240,6 +1268,21 @@ BrokenRecoveryDialog::BrokenRecoveryDialog(vcl::Window* pParent ,
impl_refresh();
}
+BrokenRecoveryDialog::~BrokenRecoveryDialog()
+{
+ dispose();
+}
+
+void BrokenRecoveryDialog::dispose()
+{
+ m_pFileListLB.clear();
+ m_pSaveDirED.clear();
+ m_pSaveDirBtn.clear();
+ m_pOkBtn.clear();
+ m_pCancelBtn.clear();
+ ModalDialog::dispose();
+}
+
void BrokenRecoveryDialog::impl_refresh()
{
diff --git a/svx/source/dialog/fontwork.cxx b/svx/source/dialog/fontwork.cxx
index 9a4777c516db..a2e705e144f0 100644
--- a/svx/source/dialog/fontwork.cxx
+++ b/svx/source/dialog/fontwork.cxx
@@ -163,8 +163,14 @@ SvxFontWorkChildWindow::SvxFontWorkChildWindow
SfxChildWindow( _pParent, nId )
{
+<<<<<<< HEAD
SvxFontWorkDialog* pDlg = new SvxFontWorkDialog(pBindings, this, _pParent);
pWindow = pDlg;
+=======
+ pWindow = new SvxFontWorkDialog( pBindings, this, _pParent,
+ SVX_RES( RID_SVXDLG_FONTWORK ) );
+ SvxFontWorkDialog* pDlg = static_cast<SvxFontWorkDialog*>(pWindow.get());
+>>>>>>> 765a16f... vclwidget: change all vcl::window fields to be wrapped in VclPtr
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
@@ -243,7 +249,6 @@ SvxFontWorkDialog::SvxFontWorkDialog(SfxBindings *pBindinx,
pCtrlItems[9] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWXVAL, *this, rBindings);
pCtrlItems[10] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWYVAL, *this, rBindings);
-<<<<<<< HEAD
Size aSize = m_pTbxStyle->CalcWindowSizePixel();
m_pTbxStyle->SetSizePixel(aSize);
m_pTbxStyle->SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectStyleHdl_Impl) );
@@ -282,46 +287,6 @@ SvxFontWorkDialog::SvxFontWorkDialog(SfxBindings *pBindinx,
}
m_pShadowColorLB->SetSelectHdl( LINK(this, SvxFontWorkDialog, ColorSelectHdl_Impl) );
-=======
- Size aSize = aTbxStyle->CalcWindowSizePixel();
- aTbxStyle->SetSizePixel(aSize);
- aTbxStyle->SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectStyleHdl_Impl) );
-
- aTbxAdjust->SetSizePixel(aSize);
- aTbxAdjust->SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectAdjustHdl_Impl) );
-
- aTbxShadow->SetSizePixel(aSize);
- aTbxShadow->SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectShadowHdl_Impl) );
-
- Link aLink = LINK(this, SvxFontWorkDialog, ModifyInputHdl_Impl);
- aMtrFldDistance->SetModifyHdl( aLink );
- aMtrFldTextStart->SetModifyHdl( aLink );
- aMtrFldShadowX->SetModifyHdl( aLink );
- aMtrFldShadowY->SetModifyHdl( aLink );
-
- // Set System metric
- const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit();
- SetFieldUnit( *aMtrFldDistance.get(), eDlgUnit, true );
- SetFieldUnit( *aMtrFldTextStart.get(), eDlgUnit, true );
- SetFieldUnit( *aMtrFldShadowX.get(), eDlgUnit, true );
- SetFieldUnit( *aMtrFldShadowY.get(), eDlgUnit, true );
- if( eDlgUnit == FUNIT_MM )
- {
- aMtrFldDistance->SetSpinSize( 50 );
- aMtrFldTextStart->SetSpinSize( 50 );
- aMtrFldShadowX->SetSpinSize( 50 );
- aMtrFldShadowY->SetSpinSize( 50 );
- }
- else
- {
- aMtrFldDistance->SetSpinSize( 10 );
- aMtrFldTextStart->SetSpinSize( 10 );
- aMtrFldShadowX->SetSpinSize( 10 );
- aMtrFldShadowY->SetSpinSize( 10 );
- }
-
- aShadowColorLB->SetSelectHdl( LINK(this, SvxFontWorkDialog, ColorSelectHdl_Impl) );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
aInputIdle.SetPriority(SchedulerPriority::LOWEST);
aInputIdle.SetIdleHdl(LINK(this, SvxFontWorkDialog, InputTimoutHdl_Impl));
@@ -406,16 +371,11 @@ void SvxFontWorkDialog::SetStyle_Impl(const XFormTextStyleItem* pItem)
case XFT_SLANTY : nId = nStyleSlantYId; break;
default: ;//prevent warning
}
-<<<<<<< HEAD
m_pTbxStyle->Enable();
-=======
- aTbxStyle->Enable();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
// Make sure that there is always exactly one checked toolbox item.
if ( pItem->GetValue() == XFT_NONE )
{
-<<<<<<< HEAD
m_pTbxStyle->CheckItem(nStyleRotateId, false);
m_pTbxStyle->CheckItem(nStyleUprightId, false);
m_pTbxStyle->CheckItem(nStyleSlantXId, false);
@@ -427,29 +387,12 @@ void SvxFontWorkDialog::SetStyle_Impl(const XFormTextStyleItem* pItem)
{
m_pTbxStyle->CheckItem(nStyleOffId, false);
m_pTbxStyle->CheckItem(nId);
-=======
- aTbxStyle->CheckItem(TBI_STYLE_ROTATE, false);
- aTbxStyle->CheckItem(TBI_STYLE_UPRIGHT, false);
- aTbxStyle->CheckItem(TBI_STYLE_SLANTX, false);
- aTbxStyle->CheckItem(TBI_STYLE_SLANTY, false);
-
- aTbxStyle->CheckItem(TBI_STYLE_OFF, true);
- }
- else
- {
- aTbxStyle->CheckItem(TBI_STYLE_OFF, false);
- aTbxStyle->CheckItem(nId);
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
nLastStyleTbxId = nId;
}
else
-<<<<<<< HEAD
m_pTbxStyle->Disable();
-=======
- aTbxStyle->Disable();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
// Set adjust buttons
@@ -460,7 +403,6 @@ void SvxFontWorkDialog::SetAdjust_Impl(const XFormTextAdjustItem* pItem)
{
sal_uInt16 nId;
-<<<<<<< HEAD
m_pTbxAdjust->Enable();
m_pMtrFldDistance->Enable();
@@ -480,41 +422,14 @@ void SvxFontWorkDialog::SetAdjust_Impl(const XFormTextAdjustItem* pItem)
if ( !m_pTbxAdjust->IsItemChecked(nId) )
{
m_pTbxAdjust->CheckItem(nId);
-=======
- aTbxAdjust->Enable();
- aMtrFldDistance->Enable();
-
- if ( pItem->GetValue() == XFT_LEFT || pItem->GetValue() == XFT_RIGHT )
- {
- if ( pItem->GetValue() == XFT_LEFT ) nId = TBI_ADJUST_LEFT;
- else nId = TBI_ADJUST_RIGHT;
- aMtrFldTextStart->Enable();
- }
- else
- {
- if ( pItem->GetValue() == XFT_CENTER ) nId = TBI_ADJUST_CENTER;
- else nId = TBI_ADJUST_AUTOSIZE;
- aMtrFldTextStart->Disable();
- }
-
- if ( !aTbxAdjust->IsItemChecked(nId) )
- {
- aTbxAdjust->CheckItem(nId);
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
nLastAdjustTbxId = nId;
}
else
{
-<<<<<<< HEAD
m_pTbxAdjust->Disable();
m_pMtrFldTextStart->Disable();
m_pMtrFldDistance->Disable();
-=======
- aTbxAdjust->Disable();
- aMtrFldTextStart->Disable();
- aMtrFldDistance->Disable();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
}
@@ -523,15 +438,9 @@ void SvxFontWorkDialog::SetAdjust_Impl(const XFormTextAdjustItem* pItem)
void SvxFontWorkDialog::SetDistance_Impl(const XFormTextDistanceItem* pItem)
{
// Use HasChildPathFocus() instead of HasFocus() at SpinFields
-<<<<<<< HEAD
if ( pItem && !m_pMtrFldDistance->HasChildPathFocus() )
{
SetMetricValue(*m_pMtrFldDistance, pItem->GetValue(), SFX_MAPUNIT_100TH_MM);
-=======
- if ( pItem && !aMtrFldDistance->HasChildPathFocus() )
- {
- SetMetricValue( *aMtrFldDistance.get(), pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
}
@@ -540,15 +449,9 @@ void SvxFontWorkDialog::SetDistance_Impl(const XFormTextDistanceItem* pItem)
void SvxFontWorkDialog::SetStart_Impl(const XFormTextStartItem* pItem)
{
// Use HasChildPathFocus() instead of HasFocus() at SpinFields
-<<<<<<< HEAD
if ( pItem && !m_pMtrFldTextStart->HasChildPathFocus() )
{
SetMetricValue(*m_pMtrFldTextStart, pItem->GetValue(), SFX_MAPUNIT_100TH_MM);
-=======
- if ( pItem && !aMtrFldTextStart->HasChildPathFocus() )
- {
- SetMetricValue( *aMtrFldTextStart.get(), pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
}
@@ -557,11 +460,7 @@ void SvxFontWorkDialog::SetStart_Impl(const XFormTextStartItem* pItem)
void SvxFontWorkDialog::SetMirror_Impl(const XFormTextMirrorItem* pItem)
{
if ( pItem )
-<<<<<<< HEAD
m_pTbxAdjust->CheckItem(nAdjustMirrorId, pItem->GetValue());
-=======
- aTbxAdjust->CheckItem(TBI_ADJUST_MIRROR, pItem->GetValue());
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
// Set button for contour display
@@ -569,11 +468,7 @@ void SvxFontWorkDialog::SetMirror_Impl(const XFormTextMirrorItem* pItem)
void SvxFontWorkDialog::SetShowForm_Impl(const XFormTextHideFormItem* pItem)
{
if ( pItem )
-<<<<<<< HEAD
m_pTbxShadow->CheckItem(nShowFormId, !pItem->GetValue());
-=======
- aTbxShadow->CheckItem(TBI_SHOWFORM, !pItem->GetValue());
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
// Set button for text border
@@ -581,11 +476,7 @@ void SvxFontWorkDialog::SetShowForm_Impl(const XFormTextHideFormItem* pItem)
void SvxFontWorkDialog::SetOutline_Impl(const XFormTextOutlineItem* pItem)
{
if ( pItem )
-<<<<<<< HEAD
m_pTbxShadow->CheckItem(nOutlineId, pItem->GetValue());
-=======
- aTbxShadow->CheckItem(TBI_OUTLINE, pItem->GetValue());
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
// Set shadow buttons
@@ -597,7 +488,6 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
{
sal_uInt16 nId;
-<<<<<<< HEAD
m_pTbxShadow->Enable();
if ( pItem->GetValue() == XFTSHADOW_NONE )
@@ -616,33 +506,12 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
m_pMtrFldShadowX->Enable();
m_pMtrFldShadowY->Enable();
m_pShadowColorLB->Enable();
-=======
- aTbxShadow->Enable();
-
- if ( pItem->GetValue() == XFTSHADOW_NONE )
- {
- nId = TBI_SHADOW_OFF;
- aFbShadowX->Hide();
- aFbShadowY->Hide();
- aMtrFldShadowX->Disable();
- aMtrFldShadowY->Disable();
- aShadowColorLB->Disable();
- }
- else
- {
- aFbShadowX->Show();
- aFbShadowY->Show();
- aMtrFldShadowX->Enable();
- aMtrFldShadowY->Enable();
- aShadowColorLB->Enable();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
if ( pItem->GetValue() == XFTSHADOW_NORMAL )
{
nId = nShadowNormalId;
const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit();
-<<<<<<< HEAD
m_pMtrFldShadowX->SetUnit( eDlgUnit );
m_pMtrFldShadowX->SetDecimalDigits(2);
m_pMtrFldShadowX->SetMin(LONG_MIN);
@@ -665,30 +534,6 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
{
SetMetricValue(*m_pMtrFldShadowX, nSaveShadowX, SFX_MAPUNIT_100TH_MM);
SetMetricValue(*m_pMtrFldShadowY, nSaveShadowY, SFX_MAPUNIT_100TH_MM);
-=======
- aMtrFldShadowX->SetUnit( eDlgUnit );
- aMtrFldShadowX->SetDecimalDigits(2);
- aMtrFldShadowX->SetMin(LONG_MIN);
- aMtrFldShadowX->SetMax(LONG_MAX);
- if( eDlgUnit == FUNIT_MM )
- aMtrFldShadowX->SetSpinSize( 50 );
- else
- aMtrFldShadowX->SetSpinSize( 10 );
-
- aMtrFldShadowY->SetUnit( eDlgUnit );
- aMtrFldShadowY->SetDecimalDigits(2);
- aMtrFldShadowY->SetMin(LONG_MIN);
- aMtrFldShadowY->SetMax(LONG_MAX);
- if( eDlgUnit == FUNIT_MM )
- aMtrFldShadowY->SetSpinSize( 50 );
- else
- aMtrFldShadowY->SetSpinSize( 10 );
-
- if ( bRestoreValues )
- {
- SetMetricValue( *aMtrFldShadowX.get(), nSaveShadowX, SFX_MAPUNIT_100TH_MM );
- SetMetricValue( *aMtrFldShadowY.get(), nSaveShadowY, SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
XFormTextShadowXValItem aXItem( nSaveShadowX );
XFormTextShadowYValItem aYItem( nSaveShadowY );
@@ -701,7 +546,6 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
{
nId = nShadowSlantId;
-<<<<<<< HEAD
m_pMtrFldShadowX->SetUnit(FUNIT_DEGREE);
m_pMtrFldShadowX->SetDecimalDigits(1);
m_pMtrFldShadowX->SetMin(-1800);
@@ -718,24 +562,6 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
{
m_pMtrFldShadowX->SetValue(nSaveShadowAngle);
m_pMtrFldShadowY->SetValue(nSaveShadowSize);
-=======
- aMtrFldShadowX->SetUnit(FUNIT_CUSTOM);
- aMtrFldShadowX->SetDecimalDigits(1);
- aMtrFldShadowX->SetMin(-1800);
- aMtrFldShadowX->SetMax( 1800);
- aMtrFldShadowX->SetSpinSize(10);
-
- aMtrFldShadowY->SetUnit(FUNIT_PERCENT);
- aMtrFldShadowY->SetDecimalDigits(0);
- aMtrFldShadowY->SetMin(-999);
- aMtrFldShadowY->SetMax( 999);
- aMtrFldShadowY->SetSpinSize(10);
-
- if ( bRestoreValues )
- {
- aMtrFldShadowX->SetValue(nSaveShadowAngle);
- aMtrFldShadowY->SetValue(nSaveShadowSize);
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
XFormTextShadowXValItem aXItem(nSaveShadowAngle);
XFormTextShadowYValItem aYItem(nSaveShadowSize);
GetBindings().GetDispatcher()->Execute(
@@ -744,15 +570,9 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
}
}
-<<<<<<< HEAD
if ( !m_pTbxShadow->IsItemChecked(nId) )
{
m_pTbxShadow->CheckItem(nId);
-=======
- if ( !aTbxShadow->IsItemChecked(nId) )
- {
- aTbxShadow->CheckItem(nId);
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
nLastShadowTbxId = nId;
@@ -760,17 +580,10 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
}
else
{
-<<<<<<< HEAD
m_pTbxShadow->Disable();
m_pMtrFldShadowX->Disable();
m_pMtrFldShadowY->Disable();
m_pShadowColorLB->Disable();
-=======
- aTbxShadow->Disable();
- aMtrFldShadowX->Disable();
- aMtrFldShadowY->Disable();
- aShadowColorLB->Disable();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
}
@@ -779,11 +592,7 @@ void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
void SvxFontWorkDialog::SetShadowColor_Impl(const XFormTextShadowColorItem* pItem)
{
if ( pItem )
-<<<<<<< HEAD
m_pShadowColorLB->SelectEntry(pItem->GetColorValue());
-=======
- aShadowColorLB->SelectEntry(pItem->GetColorValue());
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
// Enter X-value for shadow in edit field
@@ -791,11 +600,7 @@ void SvxFontWorkDialog::SetShadowColor_Impl(const XFormTextShadowColorItem* pIte
void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem)
{
// Use HasChildPathFocus() instead of HasFocus() at SpinFields
-<<<<<<< HEAD
if ( pItem && !m_pMtrFldShadowX->HasChildPathFocus() )
-=======
- if ( pItem && !aMtrFldShadowX->HasChildPathFocus() )
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
{
// #i19251#
// sal_Int32 nValue = pItem->GetValue();
@@ -804,11 +609,7 @@ void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem)
// The two involved fields/items are used double and contain/give different
// values regarding to the access method. Thus, here we need to separate the access
// methos regarding to the kind of value accessed.
-<<<<<<< HEAD
if (m_pTbxShadow->IsItemChecked(nShadowSlantId))
-=======
- if(aTbxShadow->IsItemChecked(TBI_SHADOW_SLANT))
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
{
// #i19251#
// There is no value correction necessary at all, i think this
@@ -816,19 +617,11 @@ void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem)
// involved fields/items are used double and contain/give different
// values regarding to the access method.
// nValue = nValue - ( int( float( nValue ) / 360.0 ) * 360 );
-<<<<<<< HEAD
m_pMtrFldShadowX->SetValue(pItem->GetValue());
}
else
{
SetMetricValue(*m_pMtrFldShadowX, pItem->GetValue(), SFX_MAPUNIT_100TH_MM);
-=======
- aMtrFldShadowX->SetValue(pItem->GetValue());
- }
- else
- {
- SetMetricValue( *aMtrFldShadowX.get(), pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
}
}
@@ -838,17 +631,12 @@ void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem)
void SvxFontWorkDialog::SetShadowYVal_Impl(const XFormTextShadowYValItem* pItem)
{
// Use HasChildPathFocus() instead of HasFocus() at SpinFields
-<<<<<<< HEAD
if ( pItem && !m_pMtrFldShadowY->HasChildPathFocus() )
-=======
- if ( pItem && !aMtrFldShadowY->HasChildPathFocus() )
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
{
// #i19251#
// The two involved fields/items are used double and contain/give different
// values regarding to the access method. Thus, here we need to separate the access
// methos regarding to the kind of value accessed.
-<<<<<<< HEAD
if (m_pTbxShadow->IsItemChecked(nShadowSlantId))
{
m_pMtrFldShadowY->SetValue(pItem->GetValue());
@@ -856,26 +644,13 @@ void SvxFontWorkDialog::SetShadowYVal_Impl(const XFormTextShadowYValItem* pItem)
else
{
SetMetricValue(*m_pMtrFldShadowY, pItem->GetValue(), SFX_MAPUNIT_100TH_MM);
-=======
- if(aTbxShadow->IsItemChecked(TBI_SHADOW_SLANT))
- {
- aMtrFldShadowY->SetValue(pItem->GetValue());
- }
- else
- {
- SetMetricValue( *aMtrFldShadowY.get(), pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
}
}
IMPL_LINK_NOARG(SvxFontWorkDialog, SelectStyleHdl_Impl)
{
-<<<<<<< HEAD
sal_uInt16 nId = m_pTbxStyle->GetCurItemId();
-=======
- sal_uInt16 nId = aTbxStyle->GetCurItemId();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
// Execute this block when a different toolbox item has been clicked or
// when the off item has been clicked. The later is necessary to
@@ -905,19 +680,11 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, SelectStyleHdl_Impl)
IMPL_LINK_NOARG(SvxFontWorkDialog, SelectAdjustHdl_Impl)
{
-<<<<<<< HEAD
sal_uInt16 nId = m_pTbxAdjust->GetCurItemId();
-=======
- sal_uInt16 nId = aTbxAdjust->GetCurItemId();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
if (nId == nAdjustMirrorId)
{
-<<<<<<< HEAD
XFormTextMirrorItem aItem(m_pTbxAdjust->IsItemChecked(nId));
-=======
- XFormTextMirrorItem aItem(aTbxAdjust->IsItemChecked(nId));
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_MIRROR, SfxCallMode::SLOT, &aItem, 0L );
}
else if ( nId != nLastAdjustTbxId )
@@ -941,28 +708,16 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, SelectAdjustHdl_Impl)
IMPL_LINK_NOARG(SvxFontWorkDialog, SelectShadowHdl_Impl)
{
-<<<<<<< HEAD
sal_uInt16 nId = m_pTbxShadow->GetCurItemId();
-=======
- sal_uInt16 nId = aTbxShadow->GetCurItemId();
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
if (nId == nShowFormId)
{
-<<<<<<< HEAD
XFormTextHideFormItem aItem(!m_pTbxShadow->IsItemChecked(nId));
-=======
- XFormTextHideFormItem aItem(!aTbxShadow->IsItemChecked(nId));
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_HIDEFORM, SfxCallMode::RECORD, &aItem, 0L );
}
else if (nId == nOutlineId)
{
-<<<<<<< HEAD
XFormTextOutlineItem aItem(m_pTbxShadow->IsItemChecked(nId));
-=======
- XFormTextOutlineItem aItem(aTbxShadow->IsItemChecked(nId));
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_OUTLINE, SfxCallMode::RECORD, &aItem, 0L );
}
else if (nId != nLastShadowTbxId)
@@ -971,23 +726,13 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, SelectShadowHdl_Impl)
if (nLastShadowTbxId == nShadowNormalId)
{
-<<<<<<< HEAD
nSaveShadowX = GetCoreValue(*m_pMtrFldShadowX, SFX_MAPUNIT_100TH_MM);
nSaveShadowY = GetCoreValue(*m_pMtrFldShadowY, SFX_MAPUNIT_100TH_MM);
-=======
- nSaveShadowX = GetCoreValue( *aMtrFldShadowX.get(), SFX_MAPUNIT_100TH_MM );
- nSaveShadowY = GetCoreValue( *aMtrFldShadowY.get(), SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
else if (nLastShadowTbxId == nShadowSlantId)
{
-<<<<<<< HEAD
nSaveShadowAngle = static_cast<long>(m_pMtrFldShadowX->GetValue());
nSaveShadowSize = static_cast<long>(m_pMtrFldShadowY->GetValue());
-=======
- nSaveShadowAngle = static_cast<long>(aMtrFldShadowX->GetValue());
- nSaveShadowSize = static_cast<long>(aMtrFldShadowY->GetValue());
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
nLastShadowTbxId = nId;
@@ -1014,7 +759,6 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl)
// listen, this is however not possible at the moment due to compabillity
// issues.
const FieldUnit eDlgUnit = rBindings.GetDispatcher()->GetModule()->GetFieldUnit();
-<<<<<<< HEAD
if( eDlgUnit != m_pMtrFldDistance->GetUnit() )
{
SetFieldUnit(*m_pMtrFldDistance, eDlgUnit, true);
@@ -1034,27 +778,6 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl)
long nValue = GetCoreValue(*m_pMtrFldDistance, SFX_MAPUNIT_100TH_MM);
XFormTextDistanceItem aDistItem( nValue );
nValue = GetCoreValue(*m_pMtrFldTextStart, SFX_MAPUNIT_100TH_MM);
-=======
- if( eDlgUnit != aMtrFldDistance->GetUnit() )
- {
- SetFieldUnit( *aMtrFldDistance.get(), eDlgUnit, true );
- SetFieldUnit( *aMtrFldTextStart.get(), eDlgUnit, true );
- aMtrFldDistance->SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
- aMtrFldTextStart->SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
- }
- if( eDlgUnit != aMtrFldShadowX->GetUnit() &&
- aTbxShadow->IsItemChecked( TBI_SHADOW_NORMAL ) )
- {
- SetFieldUnit( *aMtrFldShadowX.get(), eDlgUnit, true );
- SetFieldUnit( *aMtrFldShadowY.get(), eDlgUnit, true );
- aMtrFldShadowX->SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
- aMtrFldShadowY->SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
- }
-
- long nValue = GetCoreValue( *aMtrFldDistance.get(), SFX_MAPUNIT_100TH_MM );
- XFormTextDistanceItem aDistItem( nValue );
- nValue = GetCoreValue( *aMtrFldTextStart.get(), SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
XFormTextStartItem aStartItem( nValue );
sal_Int32 nValueX(0L);
@@ -1066,23 +789,13 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl)
// methos regarding to the kind of value accessed.
if (nLastShadowTbxId == nShadowNormalId)
{
-<<<<<<< HEAD
nValueX = GetCoreValue(*m_pMtrFldShadowX, SFX_MAPUNIT_100TH_MM);
nValueY = GetCoreValue(*m_pMtrFldShadowY, SFX_MAPUNIT_100TH_MM);
-=======
- nValueX = GetCoreValue( *aMtrFldShadowX.get(), SFX_MAPUNIT_100TH_MM );
- nValueY = GetCoreValue( *aMtrFldShadowY.get(), SFX_MAPUNIT_100TH_MM );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
else if (nLastShadowTbxId == nShadowSlantId)
{
-<<<<<<< HEAD
nValueX = static_cast<long>(m_pMtrFldShadowX->GetValue());
nValueY = static_cast<long>(m_pMtrFldShadowY->GetValue());
-=======
- nValueX = static_cast<long>(aMtrFldShadowX->GetValue());
- nValueY = static_cast<long>(aMtrFldShadowY->GetValue());
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
XFormTextShadowXValItem aShadowXItem( nValueX );
@@ -1096,11 +809,7 @@ IMPL_LINK_NOARG(SvxFontWorkDialog, InputTimoutHdl_Impl)
IMPL_LINK_NOARG(SvxFontWorkDialog, ColorSelectHdl_Impl)
{
-<<<<<<< HEAD
XFormTextShadowColorItem aItem( "", m_pShadowColorLB->GetSelectEntryColor() );
-=======
- XFormTextShadowColorItem aItem( "", aShadowColorLB->GetSelectEntryColor() );
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_SHDWCOLOR, SfxCallMode::RECORD, &aItem, 0L );
return 0;
}
@@ -1110,19 +819,13 @@ void SvxFontWorkDialog::SetColorList(const XColorListRef &pList)
if ( pList.is() && pList != pColorList )
{
pColorList = pList;
-<<<<<<< HEAD
m_pShadowColorLB->Clear();
m_pShadowColorLB->Fill(pColorList);
-=======
- aShadowColorLB->Clear();
- aShadowColorLB->Fill(pColorList);
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
}
void SvxFontWorkDialog::ApplyImageList()
{
-<<<<<<< HEAD
if (nLastShadowTbxId == nShadowSlantId)
{
m_pFbShadowX->SetImage(Image(SVX_RES(RID_SVXIMG_SHADOW_ANGLE)));
@@ -1133,29 +836,6 @@ void SvxFontWorkDialog::ApplyImageList()
m_pFbShadowX->SetImage(Image(SVX_RES(RID_SVXIMG_SHADOW_XDIST)));
m_pFbShadowY->SetImage(Image(SVX_RES(RID_SVXIMG_SHADOW_YDIST)));
}
-=======
- ImageList& rImgLst = maImageList;
-
- aTbxStyle->SetImageList( rImgLst );
- aTbxAdjust->SetImageList( rImgLst );
- aTbxShadow->SetImageList( rImgLst );
-
- switch( nLastShadowTbxId )
- {
- case TBI_SHADOW_SLANT:
- aFbShadowX->SetImage( rImgLst.GetImage( TBI_SHADOW_ANGLE ) );
- aFbShadowY->SetImage( rImgLst.GetImage( TBI_SHADOW_SIZE ) );
- break;
- default:
- aFbShadowX->SetImage( rImgLst.GetImage( TBI_SHADOW_XDIST ) );
- aFbShadowY->SetImage( rImgLst.GetImage( TBI_SHADOW_YDIST ) );
- break;
- }
-
- aFbDistance->SetImage( rImgLst.GetImage( TBI_DISTANCE ) );
- aFbTextStart->SetImage( rImgLst.GetImage( TBI_TEXTSTART ) );
-
->>>>>>> 71c7563... vcl: VclPtr conversion in svx (part1)
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index dd463c0460fc..65ea63526eaf 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -209,6 +209,22 @@ SvxHFPage::~SvxHFPage()
void SvxHFPage::dispose()
{
delete pBBSet;
+ m_pPageLbl.clear();
+ m_pTurnOnBox.clear();
+ m_pCntSharedBox.clear();
+ m_pCntSharedFirstBox.clear();
+ m_pLMLbl.clear();
+ m_pLMEdit.clear();
+ m_pRMLbl.clear();
+ m_pRMEdit.clear();
+ m_pDistFT.clear();
+ m_pDistEdit.clear();
+ m_pDynSpacingCB.clear();
+ m_pHeightFT.clear();
+ m_pHeightEdit.clear();
+ m_pHeightDynBtn.clear();
+ m_pBspWin.clear();
+ m_pBackgroundBtn.clear();
SfxTabPage::dispose();
}
diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx
index 534b0168b3cd..b7a9c2e256d9 100644
--- a/svx/source/dialog/imapdlg.cxx
+++ b/svx/source/dialog/imapdlg.cxx
@@ -96,7 +96,7 @@ SvxIMapDlgChildWindow::SvxIMapDlgChildWindow( vcl::Window* _pParent, sal_uInt16
SfxChildWindow( _pParent, nId )
{
pWindow = new SvxIMapDlg( pBindings, this, _pParent );
- SvxIMapDlg* pDlg = static_cast<SvxIMapDlg*>(pWindow);
+ SvxIMapDlg* pDlg = static_cast<SvxIMapDlg*>(pWindow.get());
if ( pInfo->nFlags & SfxChildWindowFlags::ZOOMIN )
pDlg->RollUp();
@@ -223,8 +223,16 @@ SvxIMapDlg::~SvxIMapDlg()
void SvxIMapDlg::dispose()
{
// Delete URL-List
- delete pIMapWnd;
+ pIMapWnd.clear();
delete pOwnData;
+ m_pTbxIMapDlg1.clear();
+ m_pFtURL.clear();
+ m_pURLBox.clear();
+ m_pFtText.clear();
+ m_pEdtText.clear();
+ m_pFtTarget.clear();
+ m_pCbbTarget.clear();
+ m_pStbStatus.clear();
SfxModelessDialog::dispose();
}
diff --git a/svx/source/dialog/linkwarn.cxx b/svx/source/dialog/linkwarn.cxx
index a256374ae7cd..8aeab4bf4748 100644
--- a/svx/source/dialog/linkwarn.cxx
+++ b/svx/source/dialog/linkwarn.cxx
@@ -53,6 +53,7 @@ void SvxLinkWarningDialog::dispose()
bool bChecked = m_pWarningOnBox->IsChecked();
if ( aMiscOpt.ShowLinkWarningDialog() != bChecked )
aMiscOpt.SetShowLinkWarningDialog( bChecked );
+ m_pWarningOnBox.clear();
MessageDialog::dispose();
}
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index aaea253bf8da..58c0f4a22d09 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -171,6 +171,33 @@ SvxGridTabPage::SvxGridTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet
LINK( this, SvxGridTabPage, ChangeDivisionHdl_Impl ) );
}
+SvxGridTabPage::~SvxGridTabPage()
+{
+ dispose();
+}
+
+void SvxGridTabPage::dispose()
+{
+ pCbxUseGridsnap.clear();
+ pCbxGridVisible.clear();
+ pMtrFldDrawX.clear();
+ pMtrFldDrawY.clear();
+ pNumFldDivisionX.clear();
+ pNumFldDivisionY.clear();
+ pCbxSynchronize.clear();
+ pSnapFrames.clear();
+ pCbxSnapHelplines.clear();
+ pCbxSnapBorder.clear();
+ pCbxSnapFrame.clear();
+ pCbxSnapPoints.clear();
+ pMtrFldSnapArea.clear();
+ pCbxOrtho.clear();
+ pCbxBigOrtho.clear();
+ pCbxRotate.clear();
+ pMtrFldAngle.clear();
+ pMtrFldBezAngle.clear();
+ SfxTabPage::dispose();
+}
SfxTabPage* SvxGridTabPage::Create( vcl::Window* pParent, const SfxItemSet& rAttrSet )
diff --git a/svx/source/dialog/orienthelper.cxx b/svx/source/dialog/orienthelper.cxx
index b1b61e9ed1a0..89ecc71dfed8 100644
--- a/svx/source/dialog/orienthelper.cxx
+++ b/svx/source/dialog/orienthelper.cxx
@@ -31,7 +31,7 @@ namespace svx {
struct OrientationHelper_Impl
{
- typedef std::pair< vcl::Window*, TriState > WindowPair;
+ typedef std::pair< VclPtr<vcl::Window>, TriState > WindowPair;
typedef std::vector< WindowPair > WindowVec;
DialControl& mrCtrlDial;
diff --git a/svx/source/dialog/passwd.cxx b/svx/source/dialog/passwd.cxx
index 8f80ab8119c7..84e56e032d4a 100644
--- a/svx/source/dialog/passwd.cxx
+++ b/svx/source/dialog/passwd.cxx
@@ -97,6 +97,21 @@ SvxPasswordDialog::SvxPasswordDialog(vcl::Window* pParent, bool bAllowEmptyPassw
}
}
+SvxPasswordDialog::~SvxPasswordDialog()
+{
+ dispose();
+}
+
+void SvxPasswordDialog::dispose()
+{
+ m_pOldFL.clear();
+ m_pOldPasswdFT.clear();
+ m_pOldPasswdED.clear();
+ m_pNewPasswdED.clear();
+ m_pRepeatPasswdED.clear();
+ m_pOKBtn.clear();
+ SfxModalDialog::dispose();
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index 2400f2db2a84..2ebbbeca831e 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -271,6 +271,28 @@ void SvxRubyDialog::dispose()
ClearCharStyleList();
EventObject aEvent;
xImpl->disposing(aEvent);
+ m_pLeftFT.clear();
+ m_pRightFT.clear();
+ m_pLeft1ED.clear();
+ m_pRight1ED.clear();
+ m_pLeft2ED.clear();
+ m_pRight2ED.clear();
+ m_pLeft3ED.clear();
+ m_pRight3ED.clear();
+ m_pLeft4ED.clear();
+ m_pRight4ED.clear();
+ for (int i=0; i<7; i++)
+ aEditArr[i].clear();
+ m_pScrolledWindow.clear();
+ m_pScrollSB.clear();
+ m_pAdjustLB.clear();
+ m_pPositionLB.clear();
+ m_pCharStyleFT.clear();
+ m_pCharStyleLB.clear();
+ m_pStylistPB.clear();
+ m_pPreviewWin.clear();
+ m_pApplyPB.clear();
+ m_pClosePB.clear();
SfxModelessDialog::dispose();
}
@@ -766,6 +788,17 @@ RubyPreview::RubyPreview(vcl::Window *pParent)
SetBorderStyle( WindowBorderStyle::MONO );
}
+RubyPreview::~RubyPreview()
+{
+ dispose();
+}
+
+void RubyPreview::dispose()
+{
+ m_pParentDlg.clear();
+ vcl::Window::dispose();
+}
+
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRubyPreview(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new RubyPreview(pParent);
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 5820f2847cc5..24a5d33f3f43 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -364,6 +364,48 @@ void SvxSearchDialog::dispose()
delete pImpl;
delete pSearchList;
delete pReplaceList;
+ mpDocWin.clear();
+ m_pSearchFrame.clear();
+ m_pSearchLB.clear();
+ m_pSearchTmplLB.clear();
+ m_pSearchAttrText.clear();
+ m_pSearchLabel.clear();
+ m_pReplaceFrame.clear();
+ m_pReplaceLB.clear();
+ m_pReplaceTmplLB.clear();
+ m_pReplaceAttrText.clear();
+ m_pSearchBtn.clear();
+ m_pSearchAllBtn.clear();
+ m_pReplaceBtn.clear();
+ m_pReplaceAllBtn.clear();
+ m_pComponentFrame.clear();
+ m_pSearchComponent1PB.clear();
+ m_pSearchComponent2PB.clear();
+ m_pMatchCaseCB.clear();
+ m_pWordBtn.clear();
+ m_pCloseBtn.clear();
+ m_pIgnoreDiacritics.clear();
+ m_pIgnoreKashida.clear();
+ m_pSelectionBtn.clear();
+ m_pBackwardsBtn.clear();
+ m_pRegExpBtn.clear();
+ m_pSimilarityBox.clear();
+ m_pSimilarityBtn.clear();
+ m_pLayoutBtn.clear();
+ m_pNotesBtn.clear();
+ m_pJapMatchFullHalfWidthCB.clear();
+ m_pJapOptionsCB.clear();
+ m_pJapOptionsBtn.clear();
+ m_pAttributeBtn.clear();
+ m_pFormatBtn.clear();
+ m_pNoFormatBtn.clear();
+ m_pCalcGrid.clear();
+ m_pCalcSearchInFT.clear();
+ m_pCalcSearchInLB.clear();
+ m_pCalcSearchDirFT.clear();
+ m_pRowsBtn.clear();
+ m_pColumnsBtn.clear();
+ m_pAllSheetsCB.clear();
SfxModelessDialog::dispose();
}
@@ -2227,7 +2269,7 @@ SvxSearchDialogWrapper::SvxSearchDialogWrapper( vcl::Window* _pParent, sal_uInt1
: SfxChildWindow( _pParent, nId )
, dialog (new SvxSearchDialog (_pParent, this, *pBindings))
{
- pWindow = dialog;
+ pWindow = dialog.get();
dialog->Initialize( pInfo );
pBindings->Update( SID_SEARCH_ITEM );
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index adf08f015683..b2bfffdda52c 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -363,6 +363,7 @@ void SvxRuler::dispose()
pBindings->LeaveRegistrations();
+ pEditWin.clear();
Ruler::dispose();
}
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 7e194f6bc5ca..66984dbc86af 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -643,9 +643,6 @@ DbCellControl::~DbCellControl()
{
lcl_clearBroadCaster(m_pModelChangeBroadcaster);
lcl_clearBroadCaster(m_pFieldChangeBroadcaster);
-
- delete m_pWindow;
- delete m_pPainter;
}
@@ -838,7 +835,7 @@ void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxMode
DBG_ASSERT( _rxModel.is(), "DbCellControl::implAdjustReadOnly: invalid model!" );
if ( m_pWindow && _rxModel.is() )
{
- Edit* pEditWindow = dynamic_cast< Edit* >( m_pWindow );
+ Edit* pEditWindow = dynamic_cast< Edit* >( m_pWindow.get() );
if ( pEditWindow )
{
bool bReadOnly = m_rColumn.IsReadOnly();
@@ -846,7 +843,7 @@ void DbCellControl::implAdjustReadOnly( const Reference< XPropertySet >& _rxMode
{
_rxModel->getPropertyValue( i_bReadOnly ? OUString(FM_PROP_READONLY) : OUString(FM_PROP_ISREADONLY)) >>= bReadOnly;
}
- static_cast< Edit* >( m_pWindow )->SetReadOnly( bReadOnly );
+ static_cast< Edit* >( m_pWindow.get() )->SetReadOnly( bReadOnly );
}
}
}
@@ -1126,18 +1123,18 @@ void DbTextField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCurso
if ( bIsMultiLine )
{
m_pWindow = new MultiLineTextCell( &rParent, nStyle );
- m_pEdit = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pWindow ) );
+ m_pEdit = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pWindow.get() ) );
m_pPainter = new MultiLineTextCell( &rParent, nStyle );
- m_pPainterImplementation = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pPainter ) );
+ m_pPainterImplementation = new MultiLineEditImplementation( *static_cast< MultiLineTextCell* >( m_pPainter.get() ) );
}
else
{
m_pWindow = new Edit( &rParent, nStyle );
- m_pEdit = new EditImplementation( *static_cast< Edit* >( m_pWindow ) );
+ m_pEdit = new EditImplementation( *static_cast< Edit* >( m_pWindow.get() ) );
m_pPainter = new Edit( &rParent, nStyle );
- m_pPainterImplementation = new EditImplementation( *static_cast< Edit* >( m_pPainter ) );
+ m_pPainterImplementation = new EditImplementation( *static_cast< Edit* >( m_pPainter.get() ) );
}
if ( WB_LEFT == nStyle )
@@ -1281,8 +1278,8 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
implAdjustGenericFieldSetting( xUnoModel );
- static_cast< FormattedField* >( m_pWindow )->SetStrictFormat( false );
- static_cast< FormattedField* >( m_pPainter )->SetStrictFormat( false );
+ static_cast< FormattedField* >( m_pWindow.get() )->SetStrictFormat( false );
+ static_cast< FormattedField* >( m_pPainter.get() )->SetStrictFormat( false );
// wenn man _irgendeine_ Formatierung zulaesst, kann man da sowieso keine Eingabe-Ueberpruefung
// machen (das FormattedField unterstuetzt das sowieso nicht, nur abgeleitete Klassen)
@@ -1350,7 +1347,7 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
// einen Standard-Formatter ...
if (pFormatterUsed == NULL)
{
- pFormatterUsed = static_cast<FormattedField*>(m_pWindow)->StandardFormatter();
+ pFormatterUsed = static_cast<FormattedField*>(m_pWindow.get())->StandardFormatter();
DBG_ASSERT(pFormatterUsed != NULL, "DbFormattedField::Init : no standard formatter given by the numeric field !");
}
// ... und einen Standard-Key
@@ -1359,14 +1356,14 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
m_nKeyType = comphelper::getNumberFormatType(m_xSupplier->getNumberFormats(), nFormatKey);
- static_cast<FormattedField*>(m_pWindow)->SetFormatter(pFormatterUsed);
- static_cast<FormattedField*>(m_pPainter)->SetFormatter(pFormatterUsed);
+ static_cast<FormattedField*>(m_pWindow.get())->SetFormatter(pFormatterUsed);
+ static_cast<FormattedField*>(m_pPainter.get())->SetFormatter(pFormatterUsed);
- static_cast<FormattedField*>(m_pWindow)->SetFormatKey(nFormatKey);
- static_cast<FormattedField*>(m_pPainter)->SetFormatKey(nFormatKey);
+ static_cast<FormattedField*>(m_pWindow.get())->SetFormatKey(nFormatKey);
+ static_cast<FormattedField*>(m_pPainter.get())->SetFormatKey(nFormatKey);
- static_cast<FormattedField*>(m_pWindow)->TreatAsNumber(m_rColumn.IsNumeric());
- static_cast<FormattedField*>(m_pPainter)->TreatAsNumber(m_rColumn.IsNumeric());
+ static_cast<FormattedField*>(m_pWindow.get())->TreatAsNumber(m_rColumn.IsNumeric());
+ static_cast<FormattedField*>(m_pPainter.get())->TreatAsNumber(m_rColumn.IsNumeric());
// Min- und Max-Werte
if (m_rColumn.IsNumeric())
@@ -1379,15 +1376,15 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
{
DBG_ASSERT(aMin.getValueType().getTypeClass() == TypeClass_DOUBLE, "DbFormattedField::Init : the model has an invalid min value !");
double dMin = ::comphelper::getDouble(aMin);
- static_cast<FormattedField*>(m_pWindow)->SetMinValue(dMin);
- static_cast<FormattedField*>(m_pPainter)->SetMinValue(dMin);
+ static_cast<FormattedField*>(m_pWindow.get())->SetMinValue(dMin);
+ static_cast<FormattedField*>(m_pPainter.get())->SetMinValue(dMin);
bClearMin = false;
}
}
if (bClearMin)
{
- static_cast<FormattedField*>(m_pWindow)->ClearMinValue();
- static_cast<FormattedField*>(m_pPainter)->ClearMinValue();
+ static_cast<FormattedField*>(m_pWindow.get())->ClearMinValue();
+ static_cast<FormattedField*>(m_pPainter.get())->ClearMinValue();
}
bool bClearMax = true;
if (::comphelper::hasProperty(FM_PROP_EFFECTIVE_MAX, xUnoModel))
@@ -1397,15 +1394,15 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
{
DBG_ASSERT(aMin.getValueType().getTypeClass() == TypeClass_DOUBLE, "DbFormattedField::Init : the model has an invalid max value !");
double dMin = ::comphelper::getDouble(aMin);
- static_cast<FormattedField*>(m_pWindow)->SetMaxValue(dMin);
- static_cast<FormattedField*>(m_pPainter)->SetMaxValue(dMin);
+ static_cast<FormattedField*>(m_pWindow.get())->SetMaxValue(dMin);
+ static_cast<FormattedField*>(m_pPainter.get())->SetMaxValue(dMin);
bClearMax = false;
}
}
if (bClearMax)
{
- static_cast<FormattedField*>(m_pWindow)->ClearMaxValue();
- static_cast<FormattedField*>(m_pPainter)->ClearMaxValue();
+ static_cast<FormattedField*>(m_pWindow.get())->ClearMaxValue();
+ static_cast<FormattedField*>(m_pPainter.get())->ClearMaxValue();
}
}
@@ -1418,16 +1415,16 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
case TypeClass_DOUBLE:
if (m_rColumn.IsNumeric())
{
- static_cast<FormattedField*>(m_pWindow)->SetDefaultValue(::comphelper::getDouble(aDefault));
- static_cast<FormattedField*>(m_pPainter)->SetDefaultValue(::comphelper::getDouble(aDefault));
+ static_cast<FormattedField*>(m_pWindow.get())->SetDefaultValue(::comphelper::getDouble(aDefault));
+ static_cast<FormattedField*>(m_pPainter.get())->SetDefaultValue(::comphelper::getDouble(aDefault));
}
else
{
OUString sConverted;
Color* pDummy;
pFormatterUsed->GetOutputString(::comphelper::getDouble(aDefault), 0, sConverted, &pDummy);
- static_cast<FormattedField*>(m_pWindow)->SetDefaultText(sConverted);
- static_cast<FormattedField*>(m_pPainter)->SetDefaultText(sConverted);
+ static_cast<FormattedField*>(m_pWindow.get())->SetDefaultText(sConverted);
+ static_cast<FormattedField*>(m_pPainter.get())->SetDefaultText(sConverted);
}
break;
case TypeClass_STRING:
@@ -1439,14 +1436,14 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
sal_uInt32 nTestFormat(0);
if (pFormatterUsed->IsNumberFormat(sDefault, nTestFormat, dVal))
{
- static_cast<FormattedField*>(m_pWindow)->SetDefaultValue(dVal);
- static_cast<FormattedField*>(m_pPainter)->SetDefaultValue(dVal);
+ static_cast<FormattedField*>(m_pWindow.get())->SetDefaultValue(dVal);
+ static_cast<FormattedField*>(m_pPainter.get())->SetDefaultValue(dVal);
}
}
else
{
- static_cast<FormattedField*>(m_pWindow)->SetDefaultText(sDefault);
- static_cast<FormattedField*>(m_pPainter)->SetDefaultText(sDefault);
+ static_cast<FormattedField*>(m_pWindow.get())->SetDefaultText(sDefault);
+ static_cast<FormattedField*>(m_pPainter.get())->SetDefaultText(sDefault);
}
}
break;
@@ -1461,7 +1458,7 @@ void DbFormattedField::Init( vcl::Window& rParent, const Reference< XRowSet >& x
CellControllerRef DbFormattedField::CreateController() const
{
- return new ::svt::FormattedFieldCellController( static_cast< FormattedField* >( m_pWindow ) );
+ return new ::svt::FormattedFieldCellController( static_cast< FormattedField* >( m_pWindow.get() ) );
}
@@ -1474,9 +1471,9 @@ void DbFormattedField::_propertyChanged( const PropertyChangeEvent& _rEvent ) th
DBG_ASSERT(m_pWindow && m_pPainter, "DbFormattedField::_propertyChanged : where are my windows ?");
if (m_pWindow)
- static_cast< FormattedField* >( m_pWindow )->SetFormatKey( nNewKey );
+ static_cast< FormattedField* >( m_pWindow.get() )->SetFormatKey( nNewKey );
if (m_pPainter)
- static_cast< FormattedField* >( m_pPainter )->SetFormatKey( nNewKey );
+ static_cast< FormattedField* >( m_pPainter.get() )->SetFormatKey( nNewKey );
}
else
{
@@ -1508,7 +1505,7 @@ OUString DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb:
double dValue = getValue( _rxField, m_rColumn.GetParent().getNullDate() );
if (_rxField->wasNull())
return aText;
- static_cast<FormattedField*>(m_pPainter)->SetValue(dValue);
+ static_cast<FormattedField*>(m_pPainter.get())->SetValue(dValue);
}
else
{
@@ -1517,7 +1514,7 @@ OUString DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb:
aText = _rxField->getString();
if (_rxField->wasNull())
return aText;
- static_cast<FormattedField*>(m_pPainter)->SetTextFormatted(aText);
+ static_cast<FormattedField*>(m_pPainter.get())->SetTextFormatted(aText);
}
}
catch( const Exception& )
@@ -1527,7 +1524,7 @@ OUString DbFormattedField::GetFormatText(const Reference< ::com::sun::star::sdb:
aText = m_pPainter->GetText();
if (ppColor != NULL)
- *ppColor = static_cast<FormattedField*>(m_pPainter)->GetLastOutputColor();
+ *ppColor = static_cast<FormattedField*>(m_pPainter.get())->GetLastOutputColor();
return aText;
}
@@ -1537,7 +1534,7 @@ void DbFormattedField::UpdateFromField(const Reference< ::com::sun::star::sdb::X
{
try
{
- FormattedField* pFormattedWindow = static_cast<FormattedField*>(m_pWindow);
+ FormattedField* pFormattedWindow = static_cast<FormattedField*>(m_pWindow.get());
if (!_rxField.is())
{ // NULL-Wert -> leerer Text
m_pWindow->SetText(OUString());
@@ -1576,7 +1573,7 @@ void DbFormattedField::updateFromModel( Reference< XPropertySet > _rxModel )
{
OSL_ENSURE( _rxModel.is() && m_pWindow, "DbFormattedField::updateFromModel: invalid call!" );
- FormattedField* pFormattedWindow = static_cast< FormattedField* >( m_pWindow );
+ FormattedField* pFormattedWindow = static_cast< FormattedField* >( m_pWindow.get() );
OUString sText;
Any aValue = _rxModel->getPropertyValue( FM_PROP_EFFECTIVE_VALUE );
@@ -1597,7 +1594,7 @@ void DbFormattedField::updateFromModel( Reference< XPropertySet > _rxModel )
bool DbFormattedField::commitControl()
{
Any aNewVal;
- FormattedField& rField = *static_cast<FormattedField*>(m_pWindow);
+ FormattedField& rField = *static_cast<FormattedField*>(m_pWindow.get());
DBG_ASSERT(&rField == m_pWindow, "DbFormattedField::commitControl : can't work with a window other than my own !");
if (m_rColumn.IsNumeric())
{
@@ -1658,8 +1655,8 @@ void DbCheckBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor
bool bTristate = true;
OSL_VERIFY( xModel->getPropertyValue( FM_PROP_TRISTATE ) >>= bTristate );
- static_cast< CheckBoxControl* >( m_pWindow )->GetBox().EnableTriState( bTristate );
- static_cast< CheckBoxControl* >( m_pPainter )->GetBox().EnableTriState( bTristate );
+ static_cast< CheckBoxControl* >( m_pWindow.get() )->GetBox().EnableTriState( bTristate );
+ static_cast< CheckBoxControl* >( m_pPainter.get() )->GetBox().EnableTriState( bTristate );
}
catch( const Exception& )
{
@@ -1672,7 +1669,7 @@ void DbCheckBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor
CellControllerRef DbCheckBox::CreateController() const
{
- return new CheckBoxCellController(static_cast<CheckBoxControl*>(m_pWindow));
+ return new CheckBoxCellController(static_cast<CheckBoxControl*>(m_pWindow.get()));
}
static void lcl_setCheckBoxState( const Reference< ::com::sun::star::sdb::XColumn >& _rxField,
@@ -1698,7 +1695,7 @@ static void lcl_setCheckBoxState( const Reference< ::com::sun::star::sdb::XCol
void DbCheckBox::UpdateFromField(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& /*xFormatter*/)
{
- lcl_setCheckBoxState( _rxField, static_cast<CheckBoxControl*>(m_pWindow) );
+ lcl_setCheckBoxState( _rxField, static_cast<CheckBoxControl*>(m_pWindow.get()) );
}
@@ -1706,7 +1703,7 @@ void DbCheckBox::PaintFieldToCell(OutputDevice& rDev, const Rectangle& rRect,
const Reference< ::com::sun::star::sdb::XColumn >& _rxField,
const Reference< XNumberFormatter >& xFormatter)
{
- lcl_setCheckBoxState( _rxField, static_cast<CheckBoxControl*>(m_pPainter) );
+ lcl_setCheckBoxState( _rxField, static_cast<CheckBoxControl*>(m_pPainter.get()) );
DbCellControl::PaintFieldToCell( rDev, rRect, _rxField, xFormatter );
}
@@ -1717,14 +1714,14 @@ void DbCheckBox::updateFromModel( Reference< XPropertySet > _rxModel )
sal_Int16 nState = TRISTATE_INDET;
_rxModel->getPropertyValue( FM_PROP_STATE ) >>= nState;
- static_cast< CheckBoxControl* >( m_pWindow )->GetBox().SetState( static_cast< TriState >( nState ) );
+ static_cast< CheckBoxControl* >( m_pWindow.get() )->GetBox().SetState( static_cast< TriState >( nState ) );
}
bool DbCheckBox::commitControl()
{
m_rColumn.getModel()->setPropertyValue( FM_PROP_STATE,
- makeAny( (sal_Int16)( static_cast< CheckBoxControl* >( m_pWindow )->GetBox().GetState() ) ) );
+ makeAny( (sal_Int16)( static_cast< CheckBoxControl* >( m_pWindow.get() )->GetBox().GetState() ) ) );
return true;
}
@@ -1760,10 +1757,10 @@ void DbPatternField::implAdjustGenericFieldSetting( const Reference< XPropertySe
OString aAsciiEditMask(OUStringToOString(aEditMask, RTL_TEXTENCODING_ASCII_US));
- static_cast< PatternField* >( m_pWindow )->SetMask( aAsciiEditMask, aLitMask );
- static_cast< PatternField* >( m_pPainter )->SetMask( aAsciiEditMask, aLitMask );
- static_cast< PatternField* >( m_pWindow )->SetStrictFormat( bStrict );
- static_cast< PatternField* >( m_pPainter )->SetStrictFormat( bStrict );
+ static_cast< PatternField* >( m_pWindow.get() )->SetMask( aAsciiEditMask, aLitMask );
+ static_cast< PatternField* >( m_pPainter.get() )->SetMask( aAsciiEditMask, aLitMask );
+ static_cast< PatternField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
+ static_cast< PatternField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
}
}
@@ -1784,14 +1781,14 @@ void DbPatternField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCu
CellControllerRef DbPatternField::CreateController() const
{
- return new SpinCellController( static_cast< PatternField* >( m_pWindow ) );
+ return new SpinCellController( static_cast< PatternField* >( m_pWindow.get() ) );
}
OUString DbPatternField::impl_formatText( const OUString& _rText )
{
m_pPainter->SetText( _rText );
- static_cast< PatternField* >( m_pPainter )->ReformatAll();
+ static_cast< PatternField* >( m_pPainter.get() )->ReformatAll();
return m_pPainter->GetText();
}
@@ -1822,8 +1819,8 @@ OUString DbPatternField::GetFormatText(const Reference< ::com::sun::star::sdb::X
void DbPatternField::UpdateFromField( const Reference< XColumn >& _rxField, const Reference< XNumberFormatter >& _rxFormatter )
{
- static_cast< Edit* >( m_pWindow )->SetText( GetFormatText( _rxField, _rxFormatter ) );
- static_cast< Edit* >( m_pWindow )->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) );
+ static_cast< Edit* >( m_pWindow.get() )->SetText( GetFormatText( _rxField, _rxFormatter ) );
+ static_cast< Edit* >( m_pWindow.get() )->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) );
}
@@ -1834,8 +1831,8 @@ void DbPatternField::updateFromModel( Reference< XPropertySet > _rxModel )
OUString sText;
_rxModel->getPropertyValue( FM_PROP_TEXT ) >>= sText;
- static_cast< Edit* >( m_pWindow )->SetText( impl_formatText( sText ) );
- static_cast< Edit* >( m_pWindow )->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) );
+ static_cast< Edit* >( m_pWindow.get() )->SetText( impl_formatText( sText ) );
+ static_cast< Edit* >( m_pWindow.get() )->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) );
}
@@ -1877,7 +1874,7 @@ void DbSpinField::Init( vcl::Window& _rParent, const Reference< XRowSet >& _rxCu
CellControllerRef DbSpinField::CreateController() const
{
- return new SpinCellController( static_cast< SpinField* >( m_pWindow ) );
+ return new SpinCellController( static_cast< SpinField* >( m_pWindow.get() ) );
}
DbNumericField::DbNumericField( DbGridColumn& _rColumn )
@@ -1905,14 +1902,14 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe
sal_Int16 nScale = getINT16( _rxModel->getPropertyValue( FM_PROP_DECIMAL_ACCURACY ) );
bool bThousand = getBOOL( _rxModel->getPropertyValue( FM_PROP_SHOWTHOUSANDSEP ) );
- static_cast< DoubleNumericField* >( m_pWindow )->SetMinValue(nMin);
- static_cast< DoubleNumericField* >( m_pWindow )->SetMaxValue(nMax);
- static_cast< DoubleNumericField* >( m_pWindow )->SetSpinSize(nStep);
- static_cast< DoubleNumericField* >( m_pWindow )->SetStrictFormat(bStrict);
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetMinValue(nMin);
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetMaxValue(nMax);
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetSpinSize(nStep);
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetStrictFormat(bStrict);
- static_cast< DoubleNumericField* >( m_pPainter )->SetMinValue(nMin);
- static_cast< DoubleNumericField* >( m_pPainter )->SetMaxValue(nMax);
- static_cast< DoubleNumericField* >( m_pPainter )->SetStrictFormat(bStrict);
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetMinValue(nMin);
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetMaxValue(nMax);
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetStrictFormat(bStrict);
// dem Field und dem Painter einen Formatter spendieren
@@ -1931,18 +1928,18 @@ void DbNumericField::implAdjustGenericFieldSetting( const Reference< XPropertySe
}
if ( NULL == pFormatterUsed )
{ // der Cursor fuehrte nicht zum Erfolg -> Standard
- pFormatterUsed = static_cast< DoubleNumericField* >( m_pWindow )->StandardFormatter();
+ pFormatterUsed = static_cast< DoubleNumericField* >( m_pWindow.get() )->StandardFormatter();
DBG_ASSERT( pFormatterUsed != NULL, "DbNumericField::implAdjustGenericFieldSetting: no standard formatter given by the numeric field !" );
}
- static_cast< DoubleNumericField* >( m_pWindow )->SetFormatter( pFormatterUsed );
- static_cast< DoubleNumericField* >( m_pPainter )->SetFormatter( pFormatterUsed );
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetFormatter( pFormatterUsed );
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetFormatter( pFormatterUsed );
// und dann ein Format generieren, dass die gewuenschten Nachkommastellen usw. hat
LanguageType aAppLanguage = Application::GetSettings().GetUILanguageTag().getLanguageType();
OUString sFormatString = pFormatterUsed->GenerateFormat(0, aAppLanguage, bThousand, false, nScale);
- static_cast< DoubleNumericField* >( m_pWindow )->SetFormat( sFormatString, aAppLanguage );
- static_cast< DoubleNumericField* >( m_pPainter )->SetFormat( sFormatString, aAppLanguage );
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetFormat( sFormatString, aAppLanguage );
+ static_cast< DoubleNumericField* >( m_pPainter.get() )->SetFormat( sFormatString, aAppLanguage );
}
}
@@ -1998,7 +1995,7 @@ void DbNumericField::updateFromModel( Reference< XPropertySet > _rxModel )
double dValue = 0;
if ( _rxModel->getPropertyValue( FM_PROP_VALUE ) >>= dValue )
- static_cast< DoubleNumericField* >( m_pWindow )->SetValue( dValue );
+ static_cast< DoubleNumericField* >( m_pWindow.get() )->SetValue( dValue );
else
m_pWindow->SetText( OUString() );
}
@@ -2011,7 +2008,7 @@ bool DbNumericField::commitControl()
if (!aText.isEmpty()) // not empty
{
- double fValue = static_cast<DoubleNumericField*>(m_pWindow)->GetValue();
+ double fValue = static_cast<DoubleNumericField*>(m_pWindow.get())->GetValue();
aVal <<= (double)fValue;
}
m_rColumn.getModel()->setPropertyValue(FM_PROP_VALUE, aVal);
@@ -2053,24 +2050,24 @@ void DbCurrencyField::implAdjustGenericFieldSetting( const Reference< XPropertyS
nMin *= nMul;
nMax *= nMul;
- static_cast< LongCurrencyField* >( m_pWindow )->SetUseThousandSep( bThousand );
- static_cast< LongCurrencyField* >( m_pWindow )->SetDecimalDigits( m_nScale );
- static_cast< LongCurrencyField* >( m_pWindow )->SetCurrencySymbol( aStr );
- static_cast< LongCurrencyField* >( m_pWindow )->SetFirst( nMin );
- static_cast< LongCurrencyField* >( m_pWindow )->SetLast( nMax );
- static_cast< LongCurrencyField* >( m_pWindow )->SetMin( nMin );
- static_cast< LongCurrencyField* >( m_pWindow )->SetMax( nMax );
- static_cast< LongCurrencyField* >( m_pWindow )->SetSpinSize( nStep );
- static_cast< LongCurrencyField* >( m_pWindow )->SetStrictFormat( bStrict );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetUseThousandSep( bThousand );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetDecimalDigits( m_nScale );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetCurrencySymbol( aStr );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetFirst( nMin );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetLast( nMax );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetMin( nMin );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetMax( nMax );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetSpinSize( nStep );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
- static_cast< LongCurrencyField* >( m_pPainter )->SetUseThousandSep( bThousand );
- static_cast< LongCurrencyField* >( m_pPainter )->SetDecimalDigits( m_nScale );
- static_cast< LongCurrencyField* >( m_pPainter )->SetCurrencySymbol( aStr );
- static_cast< LongCurrencyField* >( m_pPainter )->SetFirst( nMin );
- static_cast< LongCurrencyField* >( m_pPainter )->SetLast( nMax );
- static_cast< LongCurrencyField* >( m_pPainter )->SetMin( nMin );
- static_cast< LongCurrencyField* >( m_pPainter )->SetMax( nMax );
- static_cast< LongCurrencyField* >( m_pPainter )->SetStrictFormat( bStrict );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetUseThousandSep( bThousand );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetDecimalDigits( m_nScale );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetCurrencySymbol( aStr );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetFirst( nMin );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetLast( nMax );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetMin( nMin );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetMax( nMax );
+ static_cast< LongCurrencyField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
}
}
@@ -2146,7 +2143,7 @@ void DbCurrencyField::updateFromModel( Reference< XPropertySet > _rxModel )
dValue = ::rtl::math::round(dValue, 0);
}
- static_cast< LongCurrencyField* >( m_pWindow )->SetValue( dValue );
+ static_cast< LongCurrencyField* >( m_pWindow.get() )->SetValue( dValue );
}
else
m_pWindow->SetText( OUString() );
@@ -2159,7 +2156,7 @@ bool DbCurrencyField::commitControl()
Any aVal;
if (!aText.isEmpty()) // not empty
{
- double fValue = static_cast<LongCurrencyField*>(m_pWindow)->GetValue();
+ double fValue = static_cast<LongCurrencyField*>(m_pWindow.get())->GetValue();
if (m_nScale)
{
fValue /= ::rtl::math::pow10Exp(1.0, m_nScale);
@@ -2216,21 +2213,21 @@ void DbDateField::implAdjustGenericFieldSetting( const Reference< XPropertySet >
{
bool bShowDateCentury = getBOOL( aCentury );
- static_cast<DateField*>( m_pWindow )->SetShowDateCentury( bShowDateCentury );
- static_cast<DateField*>( m_pPainter )->SetShowDateCentury( bShowDateCentury );
+ static_cast<DateField*>( m_pWindow.get() )->SetShowDateCentury( bShowDateCentury );
+ static_cast<DateField*>( m_pPainter.get() )->SetShowDateCentury( bShowDateCentury );
}
- static_cast< DateField* >( m_pWindow )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
- static_cast< DateField* >( m_pWindow )->SetMin( aMin );
- static_cast< DateField* >( m_pWindow )->SetMax( aMax );
- static_cast< DateField* >( m_pWindow )->SetStrictFormat( bStrict );
- static_cast< DateField* >( m_pWindow )->EnableEmptyFieldValue( true );
+ static_cast< DateField* >( m_pWindow.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
+ static_cast< DateField* >( m_pWindow.get() )->SetMin( aMin );
+ static_cast< DateField* >( m_pWindow.get() )->SetMax( aMax );
+ static_cast< DateField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
+ static_cast< DateField* >( m_pWindow.get() )->EnableEmptyFieldValue( true );
- static_cast< DateField* >( m_pPainter )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
- static_cast< DateField* >( m_pPainter )->SetMin( aMin );
- static_cast< DateField* >( m_pPainter )->SetMax( aMax );
- static_cast< DateField* >( m_pPainter )->SetStrictFormat( bStrict );
- static_cast< DateField* >( m_pPainter )->EnableEmptyFieldValue( true );
+ static_cast< DateField* >( m_pPainter.get() )->SetExtDateFormat( (ExtDateFieldFormat)nFormat );
+ static_cast< DateField* >( m_pPainter.get() )->SetMin( aMin );
+ static_cast< DateField* >( m_pPainter.get() )->SetMax( aMax );
+ static_cast< DateField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
+ static_cast< DateField* >( m_pPainter.get() )->EnableEmptyFieldValue( true );
}
}
@@ -2264,13 +2261,13 @@ namespace
OUString DbDateField::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< ::com::sun::star::util::XNumberFormatter >& /*xFormatter*/, Color** /*ppColor*/)
{
- return lcl_setFormattedDate_nothrow(dynamic_cast<DateField&>(*m_pPainter), _rxField);
+ return lcl_setFormattedDate_nothrow(dynamic_cast<DateField&>(*m_pPainter.get()), _rxField);
}
void DbDateField::UpdateFromField(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& /*xFormatter*/)
{
- lcl_setFormattedDate_nothrow(dynamic_cast<DateField&>(*m_pWindow), _rxField);
+ lcl_setFormattedDate_nothrow(dynamic_cast<DateField&>(*m_pWindow.get()), _rxField);
}
@@ -2280,9 +2277,9 @@ void DbDateField::updateFromModel( Reference< XPropertySet > _rxModel )
util::Date aDate;
if ( _rxModel->getPropertyValue( FM_PROP_DATE ) >>= aDate )
- static_cast< DateField* >( m_pWindow )->SetDate( ::Date( aDate ) );
+ static_cast< DateField* >( m_pWindow.get() )->SetDate( ::Date( aDate ) );
else
- static_cast< DateField* >( m_pWindow )->SetText( OUString() );
+ static_cast< DateField* >( m_pWindow.get() )->SetText( OUString() );
}
@@ -2291,7 +2288,7 @@ bool DbDateField::commitControl()
OUString aText(m_pWindow->GetText());
Any aVal;
if (!aText.isEmpty())
- aVal <<= static_cast<DateField*>(m_pWindow)->GetDate().GetUNODate();
+ aVal <<= static_cast<DateField*>(m_pWindow.get())->GetDate().GetUNODate();
else
aVal.clear();
@@ -2328,17 +2325,17 @@ void DbTimeField::implAdjustGenericFieldSetting( const Reference< XPropertySet >
OSL_VERIFY( _rxModel->getPropertyValue( FM_PROP_TIMEMAX ) >>= aMax );
bool bStrict = getBOOL( _rxModel->getPropertyValue( FM_PROP_STRICTFORMAT ) );
- static_cast< TimeField* >( m_pWindow )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
- static_cast< TimeField* >( m_pWindow )->SetMin( aMin );
- static_cast< TimeField* >( m_pWindow )->SetMax( aMax );
- static_cast< TimeField* >( m_pWindow )->SetStrictFormat( bStrict );
- static_cast< TimeField* >( m_pWindow )->EnableEmptyFieldValue( true );
+ static_cast< TimeField* >( m_pWindow.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
+ static_cast< TimeField* >( m_pWindow.get() )->SetMin( aMin );
+ static_cast< TimeField* >( m_pWindow.get() )->SetMax( aMax );
+ static_cast< TimeField* >( m_pWindow.get() )->SetStrictFormat( bStrict );
+ static_cast< TimeField* >( m_pWindow.get() )->EnableEmptyFieldValue( true );
- static_cast< TimeField* >( m_pPainter )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
- static_cast< TimeField* >( m_pPainter )->SetMin( aMin );
- static_cast< TimeField* >( m_pPainter )->SetMax( aMax );
- static_cast< TimeField* >( m_pPainter )->SetStrictFormat( bStrict );
- static_cast< TimeField* >( m_pPainter )->EnableEmptyFieldValue( true );
+ static_cast< TimeField* >( m_pPainter.get() )->SetExtFormat( (ExtTimeFieldFormat)nFormat );
+ static_cast< TimeField* >( m_pPainter.get() )->SetMin( aMin );
+ static_cast< TimeField* >( m_pPainter.get() )->SetMax( aMax );
+ static_cast< TimeField* >( m_pPainter.get() )->SetStrictFormat( bStrict );
+ static_cast< TimeField* >( m_pPainter.get() )->EnableEmptyFieldValue( true );
}
}
@@ -2372,13 +2369,13 @@ namespace
OUString DbTimeField::GetFormatText(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< ::com::sun::star::util::XNumberFormatter >& /*xFormatter*/, Color** /*ppColor*/)
{
- return lcl_setFormattedTime_nothrow( *static_cast< TimeField* >( m_pPainter ), _rxField );
+ return lcl_setFormattedTime_nothrow( *static_cast< TimeField* >( m_pPainter.get() ), _rxField );
}
void DbTimeField::UpdateFromField(const Reference< ::com::sun::star::sdb::XColumn >& _rxField, const Reference< XNumberFormatter >& /*xFormatter*/)
{
- lcl_setFormattedTime_nothrow( *static_cast< TimeField* >( m_pWindow ), _rxField );
+ lcl_setFormattedTime_nothrow( *static_cast< TimeField* >( m_pWindow.get() ), _rxField );
}
@@ -2388,9 +2385,9 @@ void DbTimeField::updateFromModel( Reference< XPropertySet > _rxModel )
util::Time aTime;
if ( _rxModel->getPropertyValue( FM_PROP_TIME ) >>= aTime )
- static_cast< TimeField* >( m_pWindow )->SetTime( ::tools::Time( aTime ) );
+ static_cast< TimeField* >( m_pWindow.get() )->SetTime( ::tools::Time( aTime ) );
else
- static_cast< TimeField* >( m_pWindow )->SetText( OUString() );
+ static_cast< TimeField* >( m_pWindow.get() )->SetText( OUString() );
}
@@ -2399,7 +2396,7 @@ bool DbTimeField::commitControl()
OUString aText(m_pWindow->GetText());
Any aVal;
if (!aText.isEmpty())
- aVal <<= static_cast<TimeField*>(m_pWindow)->GetTime().GetUNOTime();
+ aVal <<= static_cast<TimeField*>(m_pWindow.get())->GetTime().GetUNOTime();
else
aVal.clear();
@@ -2432,7 +2429,7 @@ void DbComboBox::_propertyChanged( const PropertyChangeEvent& _rEvent ) throw( R
void DbComboBox::SetList(const Any& rItems)
{
- ComboBoxControl* pField = static_cast<ComboBoxControl*>(m_pWindow);
+ ComboBoxControl* pField = static_cast<ComboBoxControl*>(m_pWindow.get());
pField->Clear();
::comphelper::StringSequence aTest;
@@ -2456,7 +2453,7 @@ void DbComboBox::implAdjustGenericFieldSetting( const Reference< XPropertySet >&
if ( m_pWindow && _rxModel.is() )
{
sal_Int16 nLines = getINT16( _rxModel->getPropertyValue( FM_PROP_LINECOUNT ) );
- static_cast< ComboBoxControl* >( m_pWindow )->SetDropDownLineCount( nLines );
+ static_cast< ComboBoxControl* >( m_pWindow.get() )->SetDropDownLineCount( nLines );
}
}
@@ -2486,7 +2483,7 @@ void DbComboBox::Init( vcl::Window& rParent, const Reference< XRowSet >& xCursor
CellControllerRef DbComboBox::CreateController() const
{
- return new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow));
+ return new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow.get()));
}
@@ -2512,8 +2509,8 @@ void DbComboBox::updateFromModel( Reference< XPropertySet > _rxModel )
OUString sText;
_rxModel->getPropertyValue( FM_PROP_TEXT ) >>= sText;
- static_cast< ComboBox* >( m_pWindow )->SetText( sText );
- static_cast< ComboBox* >( m_pWindow )->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) );
+ static_cast< ComboBox* >( m_pWindow.get() )->SetText( sText );
+ static_cast< ComboBox* >( m_pWindow.get() )->SetSelection( Selection( SELECTION_MAX, SELECTION_MIN ) );
}
@@ -2551,7 +2548,7 @@ void DbListBox::_propertyChanged( const ::com::sun::star::beans::PropertyChangeE
void DbListBox::SetList(const Any& rItems)
{
- ListBoxControl* pField = static_cast<ListBoxControl*>(m_pWindow);
+ ListBoxControl* pField = static_cast<ListBoxControl*>(m_pWindow.get());
pField->Clear();
m_bBound = false;
@@ -2598,14 +2595,14 @@ void DbListBox::implAdjustGenericFieldSetting( const Reference< XPropertySet >&
if ( m_pWindow && _rxModel.is() )
{
sal_Int16 nLines = getINT16( _rxModel->getPropertyValue( FM_PROP_LINECOUNT ) );
- static_cast< ListBoxControl* >( m_pWindow )->SetDropDownLineCount( nLines );
+ static_cast< ListBoxControl* >( m_pWindow.get() )->SetDropDownLineCount( nLines );
}
}
CellControllerRef DbListBox::CreateController() const
{
- return new ListBoxCellController(static_cast<ListBoxControl*>(m_pWindow));
+ return new ListBoxCellController(static_cast<ListBoxControl*>(m_pWindow.get()));
}
@@ -2621,7 +2618,7 @@ OUString DbListBox::GetFormatText(const Reference< ::com::sun::star::sdb::XColum
{
Sequence< sal_Int16 > aPosSeq = ::comphelper::findValue( m_aValueList, sText, true );
if ( aPosSeq.getLength() )
- sText = static_cast<ListBox*>(m_pWindow)->GetEntry(aPosSeq.getConstArray()[0]);
+ sText = static_cast<ListBox*>(m_pWindow.get())->GetEntry(aPosSeq.getConstArray()[0]);
else
sText.clear();
}
@@ -2639,9 +2636,9 @@ void DbListBox::UpdateFromField(const Reference< ::com::sun::star::sdb::XColumn
{
OUString sFormattedText( GetFormatText( _rxField, xFormatter ) );
if (!sFormattedText.isEmpty())
- static_cast< ListBox* >( m_pWindow )->SelectEntry( sFormattedText );
+ static_cast< ListBox* >( m_pWindow.get() )->SelectEntry( sFormattedText );
else
- static_cast< ListBox* >( m_pWindow )->SetNoSelection();
+ static_cast< ListBox* >( m_pWindow.get() )->SetNoSelection();
}
@@ -2656,7 +2653,7 @@ void DbListBox::updateFromModel( Reference< XPropertySet > _rxModel )
if ( aSelection.getLength() > 0 )
nSelection = aSelection[ 0 ];
- ListBox* pListBox = static_cast< ListBox* >( m_pWindow );
+ ListBox* pListBox = static_cast< ListBox* >( m_pWindow.get() );
if ( ( nSelection >= 0 ) && ( nSelection < pListBox->GetEntryCount() ) )
pListBox->SelectEntryPos( nSelection );
@@ -2669,10 +2666,10 @@ bool DbListBox::commitControl()
{
Any aVal;
Sequence<sal_Int16> aSelectSeq;
- if (static_cast<ListBox*>(m_pWindow)->GetSelectEntryCount())
+ if (static_cast<ListBox*>(m_pWindow.get())->GetSelectEntryCount())
{
aSelectSeq.realloc(1);
- *(sal_Int16 *)aSelectSeq.getArray() = (sal_Int16)static_cast<ListBox*>(m_pWindow)->GetSelectEntryPos();
+ *(sal_Int16 *)aSelectSeq.getArray() = (sal_Int16)static_cast<ListBox*>(m_pWindow.get())->GetSelectEntryPos();
}
aVal <<= aSelectSeq;
m_rColumn.getModel()->setPropertyValue(FM_PROP_SELECT_SEQ, aVal);
@@ -2695,7 +2692,7 @@ DbFilterField::DbFilterField(const Reference< XComponentContext >& rxContext,DbG
DbFilterField::~DbFilterField()
{
if (m_nControlClass == ::com::sun::star::form::FormComponentType::CHECKBOX)
- static_cast<CheckBoxControl*>(m_pWindow)->SetClickHdl( Link() );
+ static_cast<CheckBoxControl*>(m_pWindow.get())->SetClickHdl( Link() );
}
@@ -2709,7 +2706,7 @@ void DbFilterField::PaintCell(OutputDevice& rDev, const Rectangle& rRect)
DbCellControl::PaintCell( rDev, rRect );
break;
case FormComponentType::LISTBOX:
- rDev.DrawText(rRect, static_cast<ListBox*>(m_pWindow)->GetSelectEntry(), nStyle);
+ rDev.DrawText(rRect, static_cast<ListBox*>(m_pWindow.get())->GetSelectEntry(), nStyle);
break;
default:
rDev.DrawText(rRect, m_aText, nStyle);
@@ -2727,13 +2724,13 @@ void DbFilterField::SetList(const Any& rItems, bool bComboBox)
{
if (bComboBox)
{
- ComboBox* pField = static_cast<ComboBox*>(m_pWindow);
+ ComboBox* pField = static_cast<ComboBox*>(m_pWindow.get());
for (sal_Int32 i = 0; i < nItems; ++i, ++pStrings )
pField->InsertEntry(*pStrings, LISTBOX_APPEND);
}
else
{
- ListBox* pField = static_cast<ListBox*>(m_pWindow);
+ ListBox* pField = static_cast<ListBox*>(m_pWindow.get());
for (sal_Int32 i = 0; i < nItems; ++i, ++pStrings )
pField->InsertEntry(*pStrings, LISTBOX_APPEND);
@@ -2751,7 +2748,7 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com::
case ::com::sun::star::form::FormComponentType::CHECKBOX:
m_pWindow = new CheckBoxControl(pParent);
m_pWindow->SetPaintTransparent( true );
- static_cast<CheckBoxControl*>(m_pWindow)->SetClickHdl( LINK( this, DbFilterField, OnClick ) );
+ static_cast<CheckBoxControl*>(m_pWindow.get())->SetClickHdl( LINK( this, DbFilterField, OnClick ) );
m_pPainter = new CheckBoxControl(pParent);
m_pPainter->SetPaintTransparent( true );
@@ -2763,7 +2760,7 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com::
sal_Int16 nLines = ::comphelper::getINT16(xModel->getPropertyValue(FM_PROP_LINECOUNT));
Any aItems = xModel->getPropertyValue(FM_PROP_STRINGITEMLIST);
SetList(aItems, m_nControlClass == ::com::sun::star::form::FormComponentType::COMBOBOX);
- static_cast<ListBox*>(m_pWindow)->SetDropDownLineCount(nLines);
+ static_cast<ListBox*>(m_pWindow.get())->SetDropDownLineCount(nLines);
} break;
case ::com::sun::star::form::FormComponentType::COMBOBOX:
{
@@ -2781,10 +2778,10 @@ void DbFilterField::CreateControl(vcl::Window* pParent, const Reference< ::com::
sal_Int16 nLines = ::comphelper::getINT16(xModel->getPropertyValue(FM_PROP_LINECOUNT));
Any aItems = xModel->getPropertyValue(FM_PROP_STRINGITEMLIST);
SetList(aItems, m_nControlClass == ::com::sun::star::form::FormComponentType::COMBOBOX);
- static_cast<ComboBox*>(m_pWindow)->SetDropDownLineCount(nLines);
+ static_cast<ComboBox*>(m_pWindow.get())->SetDropDownLineCount(nLines);
}
else
- static_cast<ComboBox*>(m_pWindow)->SetDropDownLineCount(5);
+ static_cast<ComboBox*>(m_pWindow.get())->SetDropDownLineCount(5);
} break;
default:
@@ -2834,7 +2831,7 @@ void DbFilterField::Init( vcl::Window& rParent, const Reference< XRowSet >& xCur
DbCellControl::Init( rParent, xCursor );
// filter cells are never readonly
- Edit* pAsEdit = dynamic_cast< Edit* >( m_pWindow );
+ Edit* pAsEdit = dynamic_cast< Edit* >( m_pWindow.get() );
if ( pAsEdit )
pAsEdit->SetReadOnly( false );
}
@@ -2846,19 +2843,19 @@ CellControllerRef DbFilterField::CreateController() const
switch (m_nControlClass)
{
case ::com::sun::star::form::FormComponentType::CHECKBOX:
- xController = new CheckBoxCellController(static_cast<CheckBoxControl*>(m_pWindow));
+ xController = new CheckBoxCellController(static_cast<CheckBoxControl*>(m_pWindow.get()));
break;
case ::com::sun::star::form::FormComponentType::LISTBOX:
- xController = new ListBoxCellController(static_cast<ListBoxControl*>(m_pWindow));
+ xController = new ListBoxCellController(static_cast<ListBoxControl*>(m_pWindow.get()));
break;
case ::com::sun::star::form::FormComponentType::COMBOBOX:
- xController = new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow));
+ xController = new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow.get()));
break;
default:
if (m_bFilterList)
- xController = new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow));
+ xController = new ComboBoxCellController(static_cast<ComboBoxControl*>(m_pWindow.get()));
else
- xController = new EditCellController(static_cast<Edit*>(m_pWindow));
+ xController = new EditCellController(static_cast<Edit*>(m_pWindow.get()));
}
return xController;
}
@@ -2884,9 +2881,9 @@ bool DbFilterField::commitControl()
return true;
case ::com::sun::star::form::FormComponentType::LISTBOX:
aText.clear();
- if (static_cast<ListBox*>(m_pWindow)->GetSelectEntryCount())
+ if (static_cast<ListBox*>(m_pWindow.get())->GetSelectEntryCount())
{
- sal_Int16 nPos = (sal_Int16)static_cast<ListBox*>(m_pWindow)->GetSelectEntryPos();
+ sal_Int16 nPos = (sal_Int16)static_cast<ListBox*>(m_pWindow.get())->GetSelectEntryPos();
if ( ( nPos >= 0 ) && ( nPos < m_aValueList.getLength() ) )
aText = m_aValueList.getConstArray()[nPos];
}
@@ -2967,16 +2964,16 @@ void DbFilterField::SetText(const OUString& rText)
else
eState = TRISTATE_INDET;
- static_cast<CheckBoxControl*>(m_pWindow)->GetBox().SetState(eState);
- static_cast<CheckBoxControl*>(m_pPainter)->GetBox().SetState(eState);
+ static_cast<CheckBoxControl*>(m_pWindow.get())->GetBox().SetState(eState);
+ static_cast<CheckBoxControl*>(m_pPainter.get())->GetBox().SetState(eState);
} break;
case ::com::sun::star::form::FormComponentType::LISTBOX:
{
Sequence<sal_Int16> aPosSeq = ::comphelper::findValue(m_aValueList, m_aText, true);
if (aPosSeq.getLength())
- static_cast<ListBox*>(m_pWindow)->SelectEntryPos(aPosSeq.getConstArray()[0], true);
+ static_cast<ListBox*>(m_pWindow.get())->SelectEntryPos(aPosSeq.getConstArray()[0], true);
else
- static_cast<ListBox*>(m_pWindow)->SetNoSelection();
+ static_cast<ListBox*>(m_pWindow.get())->SetNoSelection();
} break;
default:
m_pWindow->SetText(m_aText);
@@ -3099,7 +3096,7 @@ void DbFilterField::Update()
// filling the entries for the combobox
for (::std::vector< OUString >::const_iterator iter = aStringList.begin();
iter != aStringList.end(); ++iter)
- static_cast<ComboBox*>(m_pWindow)->InsertEntry(*iter, LISTBOX_APPEND);
+ static_cast<ComboBox*>(m_pWindow.get())->InsertEntry(*iter, LISTBOX_APPEND);
}
}
}
@@ -3119,7 +3116,7 @@ void DbFilterField::UpdateFromField(const Reference< XColumn >& /*_rxField*/, co
IMPL_LINK_NOARG(DbFilterField, OnClick)
{
- TriState eState = static_cast<CheckBoxControl*>(m_pWindow)->GetBox().GetState();
+ TriState eState = static_cast<CheckBoxControl*>(m_pWindow.get())->GetBox().GetState();
OUString aText;
switch (eState)
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 89caf2621282..21ba11a36f03 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -88,7 +88,7 @@ using namespace com::sun::star::accessibility;
class RowSetEventListener : public ::cppu::WeakImplHelper1<XRowsChangeListener>
{
- DbGridControl* m_pControl;
+ VclPtr<DbGridControl> m_pControl;
public:
RowSetEventListener(DbGridControl* i_pControl) : m_pControl(i_pControl)
{
@@ -250,10 +250,10 @@ bool CompareBookmark(const Any& aLeft, const Any& aRight)
class FmXGridSourcePropListener : public ::comphelper::OPropertyChangeListener
{
- DbGridControl* m_pParent;
+ VclPtr<DbGridControl> m_pParent;
// a DbGridControl has no mutex, so we use our own as the base class expects one
- osl::Mutex m_aMutex;
+ osl::Mutex m_aMutex;
sal_Int16 m_nSuspended;
public:
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index c09637e7e59d..b6823a2e0ae5 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -148,6 +148,7 @@ namespace svxform
void DataTreeListBox::dispose()
{
DeleteAndClear();
+ m_pXFormsPage.clear();
SvTreeListBox::dispose();
}
@@ -374,6 +375,19 @@ namespace svxform
ItemSelectHdl( m_pItemList );
}
+ XFormsPage::~XFormsPage()
+ {
+ dispose();
+ }
+
+ void XFormsPage::dispose()
+ {
+ m_pToolBox.clear();
+ m_pItemList.clear();
+ m_pNaviWin.clear();
+ TabPage::dispose();
+ }
+
IMPL_LINK_NOARG(XFormsPage, TbxSelectHdl)
{
DoToolBoxAction( m_pToolBox->GetCurItemId() );
@@ -1418,16 +1432,10 @@ namespace svxform
aAny <<= m_bShowDetails;
aViewOpt.SetUserItem(CFGNAME_SHOWDETAILS,aAny);
- delete m_pInstPage;
- m_pInstPage = NULL;
- delete m_pSubmissionPage;
- m_pSubmissionPage = NULL;
- delete m_pBindingPage;
- m_pBindingPage = NULL;
+ m_pInstPage.clear();
+ m_pSubmissionPage.clear();
+ m_pBindingPage.clear();
- sal_Int32 i, nCount = m_aPageList.size();
- for ( i = 0; i < nCount; ++i )
- delete m_aPageList[i];
m_aPageList.clear();
Reference< XFrameActionListener > xListener(
@@ -1436,6 +1444,10 @@ namespace svxform
RemoveBroadcaster();
m_xDataListener.clear();
disposeBuilder();
+ m_pModelsBox.clear();
+ m_pModelBtn.clear();
+ m_pTabCtrl.clear();
+ m_pInstanceBtn.clear();
vcl::Window::dispose();
}
@@ -1712,7 +1724,7 @@ namespace svxform
}
else
{
- DELETEZ( m_pInstPage );
+ m_pInstPage.clear();
bDoRemove = true;
}
@@ -2244,7 +2256,7 @@ namespace svxform
pWindow = new DataNavigator( _pBindings, this, _pParent );
eChildAlignment = SfxChildAlignment::RIGHT;
pWindow->SetSizePixel( Size( 250, 400 ) );
- static_cast<SfxDockingWindow*>(pWindow)->Initialize( _pInfo );
+ static_cast<SfxDockingWindow*>(pWindow.get())->Initialize( _pInfo );
}
AddDataItemDialog::AddDataItemDialog(vcl::Window* pParent, ItemNode* _pNode,
@@ -2316,6 +2328,26 @@ namespace svxform
// remove binding, if it does not convey 'useful' information
m_xUIHelper->removeBindingIfUseless( m_xBinding );
}
+ m_pItemFrame.clear();
+ m_pNameFT.clear();
+ m_pNameED.clear();
+ m_pDefaultFT.clear();
+ m_pDefaultED.clear();
+ m_pDefaultBtn.clear();
+ m_pSettingsFrame.clear();
+ m_pDataTypeFT.clear();
+ m_pDataTypeLB.clear();
+ m_pRequiredCB.clear();
+ m_pRequiredBtn.clear();
+ m_pRelevantCB.clear();
+ m_pRelevantBtn.clear();
+ m_pConstraintCB.clear();
+ m_pConstraintBtn.clear();
+ m_pReadonlyCB.clear();
+ m_pReadonlyBtn.clear();
+ m_pCalculateCB.clear();
+ m_pCalculateBtn.clear();
+ m_pOKBtn.clear();
ModalDialog::dispose();
}
@@ -2785,6 +2817,19 @@ namespace svxform
ResultHdl( &m_aResultIdle );
}
+ AddConditionDialog::~AddConditionDialog()
+ {
+ dispose();
+ }
+
+ void AddConditionDialog::dispose()
+ {
+ m_pConditionED.clear();
+ m_pResultWin.clear();
+ m_pEditNamespacesBtn.clear();
+ m_pOKBtn.clear();
+ ModalDialog::dispose();
+ }
IMPL_LINK_NOARG(AddConditionDialog, EditHdl)
{
@@ -2903,7 +2948,12 @@ namespace svxform
void NamespaceItemDialog::dispose()
{
- delete m_pNamespacesList;
+ m_pNamespacesList.clear();
+ m_pAddNamespaceBtn.clear();
+ m_pEditNamespaceBtn.clear();
+ m_pDeleteNamespaceBtn.clear();
+ m_pOKBtn.clear();
+ m_pConditionDlg.clear();
ModalDialog::dispose();
}
@@ -3045,6 +3095,19 @@ namespace svxform
m_pOKBtn->SetClickHdl( LINK( this, ManageNamespaceDialog, OKHdl ) );
}
+ ManageNamespaceDialog::~ManageNamespaceDialog()
+ {
+ dispose();
+ }
+
+ void ManageNamespaceDialog::dispose()
+ {
+ m_pOKBtn.clear();
+ m_pPrefixED.clear();
+ m_pUrlED.clear();
+ m_pConditionDlg.clear();
+ ModalDialog::dispose();
+ }
IMPL_LINK_NOARG(ManageNamespaceDialog, OKHdl)
{
@@ -3103,6 +3166,14 @@ namespace svxform
// #i38991# if we have added a binding, we need to remove it as well.
if( m_xCreatedBinding.is() && m_xUIHelper.is() )
m_xUIHelper->removeBindingIfUseless( m_xCreatedBinding );
+ m_pNameED.clear();
+ m_pActionED.clear();
+ m_pMethodLB.clear();
+ m_pRefED.clear();
+ m_pRefBtn.clear();
+ m_pBindLB.clear();
+ m_pReplaceLB.clear();
+ m_pOKBtn.clear();
ModalDialog::dispose();
}
@@ -3304,6 +3375,18 @@ namespace svxform
SetText(get<FixedText>("alttitle")->GetText());
}
+ AddModelDialog::~AddModelDialog()
+ {
+ dispose();
+ }
+
+ void AddModelDialog::dispose()
+ {
+ m_pNameED.clear();
+ m_pModifyCB.clear();
+ ModalDialog::dispose();
+ }
+
AddInstanceDialog::AddInstanceDialog(vcl::Window* pParent, bool _bEdit)
: ModalDialog(pParent, "AddInstanceDialog" , "svx/ui/addinstancedialog.ui")
{
@@ -3323,6 +3406,20 @@ namespace svxform
m_sAllFilterName = ResId(STR_FILTERNAME_ALL, *ResMgr::CreateResMgr("fps_office")).toString();
}
+ AddInstanceDialog::~AddInstanceDialog()
+ {
+ dispose();
+ }
+
+ void AddInstanceDialog::dispose()
+ {
+ m_pNameED.clear();
+ m_pURLFT.clear();
+ m_pURLED.clear();
+ m_pFilePickerBtn.clear();
+ m_pLinkInstanceCB.clear();
+ ModalDialog::dispose();
+ }
IMPL_LINK_NOARG(AddInstanceDialog, FilePickerHdl)
{
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index d5a48f67b5ef..ccfce934dbb2 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1872,7 +1872,7 @@ FmFilterNavigatorWin::~FmFilterNavigatorWin()
void FmFilterNavigatorWin::dispose()
{
- delete m_pNavigator;
+ m_pNavigator.clear();
SfxDockingWindow::dispose();
}
@@ -1996,7 +1996,7 @@ FmFilterNavigatorWinMgr::FmFilterNavigatorWinMgr( vcl::Window *_pParent, sal_uIn
{
pWindow = new FmFilterNavigatorWin( _pBindings, this, _pParent );
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
- static_cast<SfxDockingWindow*>(pWindow)->Initialize( _pInfo );
+ static_cast<SfxDockingWindow*>(pWindow.get())->Initialize( _pInfo );
}
diff --git a/svx/source/form/fmPropBrw.cxx b/svx/source/form/fmPropBrw.cxx
index f3a43260a1cc..caef3efe94be 100644
--- a/svx/source/form/fmPropBrw.cxx
+++ b/svx/source/form/fmPropBrw.cxx
@@ -85,11 +85,10 @@ FmPropBrwMgr::FmPropBrwMgr( vcl::Window* _pParent, sal_uInt16 _nId,
{
pWindow = new FmPropBrw( ::comphelper::getProcessComponentContext(), _pBindings, this, _pParent, _pInfo );
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
- static_cast<SfxFloatingWindow*>(pWindow)->Initialize( _pInfo );
+ static_cast<SfxFloatingWindow*>(pWindow.get())->Initialize( _pInfo );
}
-
const long STD_WIN_SIZE_X = 300;
const long STD_WIN_SIZE_Y = 350;
diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx
index 49caf56b6154..635d53f1e94f 100644
--- a/svx/source/form/fmexpl.cxx
+++ b/svx/source/form/fmexpl.cxx
@@ -519,7 +519,7 @@ namespace svxform
void NavigatorFrame::dispose()
{
- delete m_pNavigatorTree;
+ m_pNavigatorTree.clear();
SfxDockingWindow::dispose();
}
@@ -615,7 +615,7 @@ namespace svxform
{
pWindow = new NavigatorFrame( _pBindings, this, _pParent );
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
- static_cast<SfxDockingWindow*>(pWindow)->Initialize( _pInfo );
+ static_cast<SfxDockingWindow*>(pWindow.get())->Initialize( _pInfo );
}
diff --git a/svx/source/form/tabwin.cxx b/svx/source/form/tabwin.cxx
index 19a306d8e43c..942f95a46f15 100644
--- a/svx/source/form/tabwin.cxx
+++ b/svx/source/form/tabwin.cxx
@@ -113,6 +113,17 @@ FmFieldWinListBox::FmFieldWinListBox( FmFieldWin* pParent )
SetHighlightRange( );
}
+FmFieldWinListBox::~FmFieldWinListBox()
+{
+ dispose();
+}
+
+void FmFieldWinListBox::dispose()
+{
+ pTabWin.clear();
+ SvTreeListBox::dispose();
+}
+
sal_Int8 FmFieldWinListBox::AcceptDrop( const AcceptDropEvent& /*rEvt*/ )
{
@@ -198,7 +209,7 @@ void FmFieldWin::dispose()
m_pChangeListener->release();
// delete m_pChangeListener;
}
- delete pListBox;
+ pListBox.clear();
delete pData;
SfxFloatingWindow::dispose();
}
@@ -416,7 +427,7 @@ FmFieldWinMgr::FmFieldWinMgr(vcl::Window* _pParent, sal_uInt16 _nId,
pWindow = new FmFieldWin(_pBindings, this, _pParent);
SetHideNotDelete(true);
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
- static_cast<SfxFloatingWindow*>(pWindow)->Initialize( _pInfo );
+ static_cast<SfxFloatingWindow*>(pWindow.get())->Initialize( _pInfo );
}
diff --git a/svx/source/form/xfm_addcondition.cxx b/svx/source/form/xfm_addcondition.cxx
index 8a0c27557564..a0da5da65266 100644
--- a/svx/source/form/xfm_addcondition.cxx
+++ b/svx/source/form/xfm_addcondition.cxx
@@ -158,7 +158,7 @@ namespace svxform
{
OAddConditionDialogBase::executedDialog( _nExecutionResult );
if ( _nExecutionResult == RET_OK )
- m_sConditionValue = static_cast< AddConditionDialog* >( m_pDialog )->GetCondition();
+ m_sConditionValue = static_cast< AddConditionDialog* >( m_pDialog.get() )->GetCondition();
}
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index e245dee4480e..e64bd9a96ded 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -152,8 +152,7 @@ GalleryBrowser1::~GalleryBrowser1()
void GalleryBrowser1::dispose()
{
EndListening( *mpGallery );
- delete mpThemes;
- mpThemes = NULL;
+ mpThemes.clear();
delete mpExchangeData;
mpExchangeData = NULL;
maNewTheme.disposeAndClear();
diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx
index 1b24dd9c63a4..bda3bdcbbae8 100644
--- a/svx/source/gallery2/galbrws1.hxx
+++ b/svx/source/gallery2/galbrws1.hxx
@@ -81,7 +81,7 @@ class GalleryBrowser1 : public Control, SfxListener
private:
VclPtr<GalleryButton> maNewTheme;
- GalleryThemeListBox* mpThemes;
+ VclPtr<GalleryThemeListBox> mpThemes;
Gallery* mpGallery;
ExchangeData* mpExchangeData;
SfxItemSet* mpThemePropsDlgItemSet;
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index 83849bf2b161..15bfd3646a2f 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -110,10 +110,10 @@ class GalleryThemePopup : public ::cppu::WeakImplHelper1< css::frame::XStatusLis
private:
const GalleryTheme* mpTheme;
sal_uIntPtr mnObjectPos;
- bool mbPreview;
+ bool mbPreview;
PopupMenu maPopupMenu;
PopupMenu maBackgroundPopup;
- GalleryBrowser2* mpBrowser;
+ VclPtr<GalleryBrowser2> mpBrowser;
typedef std::map< int, CommandInfo > CommandInfoMap;
CommandInfoMap m_aCommandInfo;
@@ -481,9 +481,9 @@ void GalleryBrowser2::dispose()
{
maMiscOptions.RemoveListenerLink( LINK( this, GalleryBrowser2, MiscHdl ) );
- delete mpPreview;
- delete mpListView;
- delete mpIconView;
+ mpPreview.clear();
+ mpListView.clear();
+ mpIconView.clear();
if( mpCurTheme )
mpGallery->ReleaseTheme( mpCurTheme, *this );
@@ -740,9 +740,9 @@ bool GalleryBrowser2::KeyInput( const KeyEvent& rKEvt, vcl::Window* pWindow )
void GalleryBrowser2::SelectTheme( const OUString& rThemeName )
{
- delete mpIconView, mpIconView = NULL;
- delete mpListView, mpListView = NULL;
- delete mpPreview, mpPreview = NULL;
+ mpIconView.clear();
+ mpListView.clear();
+ mpPreview.clear();
if( mpCurTheme )
mpGallery->ReleaseTheme( mpCurTheme, *this );
diff --git a/svx/source/inc/AccessibleFrameSelector.hxx b/svx/source/inc/AccessibleFrameSelector.hxx
index 62cf8cf486fc..f1a5c9140052 100644
--- a/svx/source/inc/AccessibleFrameSelector.hxx
+++ b/svx/source/inc/AccessibleFrameSelector.hxx
@@ -34,6 +34,7 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
#include <svx/framebordertype.hxx>
+#include <vcl/vclptr.hxx>
class VclSimpleEvent;
class VclWindowEvent;
@@ -109,7 +110,7 @@ private:
void IsValid() throw (::com::sun::star::uno::RuntimeException);
void RemoveFrameSelEventListener();
- FrameSelector* mpFrameSel;
+ VclPtr<FrameSelector> mpFrameSel;
::osl::Mutex maFocusMutex;
::osl::Mutex maPropertyMutex;
diff --git a/svx/source/inc/GraphCtlAccessibleContext.hxx b/svx/source/inc/GraphCtlAccessibleContext.hxx
index 1c0955c26f85..accef9c952c3 100644
--- a/svx/source/inc/GraphCtlAccessibleContext.hxx
+++ b/svx/source/inc/GraphCtlAccessibleContext.hxx
@@ -225,7 +225,7 @@ private:
typedef ::std::map< const SdrObject*, ::accessibility::AccessibleShape*, SdrObjectCompareLess > ShapesMapType;
ShapesMapType mxShapes;
- GraphCtrl* mpControl;
+ VclPtr<GraphCtrl> mpControl;
SdrModel* mpModel;
SdrPage* mpPage;
diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx
index cc964f8b6155..1c09cfcd1ffd 100644
--- a/svx/source/inc/charmapacc.hxx
+++ b/svx/source/inc/charmapacc.hxx
@@ -40,7 +40,7 @@ namespace svx
class SvxShowCharSetVirtualAcc : public ::comphelper::OAccessibleComponentHelper,
public OAccessibleHelper_Base_2
{
- SvxShowCharSet* mpParent; // the vcl control
+ VclPtr<SvxShowCharSet> mpParent; // the vcl control
SvxShowCharSetAcc* m_pTable; // the table, which holds the characters shown by the vcl control
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xAcc; // the ref to the table
protected:
diff --git a/svx/source/inc/datalistener.hxx b/svx/source/inc/datalistener.hxx
index 875a7d5bd1e1..32132b24d2ae 100644
--- a/svx/source/inc/datalistener.hxx
+++ b/svx/source/inc/datalistener.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/container/XContainerListener.hpp>
#include <com/sun/star/frame/XFrameActionListener.hpp>
#include <com/sun/star/xml/dom/events/XEventListener.hpp>
+#include <vcl/vclptr.hxx>
namespace svxform
@@ -39,7 +40,7 @@ namespace svxform
class DataListener : public DataListener_t
{
private:
- DataNavigatorWindow* m_pNaviWin;
+ VclPtr<DataNavigatorWindow> m_pNaviWin;
public:
DataListener( DataNavigatorWindow* pNaviWin );
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index 9c54186727b5..b2b605d8de09 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -115,7 +115,7 @@ namespace svxform
class DataTreeListBox : public SvTreeListBox
{
private:
- XFormsPage* m_pXFormsPage;
+ VclPtr<XFormsPage> m_pXFormsPage;
DataGroupType m_eGroup;
sal_uInt16 m_nAddId;
sal_uInt16 m_nAddElementId;
@@ -250,8 +250,8 @@ namespace svxform
MethodString m_aMethodString;
ReplaceString m_aReplaceString;
- ToolBox *m_pToolBox;
- DataTreeListBox *m_pItemList;
+ VclPtr<ToolBox> m_pToolBox;
+ VclPtr<DataTreeListBox> m_pItemList;
sal_uInt16 m_nAddId;
sal_uInt16 m_nAddElementId;
sal_uInt16 m_nAddAttributeId;
@@ -260,7 +260,7 @@ namespace svxform
XFormsUIHelper1_ref m_xUIHelper;
- DataNavigatorWindow* m_pNaviWin;
+ VclPtr<DataNavigatorWindow> m_pNaviWin;
bool m_bHasModel;
DataGroupType m_eGroup;
ImageList m_TbxImageList;
@@ -289,6 +289,8 @@ namespace svxform
public:
XFormsPage( vcl::Window* pParent, DataNavigatorWindow* _pNaviWin, DataGroupType _eGroup );
+ virtual ~XFormsPage();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
@@ -319,20 +321,20 @@ namespace svxform
- typedef std::vector< XFormsPage* > PageList;
+ typedef std::vector< VclPtr<XFormsPage> > PageList;
typedef ::rtl::Reference < DataListener > DataListener_ref;
class DataNavigatorWindow : public vcl::Window, public VclBuilderContainer
{
private:
- ListBox* m_pModelsBox;
- MenuButton* m_pModelBtn;
- TabControl* m_pTabCtrl;
- MenuButton* m_pInstanceBtn;
+ VclPtr<ListBox> m_pModelsBox;
+ VclPtr<MenuButton> m_pModelBtn;
+ VclPtr<TabControl> m_pTabCtrl;
+ VclPtr<MenuButton> m_pInstanceBtn;
- XFormsPage* m_pInstPage;
- XFormsPage* m_pSubmissionPage;
- XFormsPage* m_pBindingPage;
+ VclPtr<XFormsPage> m_pInstPage;
+ VclPtr<XFormsPage> m_pSubmissionPage;
+ VclPtr<XFormsPage> m_pBindingPage;
sal_Int32 m_nLastSelectedPos;
bool m_bShowDetails;
@@ -424,30 +426,30 @@ namespace svxform
{
private:
- VclFrame* m_pItemFrame;
- FixedText* m_pNameFT;
- Edit* m_pNameED;
- FixedText* m_pDefaultFT;
- Edit* m_pDefaultED;
- PushButton* m_pDefaultBtn;
+ VclPtr<VclFrame> m_pItemFrame;
+ VclPtr<FixedText> m_pNameFT;
+ VclPtr<Edit> m_pNameED;
+ VclPtr<FixedText> m_pDefaultFT;
+ VclPtr<Edit> m_pDefaultED;
+ VclPtr<PushButton> m_pDefaultBtn;
- VclFrame* m_pSettingsFrame;
+ VclPtr<VclFrame> m_pSettingsFrame;
- FixedText* m_pDataTypeFT;
- ListBox* m_pDataTypeLB;
+ VclPtr<FixedText> m_pDataTypeFT;
+ VclPtr<ListBox> m_pDataTypeLB;
- CheckBox* m_pRequiredCB;
- PushButton* m_pRequiredBtn;
- CheckBox* m_pRelevantCB;
- PushButton* m_pRelevantBtn;
- CheckBox* m_pConstraintCB;
- PushButton* m_pConstraintBtn;
- CheckBox* m_pReadonlyCB;
- PushButton* m_pReadonlyBtn;
- CheckBox* m_pCalculateCB;
- PushButton* m_pCalculateBtn;
+ VclPtr<CheckBox> m_pRequiredCB;
+ VclPtr<PushButton> m_pRequiredBtn;
+ VclPtr<CheckBox> m_pRelevantCB;
+ VclPtr<PushButton> m_pRelevantBtn;
+ VclPtr<CheckBox> m_pConstraintCB;
+ VclPtr<PushButton> m_pConstraintBtn;
+ VclPtr<CheckBox> m_pReadonlyCB;
+ VclPtr<PushButton> m_pReadonlyBtn;
+ VclPtr<CheckBox> m_pCalculateCB;
+ VclPtr<PushButton> m_pCalculateBtn;
- OKButton* m_pOKBtn;
+ VclPtr<OKButton> m_pOKBtn;
XFormsUIHelper1_ref m_xUIHelper;
XPropertySet_ref m_xBinding;
@@ -481,13 +483,13 @@ namespace svxform
class AddConditionDialog : public ModalDialog
{
private:
- VclMultiLineEdit* m_pConditionED;
- VclMultiLineEdit* m_pResultWin;
- PushButton* m_pEditNamespacesBtn;
- OKButton* m_pOKBtn;
+ VclPtr<VclMultiLineEdit> m_pConditionED;
+ VclPtr<VclMultiLineEdit> m_pResultWin;
+ VclPtr<PushButton> m_pEditNamespacesBtn;
+ VclPtr<OKButton> m_pOKBtn;
Idle m_aResultIdle;
- OUString m_sPropertyName;
+ OUString m_sPropertyName;
XFormsUIHelper1_ref m_xUIHelper;
XPropertySet_ref m_xBinding;
@@ -500,6 +502,8 @@ namespace svxform
public:
AddConditionDialog(vcl::Window* pParent,
const OUString& _rPropertyName, const XPropertySet_ref& _rBinding);
+ virtual ~AddConditionDialog();
+ virtual void dispose() SAL_OVERRIDE;
XFormsUIHelper1_ref GetUIHelper() const { return m_xUIHelper; }
OUString GetCondition() const { return m_pConditionED->GetText(); }
@@ -516,13 +520,13 @@ namespace svxform
private:
typedef std::vector< OUString > PrefixList;
- SvSimpleTable* m_pNamespacesList;
- PushButton* m_pAddNamespaceBtn;
- PushButton* m_pEditNamespaceBtn;
- PushButton* m_pDeleteNamespaceBtn;
- OKButton* m_pOKBtn;
+ VclPtr<SvSimpleTable> m_pNamespacesList;
+ VclPtr<PushButton> m_pAddNamespaceBtn;
+ VclPtr<PushButton> m_pEditNamespaceBtn;
+ VclPtr<PushButton> m_pDeleteNamespaceBtn;
+ VclPtr<OKButton> m_pOKBtn;
- AddConditionDialog* m_pConditionDlg;
+ VclPtr<AddConditionDialog> m_pConditionDlg;
PrefixList m_aRemovedList;
XNameContainer_ref& m_rNamespaces;
@@ -543,16 +547,18 @@ namespace svxform
class ManageNamespaceDialog : public ModalDialog
{
private:
- Edit* m_pPrefixED;
- Edit* m_pUrlED;
- OKButton* m_pOKBtn;
+ VclPtr<Edit> m_pPrefixED;
+ VclPtr<Edit> m_pUrlED;
+ VclPtr<OKButton> m_pOKBtn;
- AddConditionDialog* m_pConditionDlg;
+ VclPtr<AddConditionDialog> m_pConditionDlg;
DECL_LINK(OKHdl, void *);
public:
ManageNamespaceDialog(vcl::Window* pParent, AddConditionDialog* _pCondDlg, bool bIsEdit);
+ virtual ~ManageNamespaceDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetNamespace(const OUString& _rPrefix, const OUString& _rURL)
{
@@ -570,15 +576,15 @@ namespace svxform
MethodString m_aMethodString;
ReplaceString m_aReplaceString;
- Edit* m_pNameED;
- Edit* m_pActionED;
- ListBox* m_pMethodLB;
- Edit* m_pRefED;
- PushButton* m_pRefBtn;
- ListBox* m_pBindLB;
- ListBox* m_pReplaceLB;
+ VclPtr<Edit> m_pNameED;
+ VclPtr<Edit> m_pActionED;
+ VclPtr<ListBox> m_pMethodLB;
+ VclPtr<Edit> m_pRefED;
+ VclPtr<PushButton> m_pRefBtn;
+ VclPtr<ListBox> m_pBindLB;
+ VclPtr<ListBox> m_pReplaceLB;
- OKButton* m_pOKBtn;
+ VclPtr<OKButton> m_pOKBtn;
ItemNode* m_pItemNode;
@@ -606,11 +612,13 @@ namespace svxform
class AddModelDialog : public ModalDialog
{
private:
- Edit* m_pNameED;
- CheckBox* m_pModifyCB;
+ VclPtr<Edit> m_pNameED;
+ VclPtr<CheckBox> m_pModifyCB;
public:
AddModelDialog( vcl::Window* pParent, bool _bEdit );
+ virtual ~AddModelDialog();
+ virtual void dispose() SAL_OVERRIDE;
OUString GetName() const { return m_pNameED->GetText(); }
void SetName( const OUString& _rName ) { m_pNameED->SetText( _rName );}
@@ -623,11 +631,11 @@ namespace svxform
class AddInstanceDialog : public ModalDialog
{
private:
- Edit* m_pNameED;
- FixedText* m_pURLFT;
- SvtURLBox* m_pURLED;
- PushButton* m_pFilePickerBtn;
- CheckBox* m_pLinkInstanceCB;
+ VclPtr<Edit> m_pNameED;
+ VclPtr<FixedText> m_pURLFT;
+ VclPtr<SvtURLBox> m_pURLED;
+ VclPtr<PushButton> m_pFilePickerBtn;
+ VclPtr<CheckBox> m_pLinkInstanceCB;
OUString m_sAllFilterName;
@@ -635,6 +643,8 @@ namespace svxform
public:
AddInstanceDialog( vcl::Window* pParent, bool _bEdit );
+ virtual ~AddInstanceDialog();
+ virtual void dispose() SAL_OVERRIDE;
void SetRenameMode()
{
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index 216ca9ec0a9c..326260e42f52 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -319,7 +319,7 @@ class PluginProgress : public ::cppu::WeakImplHelper2< css::task::XStatusIndicat
css::uno::Reference< css::task::XStatusIndicator > m_xProgress;
- PluginProgressWindow* m_pPlugProgressWindow;
+ VclPtr<PluginProgressWindow> m_pPlugProgressWindow;
// native interface
@@ -370,9 +370,9 @@ class SaveDialog : public Dialog
{
// member
private:
- FixedText* m_pTitleFT;
- ListBox* m_pFileListLB;
- OKButton* m_pOkBtn;
+ VclPtr<FixedText> m_pTitleFT;
+ VclPtr<ListBox> m_pFileListLB;
+ VclPtr<OKButton> m_pOkBtn;
RecoveryCore* m_pCore;
// interface
@@ -393,6 +393,8 @@ class SaveDialog : public Dialog
which should be shown inside this dialog.
*/
SaveDialog(vcl::Window* pParent, RecoveryCore* pCore);
+ virtual ~SaveDialog();
+ virtual void dispose() SAL_OVERRIDE;
DECL_LINK(OKButtonHdl, void*);
};
@@ -402,7 +404,7 @@ class SaveProgressDialog : public ModalDialog
{
// member
private:
- vcl::Window* m_pProgrParent;
+ VclPtr<vcl::Window> m_pProgrParent;
// @short TODO
RecoveryCore* m_pCore;
@@ -426,6 +428,8 @@ class SaveProgressDialog : public ModalDialog
*/
SaveProgressDialog(vcl::Window* pParent,
RecoveryCore* pCore );
+ virtual ~SaveProgressDialog();
+ virtual void dispose() SAL_OVERRIDE;
/** @short start the emergency save operation. */
virtual short Execute() SAL_OVERRIDE;
@@ -493,12 +497,12 @@ class RecoveryDialog : public Dialog
{
// member
private:
- FixedText* m_pTitleFT;
- FixedText* m_pDescrFT;
- vcl::Window* m_pProgrParent;
- RecovDocList* m_pFileListLB;
- PushButton* m_pNextBtn;
- PushButton* m_pCancelBtn;
+ VclPtr<FixedText> m_pTitleFT;
+ VclPtr<FixedText> m_pDescrFT;
+ VclPtr<vcl::Window> m_pProgrParent;
+ VclPtr<RecovDocList> m_pFileListLB;
+ VclPtr<PushButton> m_pNextBtn;
+ VclPtr<PushButton> m_pCancelBtn;
OUString m_aTitleRecoveryInProgress;
OUString m_aRecoveryOnlyFinish;
OUString m_aRecoveryOnlyFinishDescr;
@@ -554,11 +558,11 @@ class BrokenRecoveryDialog : public ModalDialog
// member
private:
- ListBox *m_pFileListLB;
- Edit *m_pSaveDirED;
- PushButton *m_pSaveDirBtn;
- PushButton *m_pOkBtn;
- CancelButton *m_pCancelBtn;
+ VclPtr<ListBox> m_pFileListLB;
+ VclPtr<Edit> m_pSaveDirED;
+ VclPtr<PushButton> m_pSaveDirBtn;
+ VclPtr<PushButton> m_pOkBtn;
+ VclPtr<CancelButton> m_pCancelBtn;
OUString m_sSavePath;
RecoveryCore* m_pCore;
@@ -574,6 +578,8 @@ class BrokenRecoveryDialog : public ModalDialog
BrokenRecoveryDialog(vcl::Window* pParent ,
RecoveryCore* pCore ,
bool bBeforeRecovery);
+ virtual ~BrokenRecoveryDialog();
+ virtual void dispose() SAL_OVERRIDE;
/** @short TODO */
diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx
index 0fbd75111899..966a0f892fee 100644
--- a/svx/source/inc/filtnav.hxx
+++ b/svx/source/inc/filtnav.hxx
@@ -316,7 +316,7 @@ private:
class FmFilterNavigatorWin : public SfxDockingWindow, public SfxControllerItem
{
private:
- FmFilterNavigator* m_pNavigator;
+ VclPtr<FmFilterNavigator> m_pNavigator;
protected:
virtual void Resize() SAL_OVERRIDE;
diff --git a/svx/source/inc/fmexch.hxx b/svx/source/inc/fmexch.hxx
index 5f77950826de..8c2c6b2c6240 100644
--- a/svx/source/inc/fmexch.hxx
+++ b/svx/source/inc/fmexch.hxx
@@ -98,7 +98,7 @@ namespace svxform
class SVX_DLLPUBLIC OLocalExchangeHelper
{
protected:
- vcl::Window* m_pDragSource;
+ VclPtr<vcl::Window> m_pDragSource;
OLocalExchange* m_pTransferable;
public:
diff --git a/svx/source/inc/fmexpl.hxx b/svx/source/inc/fmexpl.hxx
index e5baf40a8fce..187cd750f8ba 100644
--- a/svx/source/inc/fmexpl.hxx
+++ b/svx/source/inc/fmexpl.hxx
@@ -556,7 +556,7 @@ namespace svxform
class NavigatorFrame : public SfxDockingWindow, public SfxControllerItem
{
private:
- ::svxform::NavigatorTree* m_pNavigatorTree;
+ VclPtr<::svxform::NavigatorTree> m_pNavigatorTree;
protected:
virtual void Resize() SAL_OVERRIDE;
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index bc725c197426..31a6adc3f444 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -45,6 +45,7 @@
#include <cppuhelper/implbase3.hxx>
#include <comphelper/uno3.hxx>
#include <rtl/ref.hxx>
+#include <vcl/vclptr.hxx>
class SdrPageWindow;
@@ -93,7 +94,7 @@ class FormViewPageWindowAdapter : public FormViewPageWindowAdapter_Base
::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > m_xControlContainer;
css::uno::Reference<css::uno::XComponentContext> m_xContext;
FmXFormView* m_pViewImpl;
- vcl::Window* m_pWindow;
+ VclPtr<vcl::Window> m_pWindow;
protected:
virtual ~FormViewPageWindowAdapter();
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 8d1ddf95be69..0df523fffa2d 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -214,8 +214,8 @@ private:
protected:
DbGridColumn& m_rColumn;
- vcl::Window* m_pPainter;
- vcl::Window* m_pWindow;
+ VclPtr<vcl::Window> m_pPainter;
+ VclPtr<vcl::Window> m_pWindow;
protected:
// attribute access
@@ -946,8 +946,8 @@ class FmXCheckBoxCell : public FmXDataCell,
{
::cppu::OInterfaceContainerHelper m_aItemListeners;
::cppu::OInterfaceContainerHelper m_aActionListeners;
- OUString m_aActionCommand;
- CheckBox* m_pBox;
+ OUString m_aActionCommand;
+ VclPtr<CheckBox> m_pBox;
protected:
virtual ~FmXCheckBoxCell();
@@ -991,7 +991,7 @@ class FmXListBoxCell :public FmXTextCell
{
::cppu::OInterfaceContainerHelper m_aItemListeners,
m_aActionListeners;
- ListBox* m_pBox;
+ VclPtr<ListBox> m_pBox;
protected:
virtual ~FmXListBoxCell();
@@ -1046,7 +1046,7 @@ class FmXComboBoxCell :public FmXTextCell
private:
::cppu::OInterfaceContainerHelper m_aItemListeners,
m_aActionListeners;
- ComboBox* m_pComboBox;
+ VclPtr<ComboBox> m_pComboBox;
protected:
virtual ~FmXComboBoxCell();
diff --git a/svx/source/inc/svxrectctaccessiblecontext.hxx b/svx/source/inc/svxrectctaccessiblecontext.hxx
index 2ef95908230d..871016352b0b 100644
--- a/svx/source/inc/svxrectctaccessiblecontext.hxx
+++ b/svx/source/inc/svxrectctaccessiblecontext.hxx
@@ -46,6 +46,7 @@
#include <cppuhelper/implbase7.hxx>
#include <comphelper/servicehelper.hxx>
#include <svx/rectenum.hxx>
+#include <vcl/vclptr.hxx>
namespace com { namespace sun { namespace star { namespace awt {
struct Point;
@@ -266,7 +267,7 @@ private:
mxParent;
/// pointer to internal representation
- SvxRectCtl* mpRepr;
+ VclPtr<SvxRectCtl> mpRepr;
/// array for all possible children
SvxRectCtlChildAccessibleContext** mpChildren;
diff --git a/svx/source/inc/tabwin.hxx b/svx/source/inc/tabwin.hxx
index 67230a998865..77c17dcf31ee 100644
--- a/svx/source/inc/tabwin.hxx
+++ b/svx/source/inc/tabwin.hxx
@@ -35,13 +35,15 @@ class FmFieldWin;
class FmFieldWinListBox
:public SvTreeListBox
{
- FmFieldWin* pTabWin;
+ VclPtr<FmFieldWin> pTabWin;
protected:
// virtual void Command( const CommandEvent& rEvt );
public:
FmFieldWinListBox( FmFieldWin* pParent );
+ virtual ~FmFieldWinListBox();
+ virtual void dispose() SAL_OVERRIDE;
sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
@@ -72,7 +74,7 @@ class FmFieldWin :public SfxFloatingWindow
,public ::svxform::OStaticDataAccessTools
{
::osl::Mutex m_aMutex;
- FmFieldWinListBox* pListBox;
+ VclPtr<FmFieldWinListBox> pListBox;
FmFieldWinData* pData;
::svxform::SharedConnection
m_aConnection;
diff --git a/svx/source/inc/tbxform.hxx b/svx/source/inc/tbxform.hxx
index 12bccf10ab13..0014ba65d4b9 100644
--- a/svx/source/inc/tbxform.hxx
+++ b/svx/source/inc/tbxform.hxx
@@ -104,7 +104,7 @@ public:
class SvxFmTbxCtlRecTotal : public SfxToolBoxControl
{
- FixedText* pFixedText;
+ VclPtr<FixedText> pFixedText;
public:
SFX_DECL_TOOLBOX_CONTROL();
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index 43cf9d5246c4..5a66785f4735 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -113,6 +113,23 @@ AreaPropertyPanel::AreaPropertyPanel(
}
+AreaPropertyPanel::~AreaPropertyPanel()
+{
+ dispose();
+}
+
+void AreaPropertyPanel::dispose()
+{
+ mpColorTextFT.clear();
+ mpLbFillType.clear();
+ mpLbFillAttr.clear();
+ mpToolBoxColor.clear();
+ mpTrspTextFT.clear();
+ mpLBTransType.clear();
+ mpMTRTransparent.clear();
+ mpBTNGradient.clear();
+ PanelLayout::dispose();
+}
void AreaPropertyPanel::Initialize()
{
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index aec98db7790d..12243fd32afd 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -35,6 +35,7 @@
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/vclptr.hxx>
#include <svl/intitem.hxx>
#include <com/sun/star/ui/XUIElement.hpp>
#include <boost/scoped_ptr.hpp>
@@ -53,6 +54,9 @@ class AreaPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
+ virtual ~AreaPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
static AreaPropertyPanel* Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -96,14 +100,14 @@ private:
XGradient maGradientRect;
//ui controls
- FixedText* mpColorTextFT;
- SvxFillTypeBox* mpLbFillType;
- SvxFillAttrBox* mpLbFillAttr;
- ToolBox* mpToolBoxColor; // for new color picker
- FixedText* mpTrspTextFT;
- ListBox* mpLBTransType;
- MetricField* mpMTRTransparent;
- ToolBox* mpBTNGradient;
+ VclPtr<FixedText> mpColorTextFT;
+ VclPtr<SvxFillTypeBox> mpLbFillType;
+ VclPtr<SvxFillAttrBox> mpLbFillAttr;
+ VclPtr<ToolBox> mpToolBoxColor; // for new color picker
+ VclPtr<FixedText> mpTrspTextFT;
+ VclPtr<ListBox> mpLBTransType;
+ VclPtr<MetricField> mpMTRTransparent;
+ VclPtr<ToolBox> mpBTNGradient;
::boost::scoped_ptr< XFillStyleItem > mpStyleItem;
::boost::scoped_ptr< XFillColorItem > mpColorItem;
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index b1e6075860fa..98e26fba3d35 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -66,6 +66,23 @@ GraphicPropertyPanel::GraphicPropertyPanel(
Initialize();
}
+GraphicPropertyPanel::~GraphicPropertyPanel()
+{
+ dispose();
+}
+
+void GraphicPropertyPanel::dispose()
+{
+ mpMtrBrightness.clear();
+ mpMtrContrast.clear();
+ mpLBColorMode.clear();
+ mpMtrTrans.clear();
+ mpMtrRed.clear();
+ mpMtrGreen.clear();
+ mpMtrBlue.clear();
+ mpMtrGamma.clear();
+ PanelLayout::dispose();
+}
void GraphicPropertyPanel::Initialize()
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
index 11cb2282a9b7..691d45f62c4c 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
@@ -39,6 +39,9 @@ class GraphicPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
+ virtual ~GraphicPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
static GraphicPropertyPanel* Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -57,14 +60,14 @@ public:
private:
//ui controls
- MetricField* mpMtrBrightness;
- MetricField* mpMtrContrast;
- ListBox* mpLBColorMode;
- MetricField* mpMtrTrans;
- MetricField* mpMtrRed;
- MetricField* mpMtrGreen;
- MetricField* mpMtrBlue;
- MetricField* mpMtrGamma;
+ VclPtr<MetricField> mpMtrBrightness;
+ VclPtr<MetricField> mpMtrContrast;
+ VclPtr<ListBox> mpLBColorMode;
+ VclPtr<MetricField> mpMtrTrans;
+ VclPtr<MetricField> mpMtrRed;
+ VclPtr<MetricField> mpMtrGreen;
+ VclPtr<MetricField> mpMtrBlue;
+ VclPtr<MetricField> mpMtrGamma;
::sfx2::sidebar::ControllerItem maBrightControl;
::sfx2::sidebar::ControllerItem maContrastControl;
diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.cxx b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
index 70fae60f543e..08f2dad99387 100644
--- a/svx/source/sidebar/insert/InsertPropertyPanel.cxx
+++ b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
@@ -87,6 +87,8 @@ void InsertPropertyPanel::dispose()
while (pTopWindow->GetParent() != NULL)
pTopWindow = pTopWindow->GetParent();
pTopWindow->RemoveChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
+ mpStandardShapesToolBox.clear();
+ mpCustomShapesToolBox.clear();
PanelLayout::dispose();
}
@@ -124,13 +126,13 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent)
if (nId == 0)
return 1;
- SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox);
+ SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox.get());
if (pSidebarToolBox == NULL)
return 1;
sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path));
if (nItemId == 0)
{
- pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox);
+ pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox.get());
if (pSidebarToolBox == NULL)
return 1;
nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path);
diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.hxx b/svx/source/sidebar/insert/InsertPropertyPanel.hxx
index 391b69f7e8be..2539695313bf 100644
--- a/svx/source/sidebar/insert/InsertPropertyPanel.hxx
+++ b/svx/source/sidebar/insert/InsertPropertyPanel.hxx
@@ -45,8 +45,8 @@ public:
virtual void dispose() SAL_OVERRIDE;
private:
- ToolBox* mpStandardShapesToolBox;
- ToolBox* mpCustomShapesToolBox;
+ VclPtr<ToolBox> mpStandardShapesToolBox;
+ VclPtr<ToolBox> mpCustomShapesToolBox;
const css::uno::Reference<css::frame::XFrame> mxFrame;
DECL_LINK(WindowEventListener, VclSimpleEvent*);
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index d830f337ebd8..f2c7a94bb309 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -192,6 +192,29 @@ LinePropertyPanel::LinePropertyPanel(
Initialize();
}
+LinePropertyPanel::~LinePropertyPanel()
+{
+ dispose();
+}
+
+void LinePropertyPanel::dispose()
+{
+ mpFTWidth.clear();
+ mpTBWidth.clear();
+ mpFTStyle.clear();
+ mpLBStyle.clear();
+ mpFTTrancparency.clear();
+ mpMFTransparent.clear();
+ mpFTArrow.clear();
+ mpLBStart.clear();
+ mpLBEnd.clear();
+ mpFTEdgeStyle.clear();
+ mpLBEdgeStyle.clear();
+ mpFTCapStyle.clear();
+ mpLBCapStyle.clear();
+ PanelLayout::dispose();
+}
+
void LinePropertyPanel::Initialize()
{
mpIMGWidthIcon.reset(new Image[8]);
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx
index 84354e44ecd5..2567a5e37339 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -60,6 +60,9 @@ class LinePropertyPanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
+ virtual ~LinePropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
static LinePropertyPanel* Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -84,19 +87,19 @@ public:
private:
//ui controls
- FixedText* mpFTWidth;
- ToolBox* mpTBWidth;
- FixedText* mpFTStyle;
- ListBox* mpLBStyle;
- FixedText* mpFTTrancparency;
- MetricField* mpMFTransparent;
- FixedText* mpFTArrow;
- ListBox* mpLBStart;
- ListBox* mpLBEnd;
- FixedText* mpFTEdgeStyle;
- ListBox* mpLBEdgeStyle;
- FixedText* mpFTCapStyle;
- ListBox* mpLBCapStyle;
+ VclPtr<FixedText> mpFTWidth;
+ VclPtr<ToolBox> mpTBWidth;
+ VclPtr<FixedText> mpFTStyle;
+ VclPtr<ListBox> mpLBStyle;
+ VclPtr<FixedText> mpFTTrancparency;
+ VclPtr<MetricField> mpMFTransparent;
+ VclPtr<FixedText> mpFTArrow;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<ListBox> mpLBEnd;
+ VclPtr<FixedText> mpFTEdgeStyle;
+ VclPtr<ListBox> mpLBEdgeStyle;
+ VclPtr<FixedText> mpFTCapStyle;
+ VclPtr<ListBox> mpLBCapStyle;
//ControllerItem
sfx2::sidebar::ControllerItem maStyleControl;
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
index 9f3fe4ab74ab..ccb0b24974f4 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
@@ -62,7 +62,7 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId)
mpLineDistAtPercentBox = get<MetricField>("percent_box");
mpLineDistAtMetricBox = get<MetricField>("metric_box");
- mpActLineDistFld = mpLineDistAtPercentBox;
+ mpActLineDistFld = mpLineDistAtPercentBox.get();
meLNSpaceUnit = SFX_MAPUNIT_100TH_MM;
@@ -92,6 +92,25 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId)
Initialize();
}
+ParaLineSpacingControl::~ParaLineSpacingControl()
+{
+ dispose();
+}
+
+void ParaLineSpacingControl::dispose()
+{
+ mpActLineDistFld.clear();
+ mpSpacing1Button.clear();
+ mpSpacing115Button.clear();
+ mpSpacing15Button.clear();
+ mpSpacing2Button.clear();
+ mpLineDist.clear();
+ mpLineDistLabel.clear();
+ mpLineDistAtPercentBox.clear();
+ mpLineDistAtMetricBox.clear();
+ SfxPopupWindow::dispose();
+}
+
void ParaLineSpacingControl::Initialize()
{
const SfxPoolItem* pItem;
@@ -241,7 +260,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_DURCH:
mpLineDistAtPercentBox->Hide();
- mpActLineDistFld = mpLineDistAtMetricBox;
+ mpActLineDistFld = mpLineDistAtMetricBox.get();
mpLineDistAtMetricBox->SetMin(0);
if (mpLineDistAtMetricBox->GetText().isEmpty())
@@ -255,7 +274,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_MIN:
mpLineDistAtPercentBox->Hide();
- mpActLineDistFld = mpLineDistAtMetricBox;
+ mpActLineDistFld = mpLineDistAtMetricBox.get();
mpLineDistAtMetricBox->SetMin(0);
if (mpLineDistAtMetricBox->GetText().isEmpty())
@@ -269,7 +288,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_PROP:
mpLineDistAtMetricBox->Hide();
- mpActLineDistFld = mpLineDistAtPercentBox;
+ mpActLineDistFld = mpLineDistAtPercentBox.get();
if (mpLineDistAtPercentBox->GetText().isEmpty())
mpLineDistAtPercentBox->SetValue(mpLineDistAtPercentBox->Normalize(100), FUNIT_TWIP);
@@ -282,7 +301,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_FIX:
mpLineDistAtPercentBox->Hide();
- mpActLineDistFld = mpLineDistAtMetricBox;
+ mpActLineDistFld = mpLineDistAtMetricBox.get();
sal_Int64 nTemp = mpLineDistAtMetricBox->GetValue();
mpLineDistAtMetricBox->SetMin(mpLineDistAtMetricBox->Normalize(MIN_FIXED_DISTANCE), FUNIT_TWIP);
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
index cabcba511f4d..d5609eb195e3 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
@@ -30,22 +30,24 @@ class ParaLineSpacingControl : public SfxPopupWindow
{
public:
ParaLineSpacingControl(sal_uInt16 nId);
+ virtual ~ParaLineSpacingControl();
+ virtual void dispose() SAL_OVERRIDE;
private:
SfxMapUnit meLNSpaceUnit;
- Edit* mpActLineDistFld;
+ VclPtr<Edit> mpActLineDistFld;
- PushButton* mpSpacing1Button;
- PushButton* mpSpacing115Button;
- PushButton* mpSpacing15Button;
- PushButton* mpSpacing2Button;
+ VclPtr<PushButton> mpSpacing1Button;
+ VclPtr<PushButton> mpSpacing115Button;
+ VclPtr<PushButton> mpSpacing15Button;
+ VclPtr<PushButton> mpSpacing2Button;
- ListBox* mpLineDist;
+ VclPtr<ListBox> mpLineDist;
- FixedText* mpLineDistLabel;
- MetricField* mpLineDistAtPercentBox;
- MetricField* mpLineDistAtMetricBox;
+ VclPtr<FixedText> mpLineDistLabel;
+ VclPtr<MetricField> mpLineDistAtPercentBox;
+ VclPtr<MetricField> mpLineDistAtMetricBox;
private:
/// Setup the widgets with values from the document.
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 93a789693d22..0c9759bf690e 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -746,6 +746,26 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
m_aMetricCtl.RequestUpdate();
}
+ParaPropertyPanel::~ParaPropertyPanel()
+{
+ dispose();
+}
+
+void ParaPropertyPanel::dispose()
+{
+ mpTBxVertAlign.clear();
+ mpTBxNumBullet.clear();
+ mpTBxBackColor.clear();
+ mpTopDist.clear();
+ mpBottomDist.clear();
+ mpTbxIndent_IncDec.clear();
+ mpTbxProDemote.clear();
+ mpLeftIndent.clear();
+ mpRightIndent.clear();
+ mpFLineIndent.clear();
+ PanelLayout::dispose();
+}
+
} } // end of namespace svx::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index f49ce15fb3e3..2b4d877344f1 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -43,6 +43,9 @@ class ParaPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
+ virtual ~ParaPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
static ParaPropertyPanel* Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -66,18 +69,18 @@ public:
private:
// UI controls
//Alignment
- ToolBox* mpTBxVertAlign;
+ VclPtr<ToolBox> mpTBxVertAlign;
//NumBullet&Backcolor
- ToolBox* mpTBxNumBullet;
- ToolBox* mpTBxBackColor;
+ VclPtr<ToolBox> mpTBxNumBullet;
+ VclPtr<ToolBox> mpTBxBackColor;
//Paragraph spacing
- SvxRelativeField* mpTopDist;
- SvxRelativeField* mpBottomDist;
- ToolBox* mpTbxIndent_IncDec;
- ToolBox* mpTbxProDemote;
- SvxRelativeField* mpLeftIndent;
- SvxRelativeField* mpRightIndent;
- SvxRelativeField* mpFLineIndent;
+ VclPtr<SvxRelativeField> mpTopDist;
+ VclPtr<SvxRelativeField> mpBottomDist;
+ VclPtr<ToolBox> mpTbxIndent_IncDec;
+ VclPtr<ToolBox> mpTbxProDemote;
+ VclPtr<SvxRelativeField> mpLeftIndent;
+ VclPtr<SvxRelativeField> mpRightIndent;
+ VclPtr<SvxRelativeField> mpFLineIndent;
// Resources
Image maSpace3;
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 6d4d5ea6bb59..24dfebd71b85 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -115,6 +115,29 @@ PosSizePropertyPanel::PosSizePropertyPanel(
mpBindings->Update( SID_ATTR_METRIC );
}
+PosSizePropertyPanel::~PosSizePropertyPanel()
+{
+ dispose();
+}
+
+void PosSizePropertyPanel::dispose()
+{
+ mpFtPosX.clear();
+ mpMtrPosX.clear();
+ mpFtPosY.clear();
+ mpMtrPosY.clear();
+ mpFtWidth.clear();
+ mpMtrWidth.clear();
+ mpFtHeight.clear();
+ mpMtrHeight.clear();
+ mpCbxScale.clear();
+ mpFtAngle.clear();
+ mpMtrAngle.clear();
+ mpDial.clear();
+ mpFtFlip.clear();
+ mpFlipTbx.clear();
+ PanelLayout::dispose();
+}
namespace
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index 2eb297d32582..d8a2685e1cde 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -50,6 +50,9 @@ class PosSizePropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
+ virtual ~PosSizePropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
static PosSizePropertyPanel* Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -72,28 +75,28 @@ public:
private:
//Position
- FixedText* mpFtPosX;
- MetricField* mpMtrPosX;
- FixedText* mpFtPosY;
- MetricField* mpMtrPosY;
+ VclPtr<FixedText> mpFtPosX;
+ VclPtr<MetricField> mpMtrPosX;
+ VclPtr<FixedText> mpFtPosY;
+ VclPtr<MetricField> mpMtrPosY;
// size
- FixedText* mpFtWidth;
- MetricField* mpMtrWidth;
- FixedText* mpFtHeight;
- MetricField* mpMtrHeight;
- CheckBox* mpCbxScale;
+ VclPtr<FixedText> mpFtWidth;
+ VclPtr<MetricField> mpMtrWidth;
+ VclPtr<FixedText> mpFtHeight;
+ VclPtr<MetricField> mpMtrHeight;
+ VclPtr<CheckBox> mpCbxScale;
//rotation
- FixedText* mpFtAngle;
- MetricBox* mpMtrAngle;
+ VclPtr<FixedText> mpFtAngle;
+ VclPtr<MetricBox> mpMtrAngle;
//rotation control
- SidebarDialControl* mpDial;
+ VclPtr<SidebarDialControl> mpDial;
//flip
- FixedText* mpFtFlip;
- ToolBox* mpFlipTbx;
+ VclPtr<FixedText> mpFtFlip;
+ VclPtr<ToolBox> mpFlipTbx;
// Internal variables
basegfx::B2DRange maRect;
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index ee3048354b93..667bb91d3d04 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -114,6 +114,21 @@ TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Ref
mlKerning = 0;
}
+TextPropertyPanel::~TextPropertyPanel()
+{
+ dispose();
+}
+
+void TextPropertyPanel::dispose()
+{
+ mpToolBoxFont.clear();
+ mpToolBoxIncDec.clear();
+ mpToolBoxSpacing.clear();
+ mpToolBoxFontColorSw.clear();
+ mpToolBoxFontColor.clear();
+ PanelLayout::dispose();
+}
+
void TextPropertyPanel::HandleContextChange (
const ::sfx2::sidebar::EnumContext& rContext)
{
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index 87b12dc63be8..a5f295f264d8 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -46,6 +46,9 @@ class TextPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
+ virtual ~TextPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
static TextPropertyPanel* Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
@@ -73,11 +76,11 @@ public:
private:
//ui controls
- ToolBox* mpToolBoxFont;
- ToolBox* mpToolBoxIncDec;
- ToolBox* mpToolBoxSpacing;
- ToolBox* mpToolBoxFontColorSw;
- ToolBox* mpToolBoxFontColor;
+ VclPtr<ToolBox> mpToolBoxFont;
+ VclPtr<ToolBox> mpToolBoxIncDec;
+ VclPtr<ToolBox> mpToolBoxSpacing;
+ VclPtr<ToolBox> mpToolBoxFontColorSw;
+ VclPtr<ToolBox> mpToolBoxFontColor;
//control items
::sfx2::sidebar::ControllerItem maFontSizeControl;
diff --git a/svx/source/sidebar/tools/Popup.cxx b/svx/source/sidebar/tools/Popup.cxx
index 18109ec39f9d..91301c8cfca5 100644
--- a/svx/source/sidebar/tools/Popup.cxx
+++ b/svx/source/sidebar/tools/Popup.cxx
@@ -36,7 +36,7 @@ Popup::Popup (
msAccessibleName(rsAccessibleName),
mxContainer()
{
- OSL_ASSERT(mpParent!=NULL);
+ OSL_ASSERT(mpParent!=nullptr);
OSL_ASSERT(maControlCreator);
}
@@ -94,8 +94,8 @@ void Popup::SetPopupModeEndHandler (const ::boost::function<void(void)>& rCallba
void Popup::ProvideContainerAndControl (void)
{
if ( ! (mxContainer && mxControl)
- && mpParent!=NULL
- && maControlCreator)
+ && mpParent != nullptr
+ && maControlCreator)
{
CreateContainerAndControl();
}
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 8692c53bdfae..22e4167850de 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -33,8 +33,8 @@
//sibling after that is going to fail hard
class CandidateMgr
{
- std::vector<vcl::Window*> m_aCandidates;
- std::set<vcl::Window*> m_aDeletedCandidates;
+ std::vector<VclPtr<vcl::Window> > m_aCandidates;
+ std::set<VclPtr<vcl::Window> > m_aDeletedCandidates;
DECL_LINK(WindowEventListener, VclSimpleEvent*);
public:
void PaintTransparentChildren(vcl::Window & rWindow, Rectangle const& rPixelRect);
@@ -58,10 +58,9 @@ IMPL_LINK(CandidateMgr, WindowEventListener, VclSimpleEvent*, pEvent)
CandidateMgr::~CandidateMgr()
{
- for (std::vector<vcl::Window*>::iterator aI = m_aCandidates.begin();
- aI != m_aCandidates.end(); ++aI)
+ for (auto aI = m_aCandidates.begin(); aI != m_aCandidates.end(); ++aI)
{
- vcl::Window* pCandidate = *aI;
+ VclPtr<vcl::Window> pCandidate = *aI;
if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end())
continue;
pCandidate->RemoveEventListener(LINK(this, CandidateMgr, WindowEventListener));
@@ -97,8 +96,7 @@ void CandidateMgr::PaintTransparentChildren(vcl::Window & rWindow, Rectangle con
pCandidate = pCandidate->GetWindow( WINDOW_NEXT );
}
- for (std::vector<vcl::Window*>::iterator aI = m_aCandidates.begin();
- aI != m_aCandidates.end(); ++aI)
+ for (auto aI = m_aCandidates.begin(); aI != m_aCandidates.end(); ++aI)
{
pCandidate = *aI;
if (m_aDeletedCandidates.find(pCandidate) != m_aDeletedCandidates.end())
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 367cd8fbedea..660bb9041a16 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -722,7 +722,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
pTextEditOutlinerView->ShowCursor();
pTextEditOutliner->SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
pTextEditOutliner->ClearModifyFlag();
@@ -1202,7 +1202,7 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1218,7 +1218,7 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin)
if (!bPostIt) {
Point aPt(rMEvt.GetPosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
+ else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
bPostIt=IsTextEditHit(aPt,nHitTolLog);
}
if (bPostIt) {
@@ -1236,7 +1236,7 @@ bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, vcl::Window* pWin)
if (pTextEditOutlinerView->MouseButtonDown(aMEvt)) {
if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1253,7 +1253,7 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin)
if (!bPostIt) {
Point aPt(rMEvt.GetPosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
+ else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
bPostIt=IsTextEditHit(aPt,nHitTolLog);
}
if (bPostIt) {
@@ -1267,7 +1267,7 @@ bool SdrObjEditView::MouseButtonUp(const MouseEvent& rMEvt, vcl::Window* pWin)
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseButtonUp(aMEvt)) {
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1305,7 +1305,7 @@ bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin)
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseMove(aMEvt) && bSelMode) {
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1325,7 +1325,7 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
if (!bPostIt && rCEvt.IsMouseEvent()) {
Point aPt(rCEvt.GetMousePosPixel());
if (pWin!=NULL) aPt=pWin->PixelToLogic(aPt);
- else if (pTextEditWin!=NULL) aPt=pTextEditWin->PixelToLogic(aPt);
+ else if (pTextEditWin!=nullptr) aPt=pTextEditWin->PixelToLogic(aPt);
bPostIt=IsTextEditHit(aPt,nHitTolLog);
}
if (bPostIt) {
@@ -1342,7 +1342,7 @@ bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
pTextEditOutlinerView->Command(aCEvt);
if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
ImpMakeTextCursorAreaVisible();
return true;
@@ -1392,7 +1392,7 @@ bool SdrObjEditView::ImpIsTextEditAllSelected() const
void SdrObjEditView::ImpMakeTextCursorAreaVisible()
{
- if (pTextEditOutlinerView!=NULL && pTextEditWin!=NULL) {
+ if (pTextEditOutlinerView!=nullptr && pTextEditWin!=nullptr) {
vcl::Cursor* pCsr=pTextEditWin->GetCursor();
if (pCsr!=NULL) {
Size aSiz(pCsr->GetSize());
@@ -1613,7 +1613,7 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
pTextEditOutlinerView->SetAttribs(rSet);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
+ if (pItemBrowser!=nullptr)
pItemBrowser->SetDirty();
#endif
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index eb1fcfbce81f..cc0b28dd59eb 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -162,14 +162,15 @@ bool ImpItemListRow::operator==(const ImpItemListRow& rEntry) const
class ImpItemEdit: public Edit
{
- _SdrItemBrowserControl* pBrowse;
+ VclPtr<_SdrItemBrowserControl> pBrowse;
public:
ImpItemEdit(vcl::Window* pParent, _SdrItemBrowserControl* pBrowse_, WinBits nBits=0)
: Edit(pParent, nBits),
pBrowse(pBrowse_)
{}
-
+ virtual ~ImpItemEdit() { dispose(); }
+ virtual void dispose() SAL_OVERRIDE { pBrowse.clear(); Edit::dispose(); }
virtual void KeyInput(const KeyEvent& rEvt) SAL_OVERRIDE;
};
@@ -217,7 +218,7 @@ _SdrItemBrowserControl::~_SdrItemBrowserControl()
void _SdrItemBrowserControl::dispose()
{
- delete pEditControl;
+ pEditControl.clear();
delete pAktChangeEntry;
@@ -529,10 +530,9 @@ bool _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos)
bool _SdrItemBrowserControl::EndChangeEntry()
{
bool bRet = false;
- if (pEditControl!=NULL) {
+ if (pEditControl!=nullptr) {
aEntryChangedHdl.Call(this);
- delete pEditControl;
- pEditControl=NULL;
+ pEditControl.clear();
delete pAktChangeEntry;
pAktChangeEntry=NULL;
vcl::Window* pParent=GetParent();
@@ -545,9 +545,8 @@ bool _SdrItemBrowserControl::EndChangeEntry()
void _SdrItemBrowserControl::BrkChangeEntry()
{
- if (pEditControl!=NULL) {
- delete pEditControl;
- pEditControl=NULL;
+ if (pEditControl!=nullptr) {
+ pEditControl.clear();
delete pAktChangeEntry;
pAktChangeEntry=NULL;
vcl::Window* pParent=GetParent();
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 52194e44620a..cfc0cb9e5e31 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -2091,7 +2091,7 @@ void SdrMarkView::MarkListHasChanged()
bMarkedObjRectDirty=true;
bMarkedPointsRectsDirty=true;
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
bool bOneEdgeMarked=false;
if (GetMarkedObjectCount()==1) {
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index c50ba5876059..a30737b72f9a 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -235,10 +235,7 @@ SdrPaintView::~SdrPaintView()
ClearPageView();
#ifdef DBG_UTIL
- if(pItemBrowser)
- {
- delete pItemBrowser;
- }
+ pItemBrowser.clear();
#endif
// delete existing SdrPaintWindows
@@ -474,7 +471,7 @@ void SdrPaintView::AddWindowToPaintView(OutputDevice* pNewWin)
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
+ if (pItemBrowser!=nullptr)
pItemBrowser->ForceParent();
#endif
}
@@ -496,7 +493,7 @@ void SdrPaintView::DeleteWindowFromPaintView(OutputDevice* pOldWin)
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL)
+ if (pItemBrowser!=nullptr)
pItemBrowser->ForceParent();
#endif
}
@@ -1061,7 +1058,7 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, bool bReplaceAll)
else aDefaultAttr.Put(rAttr,false); // if FALSE, regard InvalidItems as "holes," not as Default
SetNotPersistDefaultAttr(rAttr,bReplaceAll);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
}
@@ -1084,7 +1081,7 @@ void SdrPaintView::SetDefaultStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRe
}
}
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
}
@@ -1127,16 +1124,15 @@ bool SdrPaintView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHar
void SdrPaintView::ShowItemBrowser(bool bShow)
{
if (bShow) {
- if (pItemBrowser==NULL) {
+ if (pItemBrowser==nullptr) {
pItemBrowser=new SdrItemBrowser(*static_cast<SdrView*>(this));
}
pItemBrowser->Show();
pItemBrowser->GrabFocus();
} else {
- if (pItemBrowser!=NULL) {
+ if (pItemBrowser!=nullptr) {
pItemBrowser->Hide();
- delete pItemBrowser;
- pItemBrowser=NULL;
+ pItemBrowser.clear();
}
}
}
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 89589ba4e1bc..44cb7f006792 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1362,7 +1362,7 @@ void SdrView::MarkAll()
if (IsTextEdit()) {
GetTextEditOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL));
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
} else if (IsGluePointEditMode()) MarkAllGluePoints();
else if (HasMarkablePoints()) MarkAllPoints();
@@ -1377,7 +1377,7 @@ void SdrView::UnmarkAll()
eSel.nStartPos=eSel.nEndPos;
GetTextEditOutlinerView()->SetSelection(eSel);
#ifdef DBG_UTIL
- if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
+ if (pItemBrowser!=nullptr) pItemBrowser->SetDirty();
#endif
} else if (HasMarkedGluePoints()) UnmarkAllGluePoints();
else if (HasMarkedPoints()) UnmarkAllPoints(); // Marked, not Markable!
diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx
index bc47a66ec219..4e7c2db0f274 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -40,13 +40,15 @@ class NumberingPopup : public svtools::ToolbarMenu
{
bool mbBulletItem;
NumberingToolBoxControl& mrController;
- SvxNumValueSet* mpValueSet;
+ VclPtr<SvxNumValueSet> mpValueSet;
DECL_LINK( VSSelectHdl, void * );
public:
NumberingPopup( NumberingToolBoxControl& rController,
const css::uno::Reference< css::frame::XFrame >& rFrame,
vcl::Window* pParent, bool bBulletItem );
+ virtual ~NumberingPopup();
+ virtual void dispose() SAL_OVERRIDE;
virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent )
throw ( css::uno::RuntimeException ) SAL_OVERRIDE;
@@ -133,6 +135,17 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController,
AddStatusListener( ".uno:CurrentNumListType" );
}
+NumberingPopup::~NumberingPopup()
+{
+ dispose();
+}
+
+void NumberingPopup::dispose()
+{
+ mpValueSet.clear();
+ ToolbarMenu::dispose();
+}
+
void NumberingPopup::statusChanged( const css::frame::FeatureStateEvent& rEvent )
throw ( css::uno::RuntimeException )
{
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index a05ec801717e..eae25a8d9467 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -37,13 +37,13 @@ class SvxColorWindow_Impl : public SfxPopupWindow
private:
const sal_uInt16 theSlotId;
- SvxColorValueSet* mpColorSet;
- SvxColorValueSet* mpRecentColorSet;
+ VclPtr<SvxColorValueSet> mpColorSet;
+ VclPtr<SvxColorValueSet> mpRecentColorSet;
- ListBox* mpPaletteListBox;
- PushButton* mpButtonAutoColor;
- PushButton* mpButtonPicker;
- FixedLine* mpAutomaticSeparator;
+ VclPtr<ListBox> mpPaletteListBox;
+ VclPtr<PushButton> mpButtonAutoColor;
+ VclPtr<PushButton> mpButtonPicker;
+ VclPtr<FixedLine> mpAutomaticSeparator;
OUString maCommand;
Link maSelectedLink;
@@ -67,6 +67,8 @@ public:
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame,
const OUString& rWndTitle,
vcl::Window* pParentWindow);
+ virtual ~SvxColorWindow_Impl();
+ virtual void dispose() SAL_OVERRIDE;
void StartSelection();
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx
index cafd700302df..4366ac12c74e 100644
--- a/svx/source/tbxctrls/extrusioncontrols.cxx
+++ b/svx/source/tbxctrls/extrusioncontrols.cxx
@@ -104,6 +104,17 @@ ExtrusionDirectionWindow::ExtrusionDirectionWindow(
AddStatusListener( msExtrusionProjection );
}
+ExtrusionDirectionWindow::~ExtrusionDirectionWindow()
+{
+ dispose();
+}
+
+void ExtrusionDirectionWindow::dispose()
+{
+ mpDirectionSet.clear();
+ ToolbarMenu::dispose();
+}
+
void ExtrusionDirectionWindow::DataChanged( const DataChangedEvent& rDCEvt )
{
ToolbarMenu::DataChanged( rDCEvt );
@@ -298,6 +309,17 @@ ExtrusionDepthDialog::ExtrusionDepthDialog( vcl::Window* pParent, double fDepth,
m_pMtrDepth->SetValue( (int) fDepth * 100, FUNIT_100TH_MM );
}
+ExtrusionDepthDialog::~ExtrusionDepthDialog()
+{
+ dispose();
+}
+
+void ExtrusionDepthDialog::dispose()
+{
+ m_pMtrDepth.clear();
+ ModalDialog::dispose();
+}
+
double ExtrusionDepthDialog::getDepth() const
{
return (double)( m_pMtrDepth->GetValue( FUNIT_100TH_MM ) ) / 100.0;
@@ -578,6 +600,17 @@ ExtrusionLightingWindow::ExtrusionLightingWindow(svt::ToolboxController& rContro
AddStatusListener( msExtrusionLightingIntensity );
}
+ExtrusionLightingWindow::~ExtrusionLightingWindow()
+{
+ dispose();
+}
+
+void ExtrusionLightingWindow::dispose()
+{
+ mpLightingSet.clear();
+ ToolbarMenu::dispose();
+}
+
void ExtrusionLightingWindow::implSetIntensity( int nLevel, bool bEnabled )
{
mnLevel = nLevel;
diff --git a/svx/source/tbxctrls/extrusioncontrols.hxx b/svx/source/tbxctrls/extrusioncontrols.hxx
index 4371153b00ea..210d64d63267 100644
--- a/svx/source/tbxctrls/extrusioncontrols.hxx
+++ b/svx/source/tbxctrls/extrusioncontrols.hxx
@@ -41,13 +41,15 @@ class ExtrusionDirectionWindow : public svtools::ToolbarMenu
{
public:
ExtrusionDirectionWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, vcl::Window* pParentWindow );
+ virtual ~ExtrusionDirectionWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
private:
svt::ToolboxController& mrController;
- ValueSet* mpDirectionSet;
+ VclPtr<ValueSet> mpDirectionSet;
Image maImgDirection[9];
Image maImgPerspective;
@@ -137,7 +139,7 @@ class ExtrusionLightingWindow : public svtools::ToolbarMenu
{
private:
svt::ToolboxController& mrController;
- ValueSet* mpLightingSet;
+ VclPtr<ValueSet> mpLightingSet;
Image maImgLightingOff[9];
Image maImgLightingOn[9];
@@ -161,6 +163,8 @@ private:
DECL_LINK( SelectHdl, void * );
public:
ExtrusionLightingWindow( svt::ToolboxController& rController, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, vcl::Window* pParentWindow );
+ virtual ~ExtrusionLightingWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 0ce6f92d7bce..eb677739acf1 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -567,8 +567,8 @@ FillControl::~FillControl()
void FillControl::dispose()
{
- delete mpLbFillType;
- delete mpLbFillAttr;
+ mpLbFillType.clear();
+ mpLbFillAttr.clear();
vcl::Window::dispose();
}
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index a0ec59088431..c36e58220267 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -94,6 +94,17 @@ FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, vcl::Window* pP
fillFavorites( GALLERY_THEME_FONTWORK );
}
+FontWorkGalleryDialog::~FontWorkGalleryDialog()
+{
+ dispose();
+}
+
+void FontWorkGalleryDialog::dispose()
+{
+ mpCtlFavorites.clear();
+ mpOKButton.clear();
+ ModalDialog::dispose();
+}
void FontWorkGalleryDialog::initFavorites(sal_uInt16 nThemeId)
{
@@ -708,6 +719,17 @@ FontworkCharacterSpacingDialog::FontworkCharacterSpacingDialog( vcl::Window* pPa
m_pMtrScale->SetValue( nScale );
}
+FontworkCharacterSpacingDialog::~FontworkCharacterSpacingDialog()
+{
+ dispose();
+}
+
+void FontworkCharacterSpacingDialog::dispose()
+{
+ m_pMtrScale.clear();
+ ModalDialog::dispose();
+}
+
sal_Int32 FontworkCharacterSpacingDialog::getScale() const
{
return (sal_Int32)m_pMtrScale->GetValue();
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index f65d68ff4daf..1f500a711886 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -54,14 +54,16 @@ class SvxPopupWindowListBox: public SfxPopupWindow
{
using FloatingWindow::StateChanged;
- ListBox * m_pListBox;
+ VclPtr<ListBox> m_pListBox;
ToolBox & rToolBox;
bool bUserSel;
- sal_uInt16 nTbxId;
- OUString maCommandURL;
+ sal_uInt16 nTbxId;
+ OUString maCommandURL;
public:
SvxPopupWindowListBox( sal_uInt16 nSlotId, const OUString& rCommandURL, sal_uInt16 nTbxId, ToolBox& rTbx );
+ virtual ~SvxPopupWindowListBox();
+ virtual void dispose() SAL_OVERRIDE;
// SfxPopupWindow
virtual SfxPopupWindow * Clone() const SAL_OVERRIDE;
@@ -96,6 +98,17 @@ SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString&
AddStatusListener( rCommandURL );
}
+SvxPopupWindowListBox::~SvxPopupWindowListBox()
+{
+ dispose();
+}
+
+void SvxPopupWindowListBox::dispose()
+{
+ m_pListBox.clear();
+ SfxPopupWindow::dispose();
+}
+
SfxPopupWindow* SvxPopupWindowListBox::Clone() const
{
return new SvxPopupWindowListBox( GetId(), maCommandURL, nTbxId, rToolBox );
@@ -140,9 +153,7 @@ SvxListBoxControl::SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBo
SvxListBoxControl::~SvxListBoxControl()
-{
-}
-
+{}
SfxPopupWindow* SvxListBoxControl::CreatePopupWindow()
{
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index b2926fd970f9..79f1edfc703b 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1242,6 +1242,22 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
}
}
+SvxColorWindow_Impl::~SvxColorWindow_Impl()
+{
+ dispose();
+}
+
+void SvxColorWindow_Impl::dispose()
+{
+ mpColorSet.clear();
+ mpRecentColorSet.clear();
+ mpPaletteListBox.clear();
+ mpButtonAutoColor.clear();
+ mpButtonPicker.clear();
+ mpAutomaticSeparator.clear();
+ SfxPopupWindow::dispose();
+}
+
void SvxColorWindow_Impl::KeyInput( const KeyEvent& rKEvt )
{
mpColorSet->KeyInput(rKEvt);
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index 680e9a32040d..18bb2ba05bc9 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -80,7 +80,7 @@ class FontHeightToolBoxControl : public svt::ToolboxController,
using svt::ToolboxController::dispatchCommand;
private:
- SvxFontSizeBox_Impl* m_pBox;
+ VclPtr<SvxFontSizeBox_Impl> m_pBox;
::com::sun::star::awt::FontDescriptor m_aCurrentFont;
};
@@ -343,8 +343,7 @@ throw (uno::RuntimeException, std::exception)
svt::ToolboxController::dispose();
SolarMutexGuard aSolarMutexGuard;
- delete m_pBox;
- m_pBox = 0;
+ m_pBox.clear();
}
// XStatusListener
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 4931df050026..1d175ff54704 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -415,8 +415,7 @@ void SAL_CALL FindTextToolbarController::dispose() throw ( css::uno::RuntimeExce
if (m_pFindTextFieldControl != nullptr) {
SearchToolbarControllersManager::createControllersManager()
.saveSearchHistory(m_pFindTextFieldControl);
- delete m_pFindTextFieldControl;
- m_pFindTextFieldControl = 0;
+ m_pFindTextFieldControl.disposeAndClear();
}
}
@@ -661,8 +660,7 @@ void SAL_CALL MatchCaseToolboxController::dispose() throw ( css::uno::RuntimeExc
svt::ToolboxController::dispose();
- delete m_pMatchCaseControl;
- m_pMatchCaseControl = 0;
+ m_pMatchCaseControl.clear();
}
// XInitialization
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 3cae7ead6f03..7a461ef72dc2 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -60,6 +60,19 @@ DictionaryList::DictionaryList(SvSimpleTableContainer& rParent, WinBits nBits)
{
}
+DictionaryList::~DictionaryList()
+{
+ dispose();
+}
+
+void DictionaryList::dispose()
+{
+ m_pED_Term.clear();
+ m_pED_Mapping.clear();
+ m_pLB_Property.clear();
+ SvSimpleTable::dispose();
+}
+
OUString DictionaryList::getPropertyTypeName( sal_Int16 nConversionPropertyType ) const
{
if(!m_pLB_Property || !m_pLB_Property->GetEntryCount())
@@ -548,8 +561,22 @@ ChineseDictionaryDialog::~ChineseDictionaryDialog()
void ChineseDictionaryDialog::dispose()
{
m_xContext=0;
- delete m_pCT_DictionaryToSimplified;
- delete m_pCT_DictionaryToTraditional;
+ m_pCT_DictionaryToSimplified.clear();
+ m_pCT_DictionaryToTraditional.clear();
+ m_pRB_To_Simplified.clear();
+ m_pRB_To_Traditional.clear();
+ m_pCB_Reverse.clear();
+ m_pFT_Term.clear();
+ m_pED_Term.clear();
+ m_pFT_Mapping.clear();
+ m_pED_Mapping.clear();
+ m_pFT_Property.clear();
+ m_pLB_Property.clear();
+ mpToSimplifiedContainer.clear();
+ mpToTraditionalContainer.clear();
+ m_pPB_Add.clear();
+ m_pPB_Modify.clear();
+ m_pPB_Delete.clear();
ModalDialog::dispose();
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
index 6b50ef7b0397..50498b4d5d91 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx
@@ -61,6 +61,8 @@ class DictionaryList : public SvSimpleTable
{
public:
DictionaryList(SvSimpleTableContainer& rParent, WinBits nBits);
+ virtual ~DictionaryList();
+ virtual void dispose() SAL_OVERRIDE;
void init(const css::uno::Reference< css::linguistic2::XConversionDictionary>& xDictionary,
vcl::Window *pED_Term, vcl::Window *pED_Mapping, ListBox *pLB_Property,
@@ -99,9 +101,9 @@ public:
css::uno::Reference<css::linguistic2::XConversionDictionary> m_xDictionary;
private:
- vcl::Window* m_pED_Term;
- vcl::Window* m_pED_Mapping;
- ListBox* m_pLB_Property;
+ VclPtr<vcl::Window> m_pED_Term;
+ VclPtr<vcl::Window> m_pED_Mapping;
+ VclPtr<ListBox> m_pLB_Property;
std::vector< DictionaryEntry* > m_aToBeDeleted;
@@ -147,28 +149,28 @@ private:
private:
sal_Int32 m_nTextConversionOptions; //i18n::TextConversionOption
- RadioButton* m_pRB_To_Simplified;
- RadioButton* m_pRB_To_Traditional;
+ VclPtr<RadioButton> m_pRB_To_Simplified;
+ VclPtr<RadioButton> m_pRB_To_Traditional;
- CheckBox* m_pCB_Reverse;
+ VclPtr<CheckBox> m_pCB_Reverse;
- FixedText* m_pFT_Term;
- Edit* m_pED_Term;
+ VclPtr<FixedText> m_pFT_Term;
+ VclPtr<Edit> m_pED_Term;
- FixedText* m_pFT_Mapping;
- Edit* m_pED_Mapping;
+ VclPtr<FixedText> m_pFT_Mapping;
+ VclPtr<Edit> m_pED_Mapping;
- FixedText* m_pFT_Property;
- ListBox* m_pLB_Property;
+ VclPtr<FixedText> m_pFT_Property;
+ VclPtr<ListBox> m_pLB_Property;
- SvSimpleTableContainer* mpToSimplifiedContainer;
- DictionaryList* m_pCT_DictionaryToSimplified;
- SvSimpleTableContainer* mpToTraditionalContainer;
- DictionaryList* m_pCT_DictionaryToTraditional;
+ VclPtr<SvSimpleTableContainer> mpToSimplifiedContainer;
+ VclPtr<DictionaryList> m_pCT_DictionaryToSimplified;
+ VclPtr<SvSimpleTableContainer> mpToTraditionalContainer;
+ VclPtr<DictionaryList> m_pCT_DictionaryToTraditional;
- PushButton* m_pPB_Add;
- PushButton* m_pPB_Modify;
- PushButton* m_pPB_Delete;
+ VclPtr<PushButton> m_pPB_Add;
+ VclPtr<PushButton> m_pPB_Modify;
+ VclPtr<PushButton> m_pPB_Delete;
css::uno::Reference<css::uno::XComponentContext> m_xContext;
};
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
index 0de8dbbf73cf..7cdf4a98f9ef 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx
@@ -58,8 +58,7 @@ void ChineseTranslation_UnoDialog::impl_DeleteDialog()
{
if(m_pDialog->IsInExecute())
m_pDialog->EndDialog(RET_CANCEL);
- delete m_pDialog;
- m_pDialog = 0;
+ m_pDialog.clear();
}
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
index 5349c555c332..9c39681f77f8 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx
@@ -29,6 +29,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase5.hxx>
+#include <vcl/vclptr.hxx>
namespace textconversiondlgs
@@ -121,7 +122,7 @@ private:
com::sun::star::uno::Reference<
com::sun::star::awt::XWindow > m_xParentWindow;
- ChineseTranslationDialog* m_pDialog;
+ VclPtr<ChineseTranslationDialog> m_pDialog;
bool m_bDisposed; ///Dispose call ready.
bool m_bInDispose;///In dispose call
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
index 2253d3419749..feaaf3bbc392 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx
@@ -72,8 +72,13 @@ void ChineseTranslationDialog::dispose()
{
if(m_pDictionaryDialog->IsInExecute())
m_pDictionaryDialog->EndDialog();
- delete m_pDictionaryDialog;
}
+ m_pDictionaryDialog.clear();
+ m_pRB_To_Simplified.clear();
+ m_pRB_To_Traditional.clear();
+ m_pCB_Translate_Commonterms.clear();
+ m_pPB_Editterms.clear();
+ m_pBP_OK.clear();
ModalDialog::dispose();
}
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
index 6afeadf965c2..0ec0bf32f2be 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx
@@ -51,15 +51,15 @@ private:
void impl_UpdateVariantsCheckBox();
private:
- RadioButton* m_pRB_To_Simplified;
- RadioButton* m_pRB_To_Traditional;
+ VclPtr<RadioButton> m_pRB_To_Simplified;
+ VclPtr<RadioButton> m_pRB_To_Traditional;
- CheckBox* m_pCB_Translate_Commonterms;
- PushButton* m_pPB_Editterms;
+ VclPtr<CheckBox> m_pCB_Translate_Commonterms;
+ VclPtr<PushButton> m_pPB_Editterms;
- OKButton* m_pBP_OK;
+ VclPtr<OKButton> m_pBP_OK;
- ChineseDictionaryDialog* m_pDictionaryDialog;
+ VclPtr<ChineseDictionaryDialog> m_pDictionaryDialog;
};
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 74515045415c..3c9ce9282de6 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -67,7 +67,7 @@ class RecoveryUI : public ::cppu::WeakImplHelper2< css::lang::XServiceInfo
css::uno::Reference< css::uno::XComponentContext > m_xContext;
/** @short TODO */
- vcl::Window* m_pParentWindow;
+ VclPtr<vcl::Window> m_pParentWindow;
/** @short TODO */
RecoveryUI::EJob m_eJob;
diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx
index 377cf00d4eda..d4172b1efdc4 100644
--- a/svx/source/unodraw/unoshtxt.cxx
+++ b/svx/source/unodraw/unoshtxt.cxx
@@ -88,7 +88,7 @@ private:
SdrObject* mpObject;
SdrText* mpText;
SdrView* mpView;
- const vcl::Window* mpWindow;
+ VclPtr<const vcl::Window> mpWindow;
SdrModel* mpModel;
SdrOutliner* mpOutliner;
SvxOutlinerForwarder* mpTextForwarder;