summaryrefslogtreecommitdiff
path: root/sd/source/ui/animations
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-04-28 11:41:31 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-04-28 15:08:48 +0100
commite8b97a52c96df9c8e8055407b1e40ed7cb9cfc67 (patch)
treeb322529f4a54a6427862cb20cb4cf87fb6a5d065 /sd/source/ui/animations
parent2b0be6c0e9d23f1b8535ba7033732ae2e3bfb5c9 (diff)
parent0cde74f788a054fa2b65107a030dd463b8d11c7a (diff)
Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts. Conflicts: accessibility/source/extended/accessiblelistbox.cxx accessibility/source/standard/vclxaccessiblecombobox.cxx accessibility/source/standard/vclxaccessibledropdowncombobox.cxx accessibility/source/standard/vclxaccessibledropdownlistbox.cxx accessibility/source/standard/vclxaccessiblelistbox.cxx accessibility/source/standard/vclxaccessibletextfield.cxx basctl/source/basicide/basidesh.cxx cui/source/inc/chardlg.hxx cui/source/tabpages/tpbitmap.cxx dbaccess/source/ui/dlg/UserAdmin.cxx dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx extensions/source/propctrlr/propertyeditor.hxx extensions/source/scanner/sanedlg.cxx filter/source/pdf/impdialog.cxx include/sfx2/mgetempl.hxx include/sfx2/sidebar/SidebarToolBox.hxx include/sfx2/viewsh.hxx include/svtools/brwbox.hxx include/svtools/filectrl.hxx include/svtools/scrwin.hxx include/svx/dlgctrl.hxx include/svx/sidebar/Popup.hxx include/svx/sidebar/PopupContainer.hxx include/svx/sidebar/PopupControl.hxx include/svx/sidebar/SidebarDialControl.hxx include/svx/sidebar/ValueSetWithTextControl.hxx sc/source/ui/condformat/condformatdlgentry.cxx sc/source/ui/navipi/navipi.cxx sc/source/ui/sidebar/CellBorderStyleControl.hxx sd/source/ui/animations/CustomAnimationDialog.cxx sd/source/ui/inc/DrawViewShell.hxx sd/source/ui/inc/Ruler.hxx sd/source/ui/inc/SlideSorter.hxx sd/source/ui/inc/ViewTabBar.hxx sd/source/ui/inc/Window.hxx sd/source/ui/inc/morphdlg.hxx sd/source/ui/inc/sdpreslt.hxx sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx sd/source/ui/sidebar/LayoutMenu.hxx sd/source/ui/sidebar/MasterPagesSelector.hxx sd/source/ui/sidebar/NavigatorWrapper.hxx sd/source/ui/sidebar/PanelBase.hxx sd/source/ui/sidebar/RecentMasterPagesSelector.cxx sd/source/ui/sidebar/RecentMasterPagesSelector.hxx sd/source/ui/slideshow/showwindow.hxx sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx sd/source/ui/view/ViewShellBase.cxx sd/source/ui/view/drviewsa.cxx sfx2/source/appl/fileobj.hxx sfx2/source/appl/opengrf.cxx sfx2/source/control/thumbnailviewacc.hxx sfx2/source/dialog/securitypage.cxx sfx2/source/dialog/templdlg.cxx sfx2/source/doc/docinsert.cxx sfx2/source/doc/guisaveas.cxx sfx2/source/inc/alienwarn.hxx sfx2/source/sidebar/Deck.cxx sfx2/source/sidebar/Deck.hxx sfx2/source/sidebar/DeckTitleBar.cxx sfx2/source/sidebar/DeckTitleBar.hxx sfx2/source/sidebar/MenuButton.cxx sfx2/source/sidebar/MenuButton.hxx sfx2/source/sidebar/Panel.cxx sfx2/source/sidebar/Panel.hxx sfx2/source/sidebar/PanelTitleBar.hxx sfx2/source/sidebar/SidebarDockingWindow.hxx sfx2/source/sidebar/SidebarToolBox.cxx sfx2/source/sidebar/TabBar.hxx sfx2/source/sidebar/TabItem.cxx sfx2/source/sidebar/TabItem.hxx sfx2/source/sidebar/TitleBar.hxx sfx2/source/toolbox/imgmgr.cxx starmath/inc/edit.hxx starmath/inc/smmod.hxx starmath/qa/cppunit/test_starmath.cxx starmath/source/edit.cxx starmath/source/smmod.cxx svtools/source/brwbox/brwbox1.cxx svtools/source/brwbox/datwin.hxx svtools/source/contnr/fileview.cxx svtools/source/contnr/simptabl.cxx svtools/source/control/filectrl.cxx svtools/source/control/valueimp.hxx svx/inc/GalleryControl.hxx svx/source/dialog/dlgctrl.cxx svx/source/dialog/swframeexample.cxx svx/source/fmcomp/fmgridif.cxx svx/source/gallery2/GalleryControl.cxx svx/source/sidebar/EmptyPanel.hxx svx/source/sidebar/area/AreaPropertyPanel.hxx svx/source/sidebar/area/AreaTransparencyGradientControl.hxx svx/source/sidebar/graphic/GraphicPropertyPanel.hxx svx/source/sidebar/insert/InsertPropertyPanel.cxx svx/source/sidebar/insert/InsertPropertyPanel.hxx svx/source/sidebar/line/LinePropertyPanel.hxx svx/source/sidebar/line/LineWidthControl.cxx svx/source/sidebar/line/LineWidthControl.hxx svx/source/sidebar/line/LineWidthValueSet.hxx svx/source/sidebar/paragraph/ParaPropertyPanel.hxx svx/source/sidebar/possize/SidebarDialControl.cxx svx/source/sidebar/text/TextCharacterSpacingPopup.hxx svx/source/sidebar/text/TextPropertyPanel.hxx svx/source/sidebar/tools/PopupContainer.cxx svx/source/sidebar/tools/PopupControl.cxx svx/source/sidebar/tools/ValueSetWithTextControl.cxx svx/source/svdraw/svdfmtf.hxx svx/source/svdraw/svdibrow.cxx svx/source/tbxctrls/colrctrl.cxx svx/source/tbxctrls/tbcontrl.cxx sw/source/ui/dbui/mmaddressblockpage.cxx sw/source/ui/dialog/uiregionsw.cxx sw/source/ui/index/cnttab.cxx sw/source/uibase/inc/drpcps.hxx sw/source/uibase/sidebar/PageColumnControl.hxx sw/source/uibase/sidebar/PageMarginControl.hxx sw/source/uibase/sidebar/PageOrientationControl.hxx sw/source/uibase/sidebar/PagePropertyPanel.hxx sw/source/uibase/sidebar/PageSizeControl.hxx sw/source/uibase/uiview/view2.cxx sw/source/uibase/utlui/navipi.cxx vcl/inc/svdata.hxx vcl/source/control/combobox.cxx vcl/source/control/lstbox.cxx vcl/source/window/dockwin.cxx vcl/source/window/winproc.cxx Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
Diffstat (limited to 'sd/source/ui/animations')
-rw-r--r--sd/source/ui/animations/CustomAnimationCreateDialog.cxx50
-rw-r--r--sd/source/ui/animations/CustomAnimationCreateDialog.hxx7
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx270
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.hxx10
-rw-r--r--sd/source/ui/animations/CustomAnimationList.cxx8
-rw-r--r--sd/source/ui/animations/CustomAnimationList.hxx1
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx35
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.hxx35
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx29
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.hxx27
10 files changed, 314 insertions, 158 deletions
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
index 239f19586dd9..59bcdecaceb0 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx
@@ -165,6 +165,7 @@ class CustomAnimationCreateTabPage : public TabPage
public:
CustomAnimationCreateTabPage( vcl::Window* pParent, CustomAnimationCreateDialog* pDialogParent, sal_uInt16 nTabId, const PresetCategoryList& rCategoryList, bool bHasText, bool bIsMotionPath = false );
virtual ~CustomAnimationCreateTabPage();
+ virtual void dispose() SAL_OVERRIDE;
PathKind getCreatePathKind() const;
CustomAnimationPresetPtr getSelectedPreset() const;
@@ -187,12 +188,12 @@ private:
void clearEffects();
private:
- CategoryListBox* mpLBEffects;
- FixedText* mpFTSpeed;
- ListBox* mpCBSpeed;
- CheckBox* mpCBXPReview;
+ VclPtr<CategoryListBox> mpLBEffects;
+ VclPtr<FixedText> mpFTSpeed;
+ VclPtr<ListBox> mpCBSpeed;
+ VclPtr<CheckBox> mpCBXPReview;
- CustomAnimationCreateDialog* mpParent;
+ VclPtr<CustomAnimationCreateDialog> mpParent;
sal_uInt16 mnId;
@@ -296,7 +297,18 @@ CustomAnimationCreateTabPage::CustomAnimationCreateTabPage( vcl::Window* pParent
CustomAnimationCreateTabPage::~CustomAnimationCreateTabPage()
{
+ disposeOnce();
+}
+
+void CustomAnimationCreateTabPage::dispose()
+{
clearEffects();
+ mpLBEffects.clear();
+ mpFTSpeed.clear();
+ mpCBSpeed.clear();
+ mpCBXPReview.clear();
+ mpParent.clear();
+ TabPage::dispose();
}
IMPL_LINK( CustomAnimationCreateTabPage, implSelectHdl, Control*, pControl )
@@ -497,15 +509,15 @@ CustomAnimationCreateDialog::CustomAnimationCreateDialog( vcl::Window* pParent,
mnMiscId = mpTabControl->GetPageId("misc_effects");
const CustomAnimationPresets& rPresets = CustomAnimationPresets::getCustomAnimationPresets();
- mpTabPages[ENTRANCE] = new CustomAnimationCreateTabPage( mpTabControl, this, mnEntranceId, rPresets.getEntrancePresets(), bHasText );
+ mpTabPages[ENTRANCE] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnEntranceId, rPresets.getEntrancePresets(), bHasText );
mpTabControl->SetTabPage( mnEntranceId, mpTabPages[ENTRANCE] );
- mpTabPages[EMPHASIS] = new CustomAnimationCreateTabPage( mpTabControl, this, mnEmphasisId, rPresets.getEmphasisPresets(), bHasText );
+ mpTabPages[EMPHASIS] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnEmphasisId, rPresets.getEmphasisPresets(), bHasText );
mpTabControl->SetTabPage( mnEmphasisId, mpTabPages[EMPHASIS] );
- mpTabPages[EXIT] = new CustomAnimationCreateTabPage( mpTabControl, this, mnExitId, rPresets.getExitPresets(), bHasText );
+ mpTabPages[EXIT] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnExitId, rPresets.getExitPresets(), bHasText );
mpTabControl->SetTabPage( mnExitId, mpTabPages[EXIT] );
- mpTabPages[MOTIONPATH] = new CustomAnimationCreateTabPage( mpTabControl, this, mnMPathId, rPresets.getMotionPathsPresets(), bHasText, true );
+ mpTabPages[MOTIONPATH] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnMPathId, rPresets.getMotionPathsPresets(), bHasText, true );
mpTabControl->SetTabPage( mnMPathId, mpTabPages[MOTIONPATH] );
- mpTabPages[MISCEFFECTS] = new CustomAnimationCreateTabPage( mpTabControl, this, mnMiscId, rPresets.getMiscPresets(), bHasText );
+ mpTabPages[MISCEFFECTS] = VclPtr<CustomAnimationCreateTabPage>::Create( mpTabControl, this, mnMiscId, rPresets.getMiscPresets(), bHasText );
mpTabControl->SetTabPage( mnMiscId, mpTabPages[MISCEFFECTS] );
getCurrentPage()->setDuration( mfDuration );
@@ -532,17 +544,25 @@ CustomAnimationCreateDialog::CustomAnimationCreateDialog( vcl::Window* pParent,
CustomAnimationCreateDialog::~CustomAnimationCreateDialog()
{
+ disposeOnce();
+}
+
+void CustomAnimationCreateDialog::dispose()
+{
storePosition();
SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
pOptions->SetPreviewNewEffects( getCurrentPage()->getIsPreview() );
- delete mpTabPages[ENTRANCE];
- delete mpTabPages[EMPHASIS];
- delete mpTabPages[EXIT];
- delete mpTabPages[MOTIONPATH];
- delete mpTabPages[MISCEFFECTS];
+ mpTabPages[ENTRANCE].disposeAndClear();
+ mpTabPages[EMPHASIS].disposeAndClear();
+ mpTabPages[EXIT].disposeAndClear();
+ mpTabPages[MOTIONPATH].disposeAndClear();
+ mpTabPages[MISCEFFECTS].disposeAndClear();
+ mpTabControl.clear();
+ mpPane.clear();
+ TabDialog::dispose();
}
CustomAnimationCreateTabPage* CustomAnimationCreateDialog::getCurrentPage() const
diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.hxx b/sd/source/ui/animations/CustomAnimationCreateDialog.hxx
index b17be8894781..68a5c811bc87 100644
--- a/sd/source/ui/animations/CustomAnimationCreateDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationCreateDialog.hxx
@@ -41,6 +41,7 @@ class CustomAnimationCreateDialog : public TabDialog
public:
CustomAnimationCreateDialog( vcl::Window* pParent, CustomAnimationPane* pPane, const std::vector< ::com::sun::star::uno::Any >& rTargets, bool bHasText, const OUString& rsPresetId, double fDuration );
virtual ~CustomAnimationCreateDialog();
+ virtual void dispose() SAL_OVERRIDE;
PathKind getCreatePathKind() const;
CustomAnimationPresetPtr getSelectedPreset() const;
@@ -56,15 +57,15 @@ private:
DECL_LINK(implDeactivatePagekHdl, void *);
private:
- CustomAnimationPane* mpPane;
+ VclPtr<CustomAnimationPane> mpPane;
const std::vector< ::com::sun::star::uno::Any >& mrTargets;
double mfDuration;
bool mbIsPreview;
- TabControl* mpTabControl;
+ VclPtr<TabControl> mpTabControl;
- CustomAnimationCreateTabPage* mpTabPages[5];
+ VclPtr<CustomAnimationCreateTabPage> mpTabPages[5];
sal_uInt16 mnEntranceId, mnEmphasisId, mnExitId, mnMPathId, mnMiscId;
};
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 5a4577aeb74a..c2bd3292e100 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -107,13 +107,13 @@ public:
private:
std::map< sal_uInt16, OUString > maPropertyValues;
- ListBox* mpControl;
+ VclPtr<ListBox> mpControl;
};
PresetPropertyBox::PresetPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const OUString& aPresetId, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpControl = new ListBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+ mpControl = VclPtr<ListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
mpControl->SetDropDownLineCount( 10 );
mpControl->SetSelectHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_PRESETPROPERTYBOX );
@@ -159,7 +159,7 @@ void PresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId )
PresetPropertyBox::~PresetPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
Any PresetPropertyBox::getValue()
@@ -183,13 +183,13 @@ public:
virtual Control* getControl() SAL_OVERRIDE;
private:
- ColorListBox* mpControl;
+ VclPtr<ColorListBox> mpControl;
};
ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpControl = new ColorListBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+ mpControl = VclPtr<ColorListBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
mpControl->SetDropDownLineCount( 10 );
mpControl->SetSelectHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_COLORPROPERTYBOX );
@@ -219,7 +219,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent
ColorPropertyBox::~ColorPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void ColorPropertyBox::setValue( const Any& rValue, const OUString& )
@@ -256,13 +256,13 @@ public:
virtual Control* getControl() SAL_OVERRIDE;
private:
- FontNameBox* mpControl;
+ VclPtr<FontNameBox> mpControl;
};
FontPropertyBox::FontPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpControl = new FontNameBox( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
+ mpControl = VclPtr<FontNameBox>::Create( pParent, WB_BORDER|WB_TABSTOP|WB_DROPDOWN );
mpControl->SetDropDownLineCount( 10 );
mpControl->SetSelectHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_FONTPROPERTYBOX );
@@ -303,7 +303,7 @@ void FontPropertyBox::setValue( const Any& rValue, const OUString& )
FontPropertyBox::~FontPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
Any FontPropertyBox::getValue()
@@ -322,6 +322,7 @@ class DropdownMenuBox : public Edit
public:
DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, PopupMenu* pMenu );
virtual ~DropdownMenuBox();
+ virtual void dispose() SAL_OVERRIDE;
void Resize() SAL_OVERRIDE;
bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -329,16 +330,16 @@ public:
void SetMenuSelectHdl( const Link& rLink ) { mpDropdownButton->SetSelectHdl( rLink ); }
private:
- Edit* mpSubControl;
- MenuButton* mpDropdownButton;
- PopupMenu* mpMenu;
+ VclPtr<Edit> mpSubControl;
+ VclPtr<MenuButton> mpDropdownButton;
+ PopupMenu* mpMenu;
};
DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, PopupMenu* pMenu )
: Edit( pParent, WB_BORDER|WB_TABSTOP| WB_DIALOGCONTROL ),
mpSubControl(pSubControl),mpDropdownButton(0),mpMenu(pMenu)
{
- mpDropdownButton = new MenuButton( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
+ mpDropdownButton = VclPtr<MenuButton>::Create( this, WB_NOLIGHTBORDER | WB_RECTSTYLE | WB_NOTABSTOP);
mpDropdownButton->SetSymbol(SymbolType::SPIN_DOWN);
mpDropdownButton->Show();
mpDropdownButton->SetPopupMenu( pMenu );
@@ -350,10 +351,16 @@ DropdownMenuBox::DropdownMenuBox( vcl::Window* pParent, Edit* pSubControl, Popup
DropdownMenuBox::~DropdownMenuBox()
{
- SetSubEdit( 0 );
- delete mpSubControl;
- delete mpDropdownButton;
+ disposeOnce();
+}
+
+void DropdownMenuBox::dispose()
+{
+ SetSubEdit(nullptr);
+ mpDropdownButton.disposeAndClear();
delete mpMenu;
+ mpSubControl.disposeAndClear();
+ Edit::dispose();
}
void DropdownMenuBox::Resize()
@@ -405,21 +412,21 @@ public:
DECL_LINK( implMenuSelectHdl, MenuButton* );
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
};
CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Window* pParent, const Any& rValue, const Link& rModifyHdl )
: PropertySubControl( nControlType )
{
- mpMetric = new MetricField( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent, WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_PERCENT );
mpMetric->SetMin( 0 );
mpMetric->SetMax( 1000 );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSIZE_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, CharHeightPropertyBox, implMenuSelectHdl ));
mpControl->SetModifyHdl( rModifyHdl );
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_CHARHEIGHTPROPERTYBOX );
@@ -430,7 +437,7 @@ CharHeightPropertyBox::CharHeightPropertyBox( sal_Int32 nControlType, vcl::Windo
CharHeightPropertyBox::~CharHeightPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
IMPL_LINK( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
@@ -450,7 +457,7 @@ IMPL_LINK( CharHeightPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void CharHeightPropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
double fValue = 0.0;
rValue >>= fValue;
@@ -485,9 +492,9 @@ public:
void updateMenu();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
Link maModifyHdl;
};
@@ -495,7 +502,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpMetric = new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_PERCENT );
mpMetric->SetMin( 0 );
mpMetric->SetMax( 100 );
@@ -508,7 +515,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
mpMenu->InsertItem( i, aStr );
}
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, TransparencyPropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_TRANSPARENCYPROPERTYBOX );
@@ -521,7 +528,7 @@ TransparencyPropertyBox::TransparencyPropertyBox( sal_Int32 nControlType, vcl::W
TransparencyPropertyBox::~TransparencyPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void TransparencyPropertyBox::updateMenu()
@@ -534,7 +541,7 @@ void TransparencyPropertyBox::updateMenu()
IMPL_LINK_NOARG(TransparencyPropertyBox, implModifyHdl)
{
updateMenu();
- maModifyHdl.Call(mpMetric);
+ maModifyHdl.Call(mpMetric.get());
return 0;
}
@@ -552,7 +559,7 @@ IMPL_LINK( TransparencyPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void TransparencyPropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
double fValue = 0.0;
rValue >>= fValue;
@@ -589,9 +596,9 @@ public:
void updateMenu();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
Link maModifyHdl;
};
@@ -599,14 +606,14 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpMetric = new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_CUSTOM );
mpMetric->SetCustomUnitText( OUString( sal_Unicode(0xb0)) ); // degree sign
mpMetric->SetMin( -10000 );
mpMetric->SetMax( 10000 );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_ROTATION_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, RotationPropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_ROTATIONPROPERTYBOX );
@@ -619,7 +626,7 @@ RotationPropertyBox::RotationPropertyBox( sal_Int32 nControlType, vcl::Window* p
RotationPropertyBox::~RotationPropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void RotationPropertyBox::updateMenu()
@@ -640,7 +647,7 @@ void RotationPropertyBox::updateMenu()
IMPL_LINK_NOARG(RotationPropertyBox, implModifyHdl)
{
updateMenu();
- maModifyHdl.Call(mpMetric);
+ maModifyHdl.Call(mpMetric.get());
return 0;
}
@@ -677,7 +684,7 @@ IMPL_LINK( RotationPropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void RotationPropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
double fValue = 0.0;
rValue >>= fValue;
@@ -714,9 +721,9 @@ public:
void updateMenu();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- MetricField* mpMetric;
+ VclPtr<MetricField> mpMetric;
Link maModifyHdl;
int mnDirection;
};
@@ -725,13 +732,13 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpMetric = new MetricField( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER);
+ mpMetric.set( VclPtr<MetricField>::Create( pParent ,WB_TABSTOP|WB_IGNORETAB| WB_NOBORDER) );
mpMetric->SetUnit( FUNIT_PERCENT );
mpMetric->SetMin( 0 );
mpMetric->SetMax( 10000 );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_SCALE_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpMetric, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpMetric, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, ScalePropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_SCALEPROPERTYBOX );
@@ -744,7 +751,7 @@ ScalePropertyBox::ScalePropertyBox( sal_Int32 nControlType, vcl::Window* pParent
ScalePropertyBox::~ScalePropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void ScalePropertyBox::updateMenu()
@@ -764,7 +771,7 @@ void ScalePropertyBox::updateMenu()
IMPL_LINK_NOARG(ScalePropertyBox, implModifyHdl)
{
updateMenu();
- maModifyHdl.Call(mpMetric);
+ maModifyHdl.Call(mpMetric.get());
return 0;
}
@@ -810,7 +817,7 @@ IMPL_LINK( ScalePropertyBox, implMenuSelectHdl, MenuButton*, pPb )
void ScalePropertyBox::setValue( const Any& rValue, const OUString& )
{
- if( mpMetric )
+ if( mpMetric.get() )
{
ValuePair aValues;
rValue >>= aValues;
@@ -876,9 +883,9 @@ public:
void update();
private:
- DropdownMenuBox* mpControl;
+ VclPtr<DropdownMenuBox> mpControl;
PopupMenu* mpMenu;
- Edit* mpEdit;
+ VclPtr<Edit> mpEdit;
Link maModifyHdl;
float mfFontWeight;
@@ -890,11 +897,11 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window*
: PropertySubControl( nControlType )
, maModifyHdl( rModifyHdl )
{
- mpEdit = new Edit( pParent, WB_TABSTOP|WB_IGNORETAB|WB_NOBORDER|WB_READONLY);
+ mpEdit.set( VclPtr<Edit>::Create( pParent, WB_TABSTOP|WB_IGNORETAB|WB_NOBORDER|WB_READONLY) );
mpEdit->SetText( SD_RESSTR(STR_CUSTOMANIMATION_SAMPLE) );
mpMenu = new PopupMenu(SdResId( RID_CUSTOMANIMATION_FONTSTYLE_POPUP ) );
- mpControl = new DropdownMenuBox( pParent, mpEdit, mpMenu );
+ mpControl = VclPtr<DropdownMenuBox>::Create( pParent, mpEdit, mpMenu );
mpControl->SetMenuSelectHdl( LINK( this, FontStylePropertyBox, implMenuSelectHdl ));
mpControl->SetHelpId( HID_SD_CUSTOMANIMATIONPANE_FONTSTYLEPROPERTYBOX );
@@ -904,7 +911,7 @@ FontStylePropertyBox::FontStylePropertyBox( sal_Int32 nControlType, vcl::Window*
FontStylePropertyBox::~FontStylePropertyBox()
{
- delete mpControl;
+ mpControl.disposeAndClear();
}
void FontStylePropertyBox::update()
@@ -950,7 +957,7 @@ IMPL_LINK( FontStylePropertyBox, implMenuSelectHdl, MenuButton*, pPb )
}
update();
- maModifyHdl.Call(mpEdit);
+ maModifyHdl.Call(mpEdit.get());
return 0;
}
@@ -986,6 +993,7 @@ class CustomAnimationEffectTabPage : public TabPage
public:
CustomAnimationEffectTabPage( vcl::Window* pParent, const STLPropertySet* pSet );
virtual ~CustomAnimationEffectTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void update( STLPropertySet* pSet );
DECL_LINK( implSelectHdl, Control* );
@@ -1003,24 +1011,24 @@ private:
bool mbHasText;
const STLPropertySet* mpSet;
- VclFrame* mpSettings;
- FixedText* mpFTProperty1;
- PropertyControl* mpLBProperty1;
- VclHBox* mpPlaceholderBox;
- CheckBox* mpCBSmoothStart;
- CheckBox* mpCBSmoothEnd;
-
- FixedText* mpFTSound;
- ListBox* mpLBSound;
- PushButton* mpPBSoundPreview;
- FixedText* mpFTAfterEffect;
- ListBox* mpLBAfterEffect;
- FixedText* mpFTDimColor;
- ColorListBox* mpCLBDimColor;
- FixedText* mpFTTextAnim;
- ListBox* mpLBTextAnim;
- MetricField* mpMFTextDelay;
- FixedText* mpFTTextDelay;
+ VclPtr<VclFrame> mpSettings;
+ VclPtr<FixedText> mpFTProperty1;
+ VclPtr<PropertyControl> mpLBProperty1;
+ VclPtr<VclHBox> mpPlaceholderBox;
+ VclPtr<CheckBox> mpCBSmoothStart;
+ VclPtr<CheckBox> mpCBSmoothEnd;
+
+ VclPtr<FixedText> mpFTSound;
+ VclPtr<ListBox> mpLBSound;
+ VclPtr<PushButton> mpPBSoundPreview;
+ VclPtr<FixedText> mpFTAfterEffect;
+ VclPtr<ListBox> mpLBAfterEffect;
+ VclPtr<FixedText> mpFTDimColor;
+ VclPtr<ColorListBox> mpCLBDimColor;
+ VclPtr<FixedText> mpFTTextAnim;
+ VclPtr<ListBox> mpLBTextAnim;
+ VclPtr<MetricField> mpMFTextDelay;
+ VclPtr<FixedText> mpFTTextDelay;
::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > mxPlayer;
};
@@ -1255,7 +1263,30 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( vcl::Window* pParent
CustomAnimationEffectTabPage::~CustomAnimationEffectTabPage()
{
+ disposeOnce();
+}
+
+void CustomAnimationEffectTabPage::dispose()
+{
clearSoundListBox();
+ mpSettings.clear();
+ mpFTProperty1.clear();
+ mpLBProperty1.clear();
+ mpPlaceholderBox.clear();
+ mpCBSmoothStart.clear();
+ mpCBSmoothEnd.clear();
+ mpFTSound.clear();
+ mpLBSound.clear();
+ mpPBSoundPreview.clear();
+ mpFTAfterEffect.clear();
+ mpLBAfterEffect.clear();
+ mpFTDimColor.clear();
+ mpCLBDimColor.clear();
+ mpFTTextAnim.clear();
+ mpLBTextAnim.clear();
+ mpMFTextDelay.clear();
+ mpFTTextDelay.clear();
+ TabPage::dispose();
}
void CustomAnimationEffectTabPage::updateControlStates()
@@ -1517,9 +1548,9 @@ void CustomAnimationEffectTabPage::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (true);
- bQuitLoop = aWarningBox.Execute() != RET_RETRY;
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
+ aWarningBox->SetModalInputMode (true);
+ bQuitLoop = aWarningBox->Execute() != RET_RETRY;
bValidSoundFile=false;
}
@@ -1558,6 +1589,7 @@ class CustomAnimationDurationTabPage : public TabPage
public:
CustomAnimationDurationTabPage( vcl::Window* pParent, const STLPropertySet* pSet );
virtual ~CustomAnimationDurationTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void update( STLPropertySet* pSet );
@@ -1566,18 +1598,18 @@ public:
private:
const STLPropertySet* mpSet;
- FixedText* mpFTStart;
- ListBox* mpLBStart;
- FixedText* mpFTStartDelay;
- MetricField* mpMFStartDelay;
- FixedText* mpFTDuration;
- ListBox* mpCBDuration;
- FixedText* mpFTRepeat;
- ListBox* mpCBRepeat;
- CheckBox* mpCBXRewind;
- RadioButton* mpRBClickSequence;
- RadioButton* mpRBInteractive;
- ListBox* mpLBTrigger;
+ VclPtr<FixedText> mpFTStart;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<FixedText> mpFTStartDelay;
+ VclPtr<MetricField> mpMFStartDelay;
+ VclPtr<FixedText> mpFTDuration;
+ VclPtr<ListBox> mpCBDuration;
+ VclPtr<FixedText> mpFTRepeat;
+ VclPtr<ListBox> mpCBRepeat;
+ VclPtr<CheckBox> mpCBXRewind;
+ VclPtr<RadioButton> mpRBClickSequence;
+ VclPtr<RadioButton> mpRBInteractive;
+ VclPtr<ListBox> mpLBTrigger;
};
CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pParent, const STLPropertySet* pSet)
@@ -1755,6 +1787,24 @@ CustomAnimationDurationTabPage::CustomAnimationDurationTabPage(vcl::Window* pPar
CustomAnimationDurationTabPage::~CustomAnimationDurationTabPage()
{
+ disposeOnce();
+}
+
+void CustomAnimationDurationTabPage::dispose()
+{
+ mpFTStart.clear();
+ mpLBStart.clear();
+ mpFTStartDelay.clear();
+ mpMFStartDelay.clear();
+ mpFTDuration.clear();
+ mpCBDuration.clear();
+ mpFTRepeat.clear();
+ mpCBRepeat.clear();
+ mpCBXRewind.clear();
+ mpRBClickSequence.clear();
+ mpRBInteractive.clear();
+ mpLBTrigger.clear();
+ TabPage::dispose();
}
IMPL_LINK( CustomAnimationDurationTabPage, implControlHdl, Control*, pControl )
@@ -1924,6 +1974,8 @@ class CustomAnimationTextAnimTabPage : public TabPage
{
public:
CustomAnimationTextAnimTabPage( vcl::Window* pParent, const STLPropertySet* pSet );
+ virtual ~CustomAnimationTextAnimTabPage();
+ virtual void dispose() SAL_OVERRIDE;
void update( STLPropertySet* pSet );
@@ -1931,12 +1983,12 @@ public:
DECL_LINK(implSelectHdl, void *);
private:
- FixedText* maFTGroupText;
- ListBox* maLBGroupText;
- CheckBox* maCBXGroupAuto;
- MetricField* maMFGroupAuto;
- CheckBox* maCBXAnimateForm;
- CheckBox* maCBXReverse;
+ VclPtr<FixedText> maFTGroupText;
+ VclPtr<ListBox> maLBGroupText;
+ VclPtr<CheckBox> maCBXGroupAuto;
+ VclPtr<MetricField> maMFGroupAuto;
+ VclPtr<CheckBox> maCBXAnimateForm;
+ VclPtr<CheckBox> maCBXReverse;
const STLPropertySet* mpSet;
@@ -2023,6 +2075,22 @@ CustomAnimationTextAnimTabPage::CustomAnimationTextAnimTabPage(vcl::Window* pPar
updateControlStates();
}
+CustomAnimationTextAnimTabPage::~CustomAnimationTextAnimTabPage()
+{
+ disposeOnce();
+}
+
+void CustomAnimationTextAnimTabPage::dispose()
+{
+ maFTGroupText.clear();
+ maLBGroupText.clear();
+ maCBXGroupAuto.clear();
+ maMFGroupAuto.clear();
+ maCBXAnimateForm.clear();
+ maCBXReverse.clear();
+ TabPage::dispose();
+}
+
void CustomAnimationTextAnimTabPage::update( STLPropertySet* pSet )
{
sal_Int32 nPos = maLBGroupText->GetSelectEntryPos();
@@ -2113,9 +2181,9 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
sal_uInt16 mnTimingId = mpTabControl->GetPageId("timing");
sal_uInt16 mnTextAnimId = mpTabControl->GetPageId("textanim");
- mpEffectTabPage = new CustomAnimationEffectTabPage( mpTabControl, mpSet );
+ mpEffectTabPage = VclPtr<CustomAnimationEffectTabPage>::Create( mpTabControl, mpSet );
mpTabControl->SetTabPage( mnEffectId, mpEffectTabPage );
- mpDurationTabPage = new CustomAnimationDurationTabPage( mpTabControl, mpSet );
+ mpDurationTabPage = VclPtr<CustomAnimationDurationTabPage>::Create( mpTabControl, mpSet );
mpTabControl->SetTabPage( mnTimingId, mpDurationTabPage );
bool bHasText = false;
@@ -2124,7 +2192,7 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
if( bHasText )
{
- mpTextAnimTabPage = new CustomAnimationTextAnimTabPage( mpTabControl, mpSet );
+ mpTextAnimTabPage = VclPtr<CustomAnimationTextAnimTabPage>::Create( mpTabControl, mpSet );
mpTabControl->SetTabPage( mnTextAnimId, mpTextAnimTabPage );
}
else
@@ -2139,12 +2207,20 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
CustomAnimationDialog::~CustomAnimationDialog()
{
- delete mpEffectTabPage;
- delete mpDurationTabPage;
- delete mpTextAnimTabPage;
+ disposeOnce();
+}
+
+void CustomAnimationDialog::dispose()
+{
+ mpEffectTabPage.disposeAndClear();
+ mpDurationTabPage.disposeAndClear();
+ mpTextAnimTabPage.disposeAndClear();
delete mpSet;
delete mpResultSet;
+
+ mpTabControl.clear();
+ TabDialog::dispose();
}
STLPropertySet* CustomAnimationDialog::getResultSet()
@@ -2222,8 +2298,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makePropertyControl( vcl::
PropertyControl::~PropertyControl()
{
+ disposeOnce();
+}
+
+void PropertyControl::dispose()
+{
if( mpSubControl )
delete mpSubControl;
+ ListBox::dispose();
}
void PropertyControl::setSubControl( PropertySubControl* pSubControl )
diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx b/sd/source/ui/animations/CustomAnimationDialog.hxx
index 2fcdc742073a..3754d93ffdbf 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.hxx
@@ -123,6 +123,7 @@ class PropertyControl : public ListBox
public:
PropertyControl( vcl::Window* pParent );
virtual ~PropertyControl();
+ virtual void dispose() SAL_OVERRIDE;
void setSubControl( PropertySubControl* pSubControl );
PropertySubControl* getSubControl() const { return mpSubControl; }
@@ -143,6 +144,7 @@ class CustomAnimationDialog : public TabDialog
public:
CustomAnimationDialog(vcl::Window* pParent, STLPropertySet* pSet, const OString& Page = OString());
virtual ~CustomAnimationDialog();
+ virtual void dispose() SAL_OVERRIDE;
STLPropertySet* getDefaultSet() { return mpSet; }
STLPropertySet* getResultSet();
@@ -154,11 +156,11 @@ private:
STLPropertySet* mpResultSet;
CustomAnimationEffectPtr mpEffect;
- TabControl* mpTabControl;
+ VclPtr<TabControl> mpTabControl;
- CustomAnimationDurationTabPage* mpDurationTabPage;
- CustomAnimationEffectTabPage* mpEffectTabPage;
- CustomAnimationTextAnimTabPage* mpTextAnimTabPage;
+ VclPtr<CustomAnimationDurationTabPage> mpDurationTabPage;
+ VclPtr<CustomAnimationEffectTabPage> mpEffectTabPage;
+ VclPtr<CustomAnimationTextAnimTabPage> mpTextAnimTabPage;
};
}
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index c7f62dad3a59..dd4441aeebfb 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -210,7 +210,7 @@ public:
virtual void Paint(
const Point&, SvTreeListBox& rDev, const SvViewDataEntry* pView,const SvTreeListEntry* pEntry) SAL_OVERRIDE;
private:
- CustomAnimationList* mpParent;
+ VclPtr<CustomAnimationList> mpParent;
OUString maDescription;
CustomAnimationEffectPtr mpEffect;
};
@@ -444,10 +444,16 @@ const Image& CustomAnimationList::getImage( sal_uInt16 nId )
CustomAnimationList::~CustomAnimationList()
{
+ disposeOnce();
+}
+
+void CustomAnimationList::dispose()
+{
if( mpMainSequence.get() )
mpMainSequence->removeListener( this );
clear();
+ SvTreeListBox::dispose();
}
void CustomAnimationList::KeyInput( const KeyEvent& rKEvt )
diff --git a/sd/source/ui/animations/CustomAnimationList.hxx b/sd/source/ui/animations/CustomAnimationList.hxx
index 66301bb6f830..18fde3c2db14 100644
--- a/sd/source/ui/animations/CustomAnimationList.hxx
+++ b/sd/source/ui/animations/CustomAnimationList.hxx
@@ -48,6 +48,7 @@ class CustomAnimationList : public SvTreeListBox, public ISequenceListener
public:
CustomAnimationList( vcl::Window* pParent );
virtual ~CustomAnimationList();
+ virtual void dispose() SAL_OVERRIDE;
// methods
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 6e36b0b64d84..431c75b661f5 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -225,6 +225,11 @@ CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase,
CustomAnimationPane::~CustomAnimationPane()
{
+ disposeOnce();
+}
+
+void CustomAnimationPane::dispose()
+{
maLateInitTimer.Stop();
removeListener();
@@ -235,6 +240,24 @@ CustomAnimationPane::~CustomAnimationPane()
for( aIter = aTags.begin(); aIter != aTags.end(); ++aIter )
(*aIter)->Dispose();
+ mpPBAddEffect.clear();
+ mpPBChangeEffect.clear();
+ mpPBRemoveEffect.clear();
+ mpFTEffect.clear();
+ mpFTStart.clear();
+ mpLBStart.clear();
+ mpFTProperty.clear();
+ mpPlaceholderBox.clear();
+ mpLBProperty.clear();
+ mpPBPropertyMore.clear();
+ mpFTSpeed.clear();
+ mpCBSpeed.clear();
+ mpCustomAnimationList.clear();
+ mpPBMoveUp.clear();
+ mpPBMoveDown.clear();
+ mpPBPlay.clear();
+ mpCBAutoPreview.clear();
+ PanelLayout::dispose();
}
void CustomAnimationPane::addUndo()
@@ -809,11 +832,11 @@ void CustomAnimationPane::UpdateLook()
::sfx2::sidebar::Theme::GetWallpaper(
::sfx2::sidebar::Theme::Paint_PanelBackground));
SetBackground(aBackground);
- if (mpFTStart != NULL)
+ if (mpFTStart != nullptr)
mpFTStart->SetBackground(aBackground);
- if (mpFTProperty != NULL)
+ if (mpFTProperty != nullptr)
mpFTProperty->SetBackground(aBackground);
- if (mpFTSpeed != NULL)
+ if (mpFTSpeed != nullptr)
mpFTSpeed->SetBackground(aBackground);
}
@@ -1550,7 +1573,7 @@ void CustomAnimationPane::showOptions(const OString& sPage)
{
STLPropertySet* pSet = createSelectionSet();
- boost::scoped_ptr<CustomAnimationDialog> pDlg(new CustomAnimationDialog(this, pSet, sPage));
+ VclPtrInstance< CustomAnimationDialog > pDlg(this, pSet, sPage);
if( pDlg->Execute() )
{
addUndo();
@@ -1729,7 +1752,7 @@ void CustomAnimationPane::onChange( bool bCreate )
}
}
- boost::scoped_ptr<CustomAnimationCreateDialog> pDlg(new CustomAnimationCreateDialog( this, this, aTargets, bHasText, sPresetId, fDuration ));
+ VclPtrInstance< CustomAnimationCreateDialog > pDlg( this, this, aTargets, bHasText, sPresetId, fDuration );
if( pDlg->Execute() )
{
addUndo();
@@ -2263,7 +2286,7 @@ void CustomAnimationPane::updatePathFromMotionPathTag( const rtl::Reference< Mot
if( pDocSh )
{
const Size aMinSize( pParent->LogicToPixel( Size( 80, 256 ), MAP_APPFONT ) );
- pWindow = new CustomAnimationPane( pParent, rBase, rxFrame, aMinSize );
+ pWindow = VclPtr<CustomAnimationPane>::Create( pParent, rBase, rxFrame, aMinSize );
}
return pWindow;
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index 57d10c613611..0fd6f19a6595 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -64,6 +64,7 @@ class CustomAnimationPane : public PanelLayout, public ICustomAnimationListContr
public:
CustomAnimationPane( vcl::Window* pParent, ViewShellBase& rBase, const css::uno::Reference<css::frame::XFrame>& rxFrame, const Size& rMinSize );
virtual ~CustomAnimationPane();
+ virtual void dispose() SAL_OVERRIDE;
// callbacks
void onSelectionChanged();
@@ -125,23 +126,23 @@ private:
const CustomAnimationPresets* mpCustomAnimationPresets;
- PushButton* mpPBAddEffect;
- PushButton* mpPBChangeEffect;
- PushButton* mpPBRemoveEffect;
- FixedText* mpFTEffect;
- FixedText* mpFTStart;
- ListBox* mpLBStart;
- FixedText* mpFTProperty;
- VclHBox* mpPlaceholderBox;
- PropertyControl* mpLBProperty;
- PushButton* mpPBPropertyMore;
- FixedText* mpFTSpeed;
- ListBox* mpCBSpeed;
- CustomAnimationList* mpCustomAnimationList;
- PushButton* mpPBMoveUp;
- PushButton* mpPBMoveDown;
- PushButton* mpPBPlay;
- CheckBox* mpCBAutoPreview;
+ VclPtr<PushButton> mpPBAddEffect;
+ VclPtr<PushButton> mpPBChangeEffect;
+ VclPtr<PushButton> mpPBRemoveEffect;
+ VclPtr<FixedText> mpFTEffect;
+ VclPtr<FixedText> mpFTStart;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<FixedText> mpFTProperty;
+ VclPtr<VclHBox> mpPlaceholderBox;
+ VclPtr<PropertyControl> mpLBProperty;
+ VclPtr<PushButton> mpPBPropertyMore;
+ VclPtr<FixedText> mpFTSpeed;
+ VclPtr<ListBox> mpCBSpeed;
+ VclPtr<CustomAnimationList> mpCustomAnimationList;
+ VclPtr<PushButton> mpPBMoveUp;
+ VclPtr<PushButton> mpPBMoveDown;
+ VclPtr<PushButton> mpPBPlay;
+ VclPtr<CheckBox> mpCBAutoPreview;
OUString maStrModify;
OUString maStrProperty;
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index 56bf1437dcb3..917a53e03b77 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -386,7 +386,7 @@ struct lcl_AppendSoundToListBox : public ::std::unary_function< OUString, void >
}
private:
- ListBox* mrListBox;
+ VclPtr<ListBox> mrListBox;
};
void lcl_FillSoundListBox(
@@ -483,8 +483,27 @@ SlideTransitionPane::SlideTransitionPane(
SlideTransitionPane::~SlideTransitionPane()
{
+ disposeOnce();
+}
+
+void SlideTransitionPane::dispose()
+{
maLateInitTimer.Stop();
removeListener();
+ mpLB_SLIDE_TRANSITIONS.clear();
+ mpFT_SPEED.clear();
+ mpLB_SPEED.clear();
+ mpFT_SOUND.clear();
+ mpLB_SOUND.clear();
+ mpCB_LOOP_SOUND.clear();
+ mpRB_ADVANCE_ON_MOUSE.clear();
+ mpRB_ADVANCE_AUTO.clear();
+ mpMF_ADVANCE_AUTO_AFTER.clear();
+ mpPB_APPLY_TO_ALL.clear();
+ mpPB_PLAY.clear();
+ mpPB_SLIDE_SHOW.clear();
+ mpCB_AUTO_PREVIEW.clear();
+ PanelLayout::dispose();
}
void SlideTransitionPane::DataChanged (const DataChangedEvent& rEvent)
@@ -724,9 +743,9 @@ void SlideTransitionPane::openSoundFileDialog()
{
OUString aStrWarning(SD_RESSTR(STR_WARNING_NOSOUNDFILE));
aStrWarning = aStrWarning.replaceFirst("%", aFile);
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
- aWarningBox.SetModalInputMode (true);
- bQuitLoop = (aWarningBox.Execute() != RET_RETRY);
+ ScopedVclPtrInstance< WarningBox > aWarningBox( nullptr, WB_3DLOOK | WB_RETRY_CANCEL, aStrWarning );
+ aWarningBox->SetModalInputMode (true);
+ bQuitLoop = (aWarningBox->Execute() != RET_RETRY);
bValidSoundFile = false;
}
@@ -1082,7 +1101,7 @@ IMPL_LINK_NOARG(SlideTransitionPane, LateInitCallback)
if( pDocSh )
{
Size aMinSize( pParent->LogicToPixel( Size( 72, 216 ), MAP_APPFONT ) );
- pWindow = new SlideTransitionPane( pParent, rBase, aMinSize, pDocSh->GetDoc(), rxFrame );
+ pWindow = VclPtr<SlideTransitionPane>::Create( pParent, rBase, aMinSize, pDocSh->GetDoc(), rxFrame );
}
return pWindow;
diff --git a/sd/source/ui/animations/SlideTransitionPane.hxx b/sd/source/ui/animations/SlideTransitionPane.hxx
index 3bb556d74112..63e76e3d1242 100644
--- a/sd/source/ui/animations/SlideTransitionPane.hxx
+++ b/sd/source/ui/animations/SlideTransitionPane.hxx
@@ -58,6 +58,7 @@ public:
SdDrawDocument* pDoc,
const css::uno::Reference<css::frame::XFrame>& rxFrame );
virtual ~SlideTransitionPane();
+ virtual void dispose() SAL_OVERRIDE;
// Window
virtual void DataChanged (const DataChangedEvent& rEvent) SAL_OVERRIDE;
@@ -104,19 +105,19 @@ private:
SdDrawDocument * mpDrawDoc;
Size maMinSize;
- ListBox* mpLB_SLIDE_TRANSITIONS;
- FixedText* mpFT_SPEED;
- ListBox* mpLB_SPEED;
- FixedText* mpFT_SOUND;
- ListBox* mpLB_SOUND;
- CheckBox* mpCB_LOOP_SOUND;
- RadioButton* mpRB_ADVANCE_ON_MOUSE;
- RadioButton* mpRB_ADVANCE_AUTO;
- MetricField* mpMF_ADVANCE_AUTO_AFTER;
- PushButton* mpPB_APPLY_TO_ALL;
- PushButton* mpPB_PLAY;
- PushButton* mpPB_SLIDE_SHOW;
- CheckBox* mpCB_AUTO_PREVIEW;
+ VclPtr<ListBox> mpLB_SLIDE_TRANSITIONS;
+ VclPtr<FixedText> mpFT_SPEED;
+ VclPtr<ListBox> mpLB_SPEED;
+ VclPtr<FixedText> mpFT_SOUND;
+ VclPtr<ListBox> mpLB_SOUND;
+ VclPtr<CheckBox> mpCB_LOOP_SOUND;
+ VclPtr<RadioButton> mpRB_ADVANCE_ON_MOUSE;
+ VclPtr<RadioButton> mpRB_ADVANCE_AUTO;
+ VclPtr<MetricField> mpMF_ADVANCE_AUTO_AFTER;
+ VclPtr<PushButton> mpPB_APPLY_TO_ALL;
+ VclPtr<PushButton> mpPB_PLAY;
+ VclPtr<PushButton> mpPB_SLIDE_SHOW;
+ VclPtr<CheckBox> mpCB_AUTO_PREVIEW;
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawView > mxView;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxModel;