summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2020-04-29 12:45:13 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2020-05-17 18:52:01 +0900
commit9371f86ecb60f6f1f120e3d93fe892bbb70d04c0 (patch)
tree3bf829d594785687c136b1d8295197f58b2038ef /usr
parent59721d4eb7f66f27440ad74f875b97e64133ee3b (diff)
bpfilter: match bit size of bpfilter_umh to that of the kernel
bpfilter_umh is built for the default machine bit of the compiler, which may not match to the bit size of the kernel. This happens in the scenario below: You can use biarch GCC that defaults to 64-bit for building the 32-bit kernel. In this case, Kbuild passes -m32 to teach the compiler to produce 32-bit kernel space objects. However, it is missing when building bpfilter_umh. It is built as a 64-bit ELF, and then embedded into the 32-bit kernel. The 32-bit kernel and 64-bit umh is a bad combination. In theory, we can have 32-bit umh running on 64-bit kernel, but we do not have a good reason to support such a usecase. The best is to match the bit size between them. Pass -m32 or -m64 to the umh build command if it is found in $(KBUILD_CFLAGS). Evaluate CC_CAN_LINK against the kernel bit-size. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'usr')
-rw-r--r--usr/include/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 5a7ee3e5ed86..55362f3ab393 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -8,6 +8,10 @@
# We cannot go as far as adding -Wpedantic since it emits too many warnings.
UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration
+# In theory, we do not care -m32 or -m64 for header compile tests.
+# It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64.
+UAPI_CFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
+
override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include
# The following are excluded for now because they fail to build.
>feature/OperationSmiley main, development code repositoryroot
summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/GalleryControl.hxx9
-rw-r--r--svx/inc/extrusiondepthdialog.hxx4
-rw-r--r--svx/inc/galbrws2.hxx16
-rw-r--r--svx/inc/sdr/overlay/overlaymanagerbuffered.hxx4
-rw-r--r--svx/inc/svdibrow.hxx13
-rw-r--r--svx/inc/tbunosearchcontrollers.hxx5
-rw-r--r--svx/source/accessibility/AccessibleShapeTreeInfo.cxx1
-rw-r--r--svx/source/accessibility/GraphCtlAccessibleContext.cxx6
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx30
-rw-r--r--svx/source/customshapes/tbxcustomshapes.cxx2
-rw-r--r--svx/source/dialog/_bmpmask.cxx66
-rw-r--r--svx/source/dialog/_contdlg.cxx72
-rw-r--r--svx/source/dialog/charmap.cxx55
-rw-r--r--svx/source/dialog/checklbx.cxx6
-rw-r--r--svx/source/dialog/compressgraphicdialog.cxx31
-rw-r--r--svx/source/dialog/connctrl.cxx6
-rw-r--r--svx/source/dialog/contimp.hxx9
-rw-r--r--svx/source/dialog/contwnd.cxx4
-rw-r--r--svx/source/dialog/contwnd.hxx1
-rw-r--r--svx/source/dialog/ctredlin.cxx76
-rw-r--r--svx/source/dialog/dialcontrol.cxx10
-rw-r--r--svx/source/dialog/dlgctl3d.cxx134
-rw-r--r--svx/source/dialog/dlgctrl.cxx88
-rw-r--r--svx/source/dialog/docrecovery.cxx73
-rw-r--r--svx/source/dialog/fntctrl.cxx12
-rw-r--r--svx/source/dialog/fontwork.cxx22
-rw-r--r--svx/source/dialog/frmdirlbox.cxx4
-rw-r--r--svx/source/dialog/frmsel.cxx39
-rw-r--r--svx/source/dialog/graphctl.cxx6
-rw-r--r--svx/source/dialog/hdft.cxx30
-rw-r--r--svx/source/dialog/imapdlg.cxx30
-rw-r--r--svx/source/dialog/imapwnd.cxx6
-rw-r--r--svx/source/dialog/imapwnd.hxx1
-rw-r--r--svx/source/dialog/langbox.cxx10
-rw-r--r--svx/source/dialog/linkwarn.cxx7
-rw-r--r--svx/source/dialog/measctrl.cxx6
-rw-r--r--svx/source/dialog/optgrid.cxx31
-rw-r--r--svx/source/dialog/orienthelper.cxx2
-rw-r--r--svx/source/dialog/pagectrl.cxx6
-rw-r--r--svx/source/dialog/passwd.cxx14
-rw-r--r--svx/source/dialog/prtqry.cxx5
-rw-r--r--svx/source/dialog/rubydialog.cxx41
-rw-r--r--svx/source/dialog/srchdlg.cxx52
-rw-r--r--svx/source/dialog/stddlg.cxx4
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.cxx16
-rw-r--r--svx/source/dialog/svxruler.cxx32
-rw-r--r--svx/source/dialog/swframeexample.cxx4
-rw-r--r--svx/source/dialog/txencbox.cxx6
-rw-r--r--svx/source/engine3d/float3d.cxx21
-rw-r--r--svx/source/fmcomp/fmgridcl.cxx11
-rw-r--r--svx/source/fmcomp/fmgridif.cxx61
-rw-r--r--svx/source/fmcomp/gridcell.cxx381
-rw-r--r--svx/source/fmcomp/gridctrl.cxx339
-rw-r--r--svx/source/form/databaselocationinput.cxx4
-rw-r--r--svx/source/form/datanavi.cxx370
-rw-r--r--svx/source/form/filtnav.cxx20
-rw-r--r--svx/source/form/fmPropBrw.cxx13
-rw-r--r--svx/source/form/fmexpl.cxx14
-rw-r--r--svx/source/form/fmobj.cxx4
-rw-r--r--svx/source/form/fmshell.cxx7
-rw-r--r--svx/source/form/fmtextcontrolshell.cxx8
-rw-r--r--svx/source/form/navigatortree.cxx6
-rw-r--r--svx/source/form/tabwin.cxx22
-rw-r--r--svx/source/form/tbxform.cxx27
-rw-r--r--svx/source/form/xfm_addcondition.cxx6
-rw-r--r--svx/source/gallery2/GalleryControl.cxx31
-rw-r--r--svx/source/gallery2/galbrws1.cxx34
-rw-r--r--svx/source/gallery2/galbrws1.hxx7
-rw-r--r--svx/source/gallery2/galbrws2.cxx140
-rw-r--r--svx/source/gallery2/galctrl.cxx8
-rw-r--r--svx/source/gallery2/galobj.cxx4
-rw-r--r--svx/source/gallery2/galtheme.cxx6
-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.hxx143
-rw-r--r--svx/source/inc/docrecovery.hxx46
-rw-r--r--svx/source/inc/filtnav.hxx4
-rw-r--r--svx/source/inc/fmPropBrw.hxx1
-rw-r--r--svx/source/inc/fmexch.hxx7
-rw-r--r--svx/source/inc/fmexpl.hxx4
-rw-r--r--svx/source/inc/fmobj.hxx2
-rw-r--r--svx/source/inc/fmvwimp.hxx3
-rw-r--r--svx/source/inc/frmselimpl.hxx2
-rw-r--r--svx/source/inc/gridcell.hxx22
-rw-r--r--svx/source/inc/svxrectctaccessiblecontext.hxx3
-rw-r--r--svx/source/inc/tabwin.hxx6
-rw-r--r--svx/source/inc/tbxform.hxx13
-rw-r--r--svx/source/inc/xfm_addcondition.hxx2
-rw-r--r--svx/source/mnuctrls/clipboardctl.cxx2
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx6
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx94
-rw-r--r--svx/source/sidebar/EmptyPanel.cxx17
-rw-r--r--svx/source/sidebar/EmptyPanel.hxx3
-rw-r--r--svx/source/sidebar/PanelFactory.cxx12
-rw-r--r--svx/source/sidebar/PanelLayout.cxx7
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.cxx41
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hxx37
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientControl.cxx274
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientControl.hxx29
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.cxx35
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.hxx34
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.cxx15
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.hxx5
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx39
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hxx46
-rw-r--r--svx/source/sidebar/line/LineWidthControl.cxx153
-rw-r--r--svx/source/sidebar/line/LineWidthControl.hxx11
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.cxx11
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.hxx3
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx25
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx19
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx4
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx45
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx38
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx50
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx48
-rw-r--r--svx/source/sidebar/possize/SidebarDialControl.cxx4
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx235
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.hxx13
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingPopup.cxx2
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingPopup.hxx2
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx36
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hxx33
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.cxx178
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.hxx6
-rw-r--r--svx/source/sidebar/tools/Popup.cxx8
-rw-r--r--svx/source/sidebar/tools/PopupContainer.cxx7
-rw-r--r--svx/source/sidebar/tools/PopupControl.cxx10
-rw-r--r--svx/source/sidebar/tools/ValueSetWithTextControl.cxx6
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx38
-rw-r--r--svx/source/svdraw/svdedxv.cxx30
-rw-r--r--svx/source/svdraw/svdfmtf.cxx54
-rw-r--r--svx/source/svdraw/svdfmtf.hxx36
-rw-r--r--svx/source/svdraw/svdibrow.cxx51
-rw-r--r--svx/source/svdraw/svdmrkv.cxx2
-rw-r--r--svx/source/svdraw/svdmrkv1.cxx2
-rw-r--r--svx/source/svdraw/svdograf.cxx10
-rw-r--r--svx/source/svdraw/svdotext.cxx8
-rw-r--r--svx/source/svdraw/svdpntv.cxx26
-rw-r--r--svx/source/svdraw/svdtrans.cxx16
-rw-r--r--svx/source/svdraw/svdview.cxx18
-rw-r--r--svx/source/svdraw/svdxcgv.cxx22
-rw-r--r--svx/source/tbxctrls/SvxColorChildWindow.cxx3
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx23
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx15
-rw-r--r--svx/source/tbxctrls/colrctrl.cxx71
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.cxx49
-rw-r--r--svx/source/tbxctrls/extrusioncontrols.hxx16
-rw-r--r--svx/source/tbxctrls/fillctrl.cxx22
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx48
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx73
-rw-r--r--svx/source/tbxctrls/itemwin.cxx24
-rw-r--r--svx/source/tbxctrls/layctrl.cxx44
-rw-r--r--svx/source/tbxctrls/lboxctrl.cxx35
-rw-r--r--svx/source/tbxctrls/linectrl.cxx85
-rw-r--r--svx/source/tbxctrls/subtoolboxcontrol.cxx2
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx223
-rw-r--r--svx/source/tbxctrls/tbunocontroller.cxx8
-rw-r--r--svx/source/tbxctrls/tbunosearchcontrollers.cxx16
-rw-r--r--svx/source/tbxctrls/tbxalign.cxx2
-rw-r--r--svx/source/toolbars/extrusionbar.cxx6
-rw-r--r--svx/source/toolbars/fontworkbar.cxx10
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx41
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx41
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.cxx5
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translation_unodialog.hxx3
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.cxx15
-rw-r--r--svx/source/unodialogs/textconversiondlgs/chinese_translationdialog.hxx13
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx52
-rw-r--r--svx/source/unodraw/recoveryui.cxx6
-rw-r--r--svx/source/unodraw/unoshape.cxx6
-rw-r--r--svx/source/unodraw/unoshtxt.cxx2
-rw-r--r--svx/source/xoutdev/_xoutbmp.cxx38
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx24
-rw-r--r--svx/source/xoutdev/xtabdash.cxx16
-rw-r--r--svx/source/xoutdev/xtabgrdt.cxx10
-rw-r--r--svx/source/xoutdev/xtabhtch.cxx16
-rw-r--r--svx/source/xoutdev/xtablend.cxx16
-rw-r--r--svx/workben/msview/msview.cxx2
-rw-r--r--svx/workben/pixelctl.cxx23
182 files changed, 3534 insertions, 2445 deletions
diff --git a/svx/inc/GalleryControl.hxx b/svx/inc/GalleryControl.hxx
index f85af689ce4a..a807b05dbea8 100644
--- a/svx/inc/GalleryControl.hxx
+++ b/svx/inc/GalleryControl.hxx
@@ -43,15 +43,14 @@ public:
GalleryControl (
SfxBindings* pBindings,
vcl::Window* pParentWindow);
- virtual ~GalleryControl();
bool GalleryKeyInput( const KeyEvent& rKEvt, vcl::Window* pWindow);
private:
Gallery* mpGallery;
- ::boost::scoped_ptr<GallerySplitter> mpSplitter;
- ::boost::scoped_ptr<GalleryBrowser1> mpBrowser1;
- ::boost::scoped_ptr<GalleryBrowser2> mpBrowser2;
+ VclPtr<GallerySplitter> mpSplitter;
+ VclPtr<GalleryBrowser1> mpBrowser1;
+ VclPtr<GalleryBrowser2> mpBrowser2;
Size maLastSize;
bool mbIsInitialResize;
@@ -64,6 +63,8 @@ private:
protected:
void ThemeSelectionHasChanged();
+ virtual ~GalleryControl();
+ virtual void dispose() SAL_OVERRIDE;
};
} } // end of namespace svx::sidebar
diff --git a/svx/inc/extrusiondepthdialog.hxx b/svx/inc/extrusiondepthdialog.hxx
index 46362d7ff4c5..48b932e44e18 100644
--- a/svx/inc/extrusiondepthdialog.hxx
+++ b/svx/inc/extrusiondepthdialog.hxx
@@ -31,10 +31,12 @@ namespace svx {
class ExtrusionDepthDialog : public ModalDialog
{
- MetricField* m_pMtrDepth;
+ VclPtr<MetricField> m_pMtrDepth;
public:
ExtrusionDepthDialog( vcl::Window* pParent, double fDepth, FieldUnit eDefaultUnit );
+ virtual ~ExtrusionDepthDialog();
+ virtual void dispose() SAL_OVERRIDE;
double getDepth() const;
};
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx
index f65943b0316d..ec53f5236498 100644
--- a/svx/inc/galbrws2.hxx
+++ b/svx/inc/galbrws2.hxx
@@ -80,7 +80,6 @@ private:
public:
GalleryToolBox( GalleryBrowser2* pParent );
- virtual ~GalleryToolBox();
};
@@ -110,14 +109,14 @@ private:
SvtMiscOptions maMiscOptions;
Gallery* mpGallery;
GalleryTheme* mpCurTheme;
- GalleryIconView* mpIconView;
- GalleryListView* mpListView;
- GalleryPreview* mpPreview;
- GalleryToolBox maViewBox;
- FixedLine maSeparator;
- FixedText maInfoBar;
+ VclPtr<GalleryIconView> mpIconView;
+ VclPtr<GalleryListView> mpListView;
+ VclPtr<GalleryPreview> mpPreview;
+ VclPtr<GalleryToolBox> maViewBox;
+ VclPtr<FixedLine> maSeparator;
+ VclPtr<FixedText> maInfoBar;
Point maDragStartPos;
- sal_uIntPtr mnCurActionPos;
+ sal_uIntPtr mnCurActionPos;
GalleryBrowserMode meMode;
GalleryBrowserMode meLastMode;
@@ -154,6 +153,7 @@ public:
GalleryBrowser2(vcl::Window* pParent, Gallery* pGallery);
virtual ~GalleryBrowser2();
+ virtual void dispose() SAL_OVERRIDE;
void SelectTheme( const OUString& rThemeName );
diff --git a/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx b/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx
index 4063d521fd27..05db3120343f 100644
--- a/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx
+++ b/svx/inc/sdr/overlay/overlaymanagerbuffered.hxx
@@ -36,11 +36,11 @@ namespace sdr
protected:
// The VirtualDevice for draw window content buffering, this
// is the view content without overlay
- VirtualDevice maBufferDevice;
+ ScopedVclPtr<VirtualDevice> mpBufferDevice;
// #i73602# The VirtualDevice for OverlayPaint buffering. This
// is an extra device to avoid flickering of overlay paints
- VirtualDevice maOutputBufferDevice;
+ ScopedVclPtr<VirtualDevice> mpOutputBufferDevice;
// Idle for buffering
Idle maBufferIdle;
diff --git a/svx/inc/svdibrow.hxx b/svx/inc/svdibrow.hxx
index 2e44db53db50..7ce191073b55 100644
--- a/svx/inc/svdibrow.hxx
+++ b/svx/inc/svdibrow.hxx
@@ -34,7 +34,7 @@ class _SdrItemBrowserControl: public BrowseBox
friend class ImpItemEdit;
std::vector<ImpItemListRow*> aList;
long nAktPaintRow;
- Edit* pEditControl;
+ VclPtr<Edit> pEditControl;
OUString aWNamMerk;
Link aEntryChangedHdl;
Link aSetDirtyHdl;
@@ -69,6 +69,7 @@ protected:
public:
_SdrItemBrowserControl(vcl::Window* pParent, WinBits nBits=WB_3DLOOK|WB_BORDER|WB_TABSTOP);
virtual ~_SdrItemBrowserControl();
+ virtual void dispose() SAL_OVERRIDE;
void Clear();
void SetAttributes(const SfxItemSet* pAttr, const SfxItemSet* p2ndSet=NULL);
sal_uIntPtr GetCurrentPos() const;
@@ -99,16 +100,16 @@ public:
#define WB_STDSIZEABLEFLOATWIN (WB_STDFLOATWIN|WB_3DLOOK|WB_CLOSEABLE|WB_SIZEMOVE)
class _SdrItemBrowserWindow: public FloatingWindow {
- _SdrItemBrowserControl aBrowse;
+ VclPtr<_SdrItemBrowserControl> aBrowse;
public:
_SdrItemBrowserWindow(vcl::Window* pParent, WinBits nBits=WB_STDSIZEABLEDOCKWIN);
virtual ~_SdrItemBrowserWindow();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
- void Clear() { aBrowse.Clear(); }
- void SetAttributes(const SfxItemSet* pAttr, const SfxItemSet* p2ndSet=NULL) { aBrowse.SetAttributes(pAttr,p2ndSet); }
- const _SdrItemBrowserControl& GetBrowserControl() const { return aBrowse; }
- _SdrItemBrowserControl& GetBrowserControl() { return aBrowse; }
+ void Clear() { aBrowse->Clear(); }
+ void SetAttributes(const SfxItemSet* pAttr, const SfxItemSet* p2ndSet=NULL) { aBrowse->SetAttributes(pAttr,p2ndSet); }
+ _SdrItemBrowserControl *GetBrowserControl() { return aBrowse.get(); }
};
class SdrView;
diff --git a/svx/inc/tbunosearchcontrollers.hxx b/svx/inc/tbunosearchcontrollers.hxx
index a7657eedeeaf..8aa95e1e99f0 100644
--- a/svx/inc/tbunosearchcontrollers.hxx
+++ b/svx/inc/tbunosearchcontrollers.hxx
@@ -47,7 +47,6 @@ public:
FindTextFieldControl( vcl::Window* pParent, WinBits nStyle,
css::uno::Reference< css::frame::XFrame >& xFrame,
const css::uno::Reference< css::uno::XComponentContext >& xContext );
- virtual ~FindTextFieldControl();
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
@@ -119,7 +118,7 @@ public:
private:
- FindTextFieldControl* m_pFindTextFieldControl;
+ VclPtr<FindTextFieldControl> m_pFindTextFieldControl;
sal_uInt16 m_nDownSearchId; // item position of findbar
sal_uInt16 m_nUpSearchId; // item position of findbar
@@ -221,7 +220,7 @@ public:
virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
private:
- CheckBox* m_pMatchCaseControl;
+ VclPtr<CheckBox> m_pMatchCaseControl;
};
class FindAllToolboxController : public svt::ToolboxController,
diff --git a/svx/source/accessibility/AccessibleShapeTreeInfo.cxx b/svx/source/accessibility/AccessibleShapeTreeInfo.cxx
index 5b8d23ad447e..416dfa63a273 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 a00131c50183..85164cb10923 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() throw( Runtime
{
::SolarMutexGuard aGuard;
- if( NULL == mpControl )
+ if( nullptr == mpControl )
throw DisposedException();
return Rectangle(
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 7332449b75b2..7e033863237f 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -165,9 +165,9 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape,
aFont.SetOrientation( 0 );
// initializing virtual device
- VirtualDevice aVirDev( 1 );
- aVirDev.SetMapMode( MAP_100TH_MM );
- aVirDev.SetFont( aFont );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
+ pVirDev->SetMapMode( MAP_100TH_MM );
+ pVirDev->SetFont( aFont );
if ( nOutlinesCount2d & 1 )
bSingleLineMode = true;
@@ -187,7 +187,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape,
std::vector< FWParagraphData >::const_iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() );
while( aParagraphIter != aParagraphIEnd )
{
- double fTextWidth = aVirDev.GetTextWidth( aParagraphIter->aString );
+ double fTextWidth = pVirDev->GetTextWidth( aParagraphIter->aString );
if ( fTextWidth > 0.0 )
{
double fScale = fWidth / fTextWidth;
@@ -259,12 +259,12 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
aFont.SetWeight( rWeightItem.GetWeight() );
// initializing virtual device
- VirtualDevice aVirDev( 1 );
- aVirDev.SetMapMode( MAP_100TH_MM );
- aVirDev.SetFont( aFont );
- aVirDev.EnableRTL( true );
+ ScopedVclPtrInstance< VirtualDevice > pVirDev( 1 );
+ pVirDev->SetMapMode( MAP_100TH_MM );
+ pVirDev->SetFont( aFont );
+ pVirDev->EnableRTL( true );
if ( aParagraphIter->nFrameDirection == FRMDIR_HORI_RIGHT_TOP )
- aVirDev.SetLayoutMode( TEXT_LAYOUT_BIDI_RTL );
+ pVirDev->SetLayoutMode( TEXT_LAYOUT_BIDI_RTL );
const SvxCharScaleWidthItem& rCharScaleWidthItem = static_cast<const SvxCharScaleWidthItem&>(pCustomShape->GetMergedItem( EE_CHAR_FONTWIDTH ));
sal_uInt16 nCharScaleWidth = rCharScaleWidthItem.GetValue();
@@ -282,9 +282,9 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
{
FWCharacterData aCharacterData;
OUString aCharText( (sal_Unicode)rText[ i ] );
- if ( aVirDev.GetTextOutlines( aCharacterData.vOutlines, aCharText, 0, 0, -1, true, nWidth, pDXArry ) )
+ if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, aCharText, 0, 0, -1, true, nWidth, pDXArry ) )
{
- sal_Int32 nTextWidth = aVirDev.GetTextWidth( aCharText);
+ sal_Int32 nTextWidth = pVirDev->GetTextWidth( aCharText);
std::vector< tools::PolyPolygon >::iterator aOutlineIter = aCharacterData.vOutlines.begin();
std::vector< tools::PolyPolygon >::iterator aOutlineIEnd = aCharacterData.vOutlines.end();
if ( aOutlineIter == aOutlineIEnd )
@@ -334,13 +334,13 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
if ( ( nCharScaleWidth != 100 ) && nCharScaleWidth )
{ // applying character spacing
pDXArry = new long[ rText.getLength() ];
- aVirDev.GetTextArray( rText, pDXArry);
- FontMetric aFontMetric( aVirDev.GetFontMetric() );
+ pVirDev->GetTextArray( rText, pDXArry);
+ FontMetric aFontMetric( pVirDev->GetFontMetric() );
aFont.SetWidth( (sal_Int32)( (double)aFontMetric.GetWidth() * ( (double)100 / (double)nCharScaleWidth ) ) );
- aVirDev.SetFont( aFont );
+ pVirDev->SetFont( aFont );
}
FWCharacterData aCharacterData;
- if ( aVirDev.GetTextOutlines( aCharacterData.vOutlines, rText, 0, 0, -1, true, nWidth, pDXArry ) )
+ if ( pVirDev->GetTextOutlines( aCharacterData.vOutlines, rText, 0, 0, -1, true, nWidth, pDXArry ) )
{
aParagraphIter->vCharacters.push_back( aCharacterData );
}
diff --git a/svx/source/customshapes/tbxcustomshapes.cxx b/svx/source/customshapes/tbxcustomshapes.cxx
index b287aac60a5a..f80af1e9a548 100644
--- a/svx/source/customshapes/tbxcustomshapes.cxx
+++ b/svx/source/customshapes/tbxcustomshapes.cxx
@@ -103,7 +103,7 @@ SfxPopupWindowType SvxTbxCtlCustomShapes::GetPopupWindowType() const
// Here is the window created
// The location of the Toolbox is queried through GetToolBox()
// rItemRect are the screen coordinates
-SfxPopupWindow* SvxTbxCtlCustomShapes::CreatePopupWindow()
+VclPtr<SfxPopupWindow> SvxTbxCtlCustomShapes::CreatePopupWindow()
{
createAndPositionSubToolBar( m_aSubTbxResName );
return NULL;
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index bda7ae2b1c01..8588f9862428 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -84,13 +84,13 @@ public:
class MaskSet : public ValueSet
{
- SvxBmpMask* pSvxBmpMask;
-
+ VclPtr<SvxBmpMask> pSvxBmpMask;
public:
MaskSet(SvxBmpMask* pMask, vcl::Window* pParent);
-
- virtual void Select() SAL_OVERRIDE;
+ virtual ~MaskSet() { disposeOnce(); }
+ 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;
virtual Size GetOptimalSize() const SAL_OVERRIDE
@@ -160,7 +160,7 @@ void MaskSet::onEditColor()
class MaskData
{
- SvxBmpMask* pMask;
+ VclPtr<SvxBmpMask> pMask;
bool bIsReady;
bool bExecState;
SfxBindings& rBindings;
@@ -361,7 +361,7 @@ SvxBmpMaskChildWindow::SvxBmpMaskChildWindow(vcl::Window* pParent_, sal_uInt16 n
SfxChildWinInfo* pInfo)
: SfxChildWindow(pParent_, nId)
{
- SvxBmpMask* pDlg = new SvxBmpMask(pBindings, this, pParent_);
+ VclPtr<SvxBmpMask> pDlg = VclPtr<SvxBmpMask>::Create(pBindings, this, pParent_);
pWindow = pDlg;
@@ -381,35 +381,35 @@ SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window*
m_pTbxPipette->SetItemBits(m_pTbxPipette->GetItemId(0),
ToolBoxItemBits::AUTOCHECK);
get(m_pBtnExec, "replace");
- m_pCtlPipette = new ColorWindow(get<Window>("toolgrid"));
+ m_pCtlPipette = VclPtr<ColorWindow>::Create(get<Window>("toolgrid"));
m_pCtlPipette->Show();
m_pCtlPipette->set_grid_left_attach(1);
m_pCtlPipette->set_grid_top_attach(0);
m_pCtlPipette->set_hexpand(true);
get(m_pCbx1, "cbx1");
Window *pGrid = get<Window>("colorgrid");
- m_pQSet1 = new MaskSet(this, pGrid);
+ m_pQSet1 = VclPtr<MaskSet>::Create(this, pGrid);
m_pQSet1->set_grid_left_attach(1);
m_pQSet1->set_grid_top_attach(1);
m_pQSet1->Show();
get(m_pSp1, "tol1");
get(m_pLbColor1, "color1");
get(m_pCbx2, "cbx2");
- m_pQSet2 = new MaskSet(this, pGrid);
+ m_pQSet2 = VclPtr<MaskSet>::Create(this, pGrid);
m_pQSet2->set_grid_left_attach(1);
m_pQSet2->set_grid_top_attach(2);
m_pQSet2->Show();
get(m_pSp2, "tol2");
get(m_pLbColor2, "color2");
get(m_pCbx3, "cbx3");
- m_pQSet3 = new MaskSet(this, pGrid);
+ m_pQSet3 = VclPtr<MaskSet>::Create(this, pGrid);
m_pQSet3->set_grid_left_attach(1);
m_pQSet3->set_grid_top_attach(3);
m_pQSet3->Show();
get(m_pSp3, "tol3");
get(m_pLbColor3, "color3");
get(m_pCbx4, "cbx4");
- m_pQSet4 = new MaskSet(this, pGrid);
+ m_pQSet4 = VclPtr<MaskSet>::Create(this, pGrid);
m_pQSet4->set_grid_left_attach(1);
m_pQSet4->set_grid_top_attach(4);
m_pQSet4->Show();
@@ -483,12 +483,34 @@ SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window*
SvxBmpMask::~SvxBmpMask()
{
- delete m_pQSet1;
- delete m_pQSet2;
- delete m_pQSet3;
- delete m_pQSet4;
- delete m_pCtlPipette;
+ disposeOnce();
+}
+
+void SvxBmpMask::dispose()
+{
+ m_pQSet1.disposeAndClear();
+ m_pQSet2.disposeAndClear();
+ m_pQSet3.disposeAndClear();
+ m_pQSet4.disposeAndClear();
+ m_pCtlPipette.disposeAndClear();
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();
}
/** is called by a MaskSet when it is selected */
@@ -982,22 +1004,22 @@ Animation SvxBmpMask::ImpReplaceTransparency( const Animation& rAnim, const Colo
GDIMetaFile SvxBmpMask::ImpReplaceTransparency( const GDIMetaFile& rMtf, const Color& rColor )
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
GDIMetaFile aMtf;
const MapMode& rPrefMap = rMtf.GetPrefMapMode();
const Size& rPrefSize = rMtf.GetPrefSize();
const size_t nActionCount = rMtf.GetActionSize();
- aVDev.EnableOutput( false );
- aMtf.Record( &aVDev );
+ pVDev->EnableOutput( false );
+ aMtf.Record( pVDev );
aMtf.SetPrefSize( rPrefSize );
aMtf.SetPrefMapMode( rPrefMap );
- aVDev.SetLineColor( rColor );
- aVDev.SetFillColor( rColor );
+ pVDev->SetLineColor( rColor );
+ pVDev->SetFillColor( rColor );
// retrieve one action at the time; first
// set the whole area to the replacement color.
- aVDev.DrawRect( Rectangle( rPrefMap.GetOrigin(), rPrefSize ) );
+ pVDev->DrawRect( Rectangle( rPrefMap.GetOrigin(), rPrefSize ) );
for ( size_t i = 0; i < nActionCount; i++ )
{
MetaAction* pAct = rMtf.GetAction( i );
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index a189d195496c..1d4799c7cc07 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -67,7 +67,7 @@ SvxContourDlgChildWindow::SvxContourDlgChildWindow( vcl::Window* _pParent, sal_u
SfxBindings* pBindings, SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
{
- SvxSuperContourDlg* pDlg = new SvxSuperContourDlg(pBindings, this, _pParent);
+ VclPtr<SvxSuperContourDlg> pDlg = VclPtr<SvxSuperContourDlg>::Create(pBindings, this, _pParent);
pWindow = pDlg;
if ( pInfo->nFlags & SfxChildWindowFlags::ZOOMIN )
@@ -88,6 +88,18 @@ SvxContourDlg::SvxContourDlg(SfxBindings* _pBindings, SfxChildWindow* pCW,
SvxContourDlg::~SvxContourDlg()
{
+ disposeOnce();
+}
+
+void SvxContourDlg::dispose()
+{
+ pSuperClass.clear();
+ SfxFloatingWindow::dispose();
+}
+
+void SvxContourDlg::SetSuperClass( SvxSuperContourDlg& rSuperClass )
+{
+ pSuperClass = &rSuperClass;
}
tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
@@ -101,16 +113,16 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
{
if( rGraphic.IsAnimated() )
{
- VirtualDevice aVDev;
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
MapMode aTransMap;
const Animation aAnim( rGraphic.GetAnimation() );
const Size& rSizePix = aAnim.GetDisplaySizePixel();
const sal_uInt16 nCount = aAnim.Count();
- if ( aVDev.SetOutputSizePixel( rSizePix ) )
+ if ( pVDev->SetOutputSizePixel( rSizePix ) )
{
- aVDev.SetLineColor( Color( COL_BLACK ) );
- aVDev.SetFillColor( Color( COL_BLACK ) );
+ pVDev->SetLineColor( Color( COL_BLACK ) );
+ pVDev->SetFillColor( Color( COL_BLACK ) );
for( sal_uInt16 i = 0; i < nCount; i++ )
{
@@ -119,13 +131,13 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
// Push Polygon output to the right place; this is the
// offset of the sub-image within the total animation
aTransMap.SetOrigin( Point( rStepBmp.aPosPix.X(), rStepBmp.aPosPix.Y() ) );
- aVDev.SetMapMode( aTransMap );
- aVDev.DrawPolyPolygon( CreateAutoContour( rStepBmp.aBmpEx, pRect, nFlags ) );
+ pVDev->SetMapMode( aTransMap );
+ pVDev->DrawPolyPolygon( CreateAutoContour( rStepBmp.aBmpEx, pRect, nFlags ) );
}
aTransMap.SetOrigin( Point() );
- aVDev.SetMapMode( aTransMap );
- aBmp = aVDev.GetBitmap( Point(), rSizePix );
+ pVDev->SetMapMode( aTransMap );
+ aBmp = pVDev->GetBitmap( Point(), rSizePix );
aBmp.Convert( BMP_CONVERSION_1BIT_THRESHOLD );
}
}
@@ -140,8 +152,8 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
else if( rGraphic.GetType() != GRAPHIC_NONE )
{
const Graphic aTmpGrf( rGraphic.GetGDIMetaFile().GetMonochromeMtf( Color( COL_BLACK ) ) );
- VirtualDevice aVDev;
- Size aSizePix( aVDev.LogicToPixel( aTmpGrf.GetPrefSize(), aTmpGrf.GetPrefMapMode() ) );
+ ScopedVclPtrInstance< VirtualDevice > pVDev;
+ Size aSizePix( pVDev->LogicToPixel( aTmpGrf.GetPrefSize(), aTmpGrf.GetPrefMapMode() ) );
if( aSizePix.Width() && aSizePix.Height() && ( aSizePix.Width() > 512 || aSizePix.Height() > 512 ) )
{
@@ -153,11 +165,11 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const Graphic& rGraphic,
aSizePix.Height() = FRound( ( aSizePix.Width() = 512 ) / fWH );
}
- if( aVDev.SetOutputSizePixel( aSizePix ) )
+ if( pVDev->SetOutputSizePixel( aSizePix ) )
{
const Point aPt;
- aTmpGrf.Draw( &aVDev, aPt, aSizePix );
- aBmp = aVDev.GetBitmap( aPt, aSizePix );
+ aTmpGrf.Draw( pVDev, aPt, aSizePix );
+ aBmp = pVDev->GetBitmap( aPt, aSizePix );
}
nContourFlags |= XOUTBMP_CONTOUR_EDGEDETECT;
@@ -211,7 +223,7 @@ SvxSuperContourDlg::SvxSuperContourDlg(SfxBindings *_pBindings, SfxChildWindow *
{
get(m_pTbx1, "toolbar");
get(m_pMtfTolerance, "spinbutton");
- m_pContourWnd = new ContourWindow(get<vcl::Window>("container"), WB_BORDER);
+ m_pContourWnd = VclPtr<ContourWindow>::Create(get<vcl::Window>("container"), WB_BORDER);
m_pContourWnd->set_hexpand(true);
m_pContourWnd->set_vexpand(true);
m_pContourWnd->Show();
@@ -282,9 +294,18 @@ SvxSuperContourDlg::SvxSuperContourDlg(SfxBindings *_pBindings, SfxChildWindow *
SvxSuperContourDlg::~SvxSuperContourDlg()
{
+ disposeOnce();
+}
+
+void SvxSuperContourDlg::dispose()
+{
SvtMiscOptions aMiscOptions;
aMiscOptions.RemoveListenerLink( LINK(this, SvxSuperContourDlg, MiscHdl) );
- delete m_pContourWnd;
+ m_pContourWnd.disposeAndClear();
+ m_pTbx1.clear();
+ m_pMtfTolerance.clear();
+ m_pStbStatus.clear();
+ SvxContourDlg::dispose();
}
bool SvxSuperContourDlg::Close()
@@ -293,8 +314,8 @@ bool SvxSuperContourDlg::Close()
if (m_pTbx1->IsItemEnabled(mnApplyId))
{
- MessageDialog aQBox( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui");
- const long nRet = aQBox.Execute();
+ ScopedVclPtrInstance< MessageDialog > aQBox( this,"QuerySaveContourChangesDialog","svx/ui/querysavecontchangesdialog.ui");
+ const long nRet = aQBox->Execute();
if ( nRet == RET_YES )
{
@@ -425,9 +446,9 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx )
{
if (m_pTbx1->IsItemChecked(mnWorkSpaceId))
{
- MessageDialog aQBox( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQBox( this,"QueryDeleteContourDialog","svx/ui/querydeletecontourdialog.ui" );
- if ( !m_pContourWnd->IsContourChanged() || ( aQBox.Execute() == RET_YES ) )
+ if ( !m_pContourWnd->IsContourChanged() || ( aQBox->Execute() == RET_YES ) )
m_pContourWnd->SetWorkplaceMode( true );
else
m_pTbx1->CheckItem(mnWorkSpaceId, false);
@@ -499,10 +520,9 @@ IMPL_LINK( SvxSuperContourDlg, Tbx1ClickHdl, ToolBox*, pTbx )
m_pStbStatus->Invalidate();
else if ( bGraphicLinked )
{
- MessageDialog aQBox(this, "QueryUnlinkGraphicsDialog",
- "svx/ui/queryunlinkgraphicsdialog.ui");
-
- if (aQBox.Execute() != RET_YES)
+ ScopedVclPtrInstance<MessageDialog> aQBox(this, "QueryUnlinkGraphicsDialog",
+ "svx/ui/queryunlinkgraphicsdialog.ui");
+ if (aQBox->Execute() != RET_YES)
{
bPipette = false;
m_pTbx1->CheckItem(mnPipetteId, bPipette);
@@ -693,7 +713,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow*, pWnd )
if( !!aMask )
{
- MessageDialog aQBox( this,"QueryNewContourDialog","svx/ui/querynewcontourdialog.ui");
+ ScopedVclPtrInstance< MessageDialog > aQBox( this,"QueryNewContourDialog","svx/ui/querynewcontourdialog.ui" );
bool bNewContour;
aRedoGraphic = Graphic();
@@ -701,7 +721,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow*, pWnd )
aGraphic = Graphic( BitmapEx( aBmp, aMask ) );
nGrfChanged++;
- bNewContour = ( aQBox.Execute() == RET_YES );
+ bNewContour = ( aQBox->Execute() == RET_YES );
pWnd->SetGraphic( aGraphic, bNewContour );
if( bNewContour )
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 3cbd7eda07c3..9071e536139a 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -56,7 +56,7 @@ sal_uInt32& SvxShowCharSet::getSelectedChar()
SvxShowCharSet::SvxShowCharSet(vcl::Window* pParent)
: Control(pParent, WB_TABSTOP | WB_BORDER)
, m_pAccessible(NULL)
- , aVscrollSB( this, WB_VERT)
+ , aVscrollSB( VclPtr<ScrollBar>::Create(this, WB_VERT) )
{
init();
InitSettings( true, true );
@@ -69,8 +69,8 @@ void SvxShowCharSet::init()
m_nYGap = 0;
SetStyle( GetStyle() | WB_CLIPCHILDREN );
- aVscrollSB.SetScrollHdl( LINK( this, SvxShowCharSet, VscrollHdl ) );
- aVscrollSB.EnableDrag( true );
+ aVscrollSB->SetScrollHdl( LINK( this, SvxShowCharSet, VscrollHdl ) );
+ aVscrollSB->EnableDrag( true );
// other settings like aVscroll depend on selected font => see SetFont
bDrag = false;
@@ -190,7 +190,7 @@ void SvxShowCharSet::MouseMove( const MouseEvent& rMEvt )
void SvxShowCharSet::Command( const CommandEvent& rCEvt )
{
- if( !HandleScrollCommand( rCEvt, 0, &aVscrollSB ) )
+ if( !HandleScrollCommand( rCEvt, 0, aVscrollSB.get() ) )
Control::Command( rCEvt );
}
@@ -213,8 +213,8 @@ sal_uInt16 SvxShowCharSet::GetColumnPos(sal_uInt16 _nPos)
int SvxShowCharSet::FirstInView() const
{
int nIndex = 0;
- if( aVscrollSB.IsVisible() )
- nIndex += aVscrollSB.GetThumbPos() * COLUMN_COUNT;
+ if( aVscrollSB->IsVisible() )
+ nIndex += aVscrollSB->GetThumbPos() * COLUMN_COUNT;
return nIndex;
}
@@ -365,8 +365,8 @@ void SvxShowCharSet::DrawChars_Impl( int n1, int n2 )
return;
Size aOutputSize = GetOutputSizePixel();
- if (aVscrollSB.IsVisible())
- aOutputSize.Width() -= aVscrollSB.GetOptimalSize().Width();
+ if (aVscrollSB->IsVisible())
+ aOutputSize.Width() -= aVscrollSB->GetOptimalSize().Width();
int i;
for ( i = 1; i < COLUMN_COUNT; ++i )
@@ -513,7 +513,7 @@ void SvxShowCharSet::SetFont( const vcl::Font& rFont )
getSelectedChar() = mpFontCharMap->GetCharFromIndex( nSelectedIndex );
Size aSize = GetOutputSizePixel();
- long nSBWidth = aVscrollSB.GetOptimalSize().Width();
+ long nSBWidth = aVscrollSB->GetOptimalSize().Width();
aSize.Width() -= nSBWidth;
vcl::Font aFont = rFont;
@@ -528,18 +528,18 @@ void SvxShowCharSet::SetFont( const vcl::Font& rFont )
nX = aSize.Width() / COLUMN_COUNT;
nY = aSize.Height() / ROW_COUNT;
- aVscrollSB.setPosSizePixel( aSize.Width(), 0, nSBWidth, aSize.Height() );
- aVscrollSB.SetRangeMin( 0 );
+ aVscrollSB->setPosSizePixel( aSize.Width(), 0, nSBWidth, aSize.Height() );
+ aVscrollSB->SetRangeMin( 0 );
int nLastRow = (mpFontCharMap->GetCharCount() - 1 + COLUMN_COUNT) / COLUMN_COUNT;
- aVscrollSB.SetRangeMax( nLastRow );
- aVscrollSB.SetPageSize( ROW_COUNT-1 );
- aVscrollSB.SetVisibleSize( ROW_COUNT );
+ aVscrollSB->SetRangeMax( nLastRow );
+ aVscrollSB->SetPageSize( ROW_COUNT-1 );
+ aVscrollSB->SetVisibleSize( ROW_COUNT );
// restore last selected unicode
int nMapIndex = mpFontCharMap->GetIndexFromChar( getSelectedChar() );
SelectIndex( nMapIndex );
- aVscrollSB.Show();
+ aVscrollSB->Show();
// rearrange CharSet element in sync with nX- and nY-multiples
Size aDrawSize(nX * COLUMN_COUNT, nY * ROW_COUNT);
@@ -559,7 +559,7 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, bool bFocus )
sal_uInt32 cPrev = mpFontCharMap->GetPrevChar( getSelectedChar() );
int nMapIndex = mpFontCharMap->GetIndexFromChar( cPrev );
int nNewPos = nMapIndex / COLUMN_COUNT;
- aVscrollSB.SetThumbPos( nNewPos );
+ aVscrollSB->SetThumbPos( nNewPos );
nSelectedIndex = bFocus ? nMapIndex+1 : -1;
Invalidate();
Update();
@@ -567,9 +567,9 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, bool bFocus )
else if( nNewIndex < FirstInView() )
{
// need to scroll up to see selected item
- int nOldPos = aVscrollSB.GetThumbPos();
+ int nOldPos = aVscrollSB->GetThumbPos();
int nDelta = (FirstInView() - nNewIndex + COLUMN_COUNT-1) / COLUMN_COUNT;
- aVscrollSB.SetThumbPos( nOldPos - nDelta );
+ aVscrollSB->SetThumbPos( nOldPos - nDelta );
nSelectedIndex = nNewIndex;
Invalidate();
if( nDelta )
@@ -578,15 +578,15 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, bool bFocus )
else if( nNewIndex > LastInView() )
{
// need to scroll down to see selected item
- int nOldPos = aVscrollSB.GetThumbPos();
+ int nOldPos = aVscrollSB->GetThumbPos();
int nDelta = (nNewIndex - LastInView() + COLUMN_COUNT) / COLUMN_COUNT;
- aVscrollSB.SetThumbPos( nOldPos + nDelta );
+ aVscrollSB->SetThumbPos( nOldPos + nDelta );
if( nNewIndex < mpFontCharMap->GetCharCount() )
{
nSelectedIndex = nNewIndex;
Invalidate();
}
- if( nOldPos != aVscrollSB.GetThumbPos() )
+ if( nOldPos != aVscrollSB->GetThumbPos() )
{
Invalidate();
Update();
@@ -603,8 +603,8 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, bool bFocus )
Point aOldPixel = MapIndexToPixel( nSelectedIndex );
aOldPixel.Move( +1, +1);
Size aOutputSize = GetOutputSizePixel();
- if (aVscrollSB.IsVisible())
- aOutputSize.Width() -= aVscrollSB.GetOptimalSize().Width();
+ if (aVscrollSB->IsVisible())
+ aOutputSize.Width() -= aVscrollSB->GetOptimalSize().Width();
DrawRect( getGridRectangle(aOldPixel, aOutputSize) );
SetLineColor( aLineCol );
SetFillColor( aFillCol );
@@ -655,7 +655,7 @@ void SvxShowCharSet::SelectCharacter( sal_UCS4 cNew, bool bFocus )
if( !bFocus )
{
// move selected item to top row if not in focus
- aVscrollSB.SetThumbPos( nMapIndex / COLUMN_COUNT );
+ aVscrollSB->SetThumbPos( nMapIndex / COLUMN_COUNT );
Invalidate();
}
}
@@ -691,8 +691,15 @@ IMPL_LINK_NOARG(SvxShowCharSet, VscrollHdl)
SvxShowCharSet::~SvxShowCharSet()
{
+ disposeOnce();
+}
+
+void SvxShowCharSet::dispose()
+{
if ( m_pAccessible )
ReleaseAccessible();
+ aVscrollSB.disposeAndClear();
+ Control::dispose();
}
void SvxShowCharSet::ReleaseAccessible()
diff --git a/svx/source/dialog/checklbx.cxx b/svx/source/dialog/checklbx.cxx
index e7f3542e9887..d767d4707285 100644
--- a/svx/source/dialog/checklbx.cxx
+++ b/svx/source/dialog/checklbx.cxx
@@ -50,7 +50,13 @@ void SvxCheckListBox::SetNormalStaticImage(const Image& rNormalStaticImage)
SvxCheckListBox::~SvxCheckListBox()
{
+ disposeOnce();
+}
+
+void SvxCheckListBox::dispose()
+{
delete pCheckButton;
+ SvTreeListBox::dispose();
}
void SvxCheckListBox::Init_Impl()
diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx
index f69b5545f216..53fc5635c587 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -63,6 +63,31 @@ CompressGraphicsDialog::CompressGraphicsDialog( vcl::Window* pParent, Graphic& r
Initialize();
}
+CompressGraphicsDialog::~CompressGraphicsDialog()
+{
+ disposeOnce();
+}
+
+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");
@@ -103,10 +128,6 @@ void CompressGraphicsDialog::Initialize()
Update();
}
-CompressGraphicsDialog::~CompressGraphicsDialog()
-{
-}
-
void CompressGraphicsDialog::Update()
{
GfxLinkType aLinkType = m_aGraphic.GetLink().GetType();
@@ -150,7 +171,7 @@ void CompressGraphicsDialog::Update()
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
sal_Unicode cSeparator = rLocaleWrapper.getNumDecimalSep()[0];
- VirtualDevice* pDummyVDev = new VirtualDevice();
+ VclPtr<VirtualDevice> pDummyVDev = VclPtr<VirtualDevice>::Create();
pDummyVDev->EnableOutput( false );
pDummyVDev->SetMapMode( m_aGraphic.GetPrefMapMode() );
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index 6cb31753ab37..3db87d5b7564 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -57,7 +57,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxXConnectionPreview(
SvxXConnectionPreview::~SvxXConnectionPreview()
{
+ disposeOnce();
+}
+
+void SvxXConnectionPreview::dispose()
+{
delete pObjList;
+ Control::dispose();
}
void SvxXConnectionPreview::Resize()
diff --git a/svx/source/dialog/contimp.hxx b/svx/source/dialog/contimp.hxx
index c667544cbd46..68c78423c9e6 100644
--- a/svx/source/dialog/contimp.hxx
+++ b/svx/source/dialog/contimp.hxx
@@ -57,10 +57,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;
@@ -99,6 +99,7 @@ public:
SvxSuperContourDlg(SfxBindings *pBindings, SfxChildWindow *pCW,
vcl::Window* pParent);
virtual ~SvxSuperContourDlg();
+ virtual void dispose() SAL_OVERRIDE;
void SetExecState( bool bEnable );
diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx
index cea52c2aa502..8b4fded5ab8b 100644
--- a/svx/source/dialog/contwnd.cxx
+++ b/svx/source/dialog/contwnd.cxx
@@ -43,10 +43,6 @@ ContourWindow::ContourWindow( vcl::Window* pParent, WinBits nBits ) :
SetWinStyle( WB_SDRMODE );
}
-ContourWindow::~ContourWindow()
-{
-}
-
void ContourWindow::SetPolyPolygon( const tools::PolyPolygon& rPolyPoly )
{
SdrPage* pPage = (SdrPage*) pModel->GetPage( 0 );
diff --git a/svx/source/dialog/contwnd.hxx b/svx/source/dialog/contwnd.hxx
index 2bbf9a6f2feb..e96118c8527c 100644
--- a/svx/source/dialog/contwnd.hxx
+++ b/svx/source/dialog/contwnd.hxx
@@ -50,7 +50,6 @@ protected:
public:
ContourWindow(vcl::Window* pParent, WinBits nBits);
- virtual ~ContourWindow();
void SetPolyPolygon( const tools::PolyPolygon& rPolyPoly );
const tools::PolyPolygon& GetPolyPolygon();
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 5406ba14804d..40973ace77b5 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -112,7 +112,14 @@ SvxRedlinTable::SvxRedlinTable(SvSimpleTableContainer& rParent, WinBits nBits)
SvxRedlinTable::~SvxRedlinTable()
{
+ disposeOnce();
+}
+
+void SvxRedlinTable::dispose()
+{
delete pCommentSearcher;
+ pCommentSearcher = NULL;
+ SvSimpleTable::dispose();
}
sal_Int32 SvxRedlinTable::ColCompare(SvTreeListEntry* pLeft,SvTreeListEntry* pRight)
@@ -378,7 +385,7 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel)
aControlSize = LogicToPixel(aControlSize, MAP_APPFONT);
pTable->set_width_request(aControlSize.Width());
pTable->set_height_request(aControlSize.Height());
- m_pViewData = new SvxRedlinTable(*pTable, 0);
+ m_pViewData = VclPtr<SvxRedlinTable>::Create(*pTable, 0);
Link aLink=LINK( this, SvxTPView, PbClickHdl);
@@ -411,7 +418,18 @@ void SvxTPView::DeactivatePage()
SvxTPView::~SvxTPView()
{
- delete m_pViewData;
+ disposeOnce();
+}
+
+void SvxTPView::dispose()
+{
+ m_pViewData.disposeAndClear();
+ m_pAccept.clear();
+ m_pReject.clear();
+ m_pAcceptAll.clear();
+ m_pRejectAll.clear();
+ m_pUndo.clear();
+ TabPage::dispose();
}
void SvxTPView::InsertWriterHeader()
@@ -584,6 +602,35 @@ SvxTPFilter::SvxTPFilter( vcl::Window * pParent)
bModified=false;
}
+SvxTPFilter::~SvxTPFilter()
+{
+ disposeOnce();
+}
+
+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;
@@ -950,7 +997,7 @@ void SvxTPFilter::DeactivatePage()
{
if(bModified)
{
- if(pRedlinTable!=NULL)
+ if(pRedlinTable!=nullptr)
{
pRedlinTable->SetFilterDate(IsDate());
pRedlinTable->SetDateTimeMode(GetDateMode());
@@ -1003,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)
@@ -1011,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)
@@ -1019,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)
@@ -1027,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());
}
@@ -1049,8 +1096,8 @@ SvxAcceptChgCtr::SvxAcceptChgCtr(vcl::Window* pParent, VclBuilderContainer* pTop
{
m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "svx/ui/redlinecontrol.ui", "RedlineControl");
- pTPFilter = new SvxTPFilter(this);
- pTPView = new SvxTPView(this, pTopLevel);
+ pTPFilter = VclPtr<SvxTPFilter>::Create(this);
+ pTPView = VclPtr<SvxTPView>::Create(this, pTopLevel);
m_nViewPageId = GetPageId("view");
m_nFilterPageId = GetPageId("filter");
@@ -1066,8 +1113,15 @@ SvxAcceptChgCtr::SvxAcceptChgCtr(vcl::Window* pParent, VclBuilderContainer* pTop
SvxAcceptChgCtr::~SvxAcceptChgCtr()
{
- delete pTPView;
- delete pTPFilter;
+ disposeOnce();
+}
+
+void SvxAcceptChgCtr::dispose()
+{
+ disposeBuilder();
+ pTPView.disposeAndClear();
+ pTPFilter.disposeAndClear();
+ TabControl::dispose();
}
void SvxAcceptChgCtr::ShowFilterPage()
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx
index 55016d24cc10..0735098c3cae 100644
--- a/svx/source/dialog/dialcontrol.cxx
+++ b/svx/source/dialog/dialcontrol.cxx
@@ -220,9 +220,9 @@ void DialControlBmp::DrawBackground()
DialControl::DialControl_Impl::DialControl_Impl ( vcl::Window& rParent ) :
- mxBmpEnabled(new DialControlBmp(rParent)),
- mxBmpDisabled(new DialControlBmp(rParent)),
- mxBmpBuffered(new DialControlBmp(rParent)),
+ mxBmpEnabled(VclPtr<DialControlBmp>::Create(rParent)),
+ mxBmpDisabled(VclPtr<DialControlBmp>::Create(rParent)),
+ mxBmpBuffered(VclPtr<DialControlBmp>::Create(rParent)),
mpLinkField( 0 ),
mnLinkedFieldValueMultiplyer( 0 ),
mnAngle( 0 ),
@@ -267,10 +267,6 @@ DialControl::DialControl( vcl::Window* pParent, WinBits nBits ) :
Init( GetOutputSizePixel() );
}
-DialControl::~DialControl()
-{
-}
-
extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeDialControl(vcl::Window *pParent, VclBuilder::stringmap &)
{
return new DialControl(pParent, WB_TABSTOP);
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index ce4358124f81..fb4923ebd747 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -69,8 +69,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvx3DPreviewControl(vc
Svx3DPreviewControl::~Svx3DPreviewControl()
{
+ disposeOnce();
+}
+
+void Svx3DPreviewControl::dispose()
+{
delete mp3DView;
delete mpModel;
+ Control::dispose();
}
void Svx3DPreviewControl::Construct()
@@ -272,12 +278,6 @@ Svx3DLightControl::Svx3DLightControl(vcl::Window* pParent, WinBits nStyle)
Construct2();
}
-Svx3DLightControl::~Svx3DLightControl()
-{
- // SdrObjects like mpExpansionObject and mpLampBottomObject/mpLampShaftObject get deleted
- // with deletion of the DrawingLayer and model
-}
-
void Svx3DLightControl::Construct2()
{
{
@@ -948,10 +948,10 @@ basegfx::B3DVector Svx3DLightControl::GetLightDirection(sal_uInt32 nNum) const
SvxLightCtl3D::SvxLightCtl3D( vcl::Window* pParent)
: Control(pParent, WB_BORDER | WB_TABSTOP),
- maLightControl(this, 0),
- maHorScroller(this, WB_HORZ | WB_DRAG),
- maVerScroller(this, WB_VERT | WB_DRAG),
- maSwitcher(this, 0)
+ maLightControl(VclPtr<Svx3DLightControl>::Create(this, 0)),
+ maHorScroller(VclPtr<ScrollBar>::Create(this, WB_HORZ | WB_DRAG)),
+ maVerScroller(VclPtr<ScrollBar>::Create(this, WB_VERT | WB_DRAG)),
+ maSwitcher(VclPtr<PushButton>::Create(this, 0))
{
// init members
Init();
@@ -970,33 +970,33 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxLightCtl3D(vcl::Win
void SvxLightCtl3D::Init()
{
// #i58240# set HelpIDs for scrollbars and switcher
- maHorScroller.SetHelpId(HID_CTRL3D_HSCROLL);
- maVerScroller.SetHelpId(HID_CTRL3D_VSCROLL);
- maSwitcher.SetHelpId(HID_CTRL3D_SWITCHER);
- maSwitcher.SetAccessibleName(SVX_RESSTR(STR_SWITCH));
+ maHorScroller->SetHelpId(HID_CTRL3D_HSCROLL);
+ maVerScroller->SetHelpId(HID_CTRL3D_VSCROLL);
+ maSwitcher->SetHelpId(HID_CTRL3D_SWITCHER);
+ maSwitcher->SetAccessibleName(SVX_RESSTR(STR_SWITCH));
// Light preview
- maLightControl.Show();
- maLightControl.SetChangeCallback( LINK(this, SvxLightCtl3D, InternalInteractiveChange) );
- maLightControl.SetSelectionChangeCallback( LINK(this, SvxLightCtl3D, InternalSelectionChange) );
+ maLightControl->Show();
+ maLightControl->SetChangeCallback( LINK(this, SvxLightCtl3D, InternalInteractiveChange) );
+ maLightControl->SetSelectionChangeCallback( LINK(this, SvxLightCtl3D, InternalSelectionChange) );
// Horiz Scrollbar
- maHorScroller.Show();
- maHorScroller.SetRange(Range(0, 36000));
- maHorScroller.SetLineSize(100);
- maHorScroller.SetPageSize(1000);
- maHorScroller.SetScrollHdl( LINK(this, SvxLightCtl3D, ScrollBarMove) );
+ maHorScroller->Show();
+ maHorScroller->SetRange(Range(0, 36000));
+ maHorScroller->SetLineSize(100);
+ maHorScroller->SetPageSize(1000);
+ maHorScroller->SetScrollHdl( LINK(this, SvxLightCtl3D, ScrollBarMove) );
// Vert Scrollbar
- maVerScroller.Show();
- maVerScroller.SetRange(Range(0, 18000));
- maVerScroller.SetLineSize(100);
- maVerScroller.SetPageSize(1000);
- maVerScroller.SetScrollHdl( LINK(this, SvxLightCtl3D, ScrollBarMove) );
+ maVerScroller->Show();
+ maVerScroller->SetRange(Range(0, 18000));
+ maVerScroller->SetLineSize(100);
+ maVerScroller->SetPageSize(1000);
+ maVerScroller->SetScrollHdl( LINK(this, SvxLightCtl3D, ScrollBarMove) );
// Switch Button
- maSwitcher.Show();
- maSwitcher.SetClickHdl( LINK(this, SvxLightCtl3D, ButtonPress) );
+ maSwitcher->Show();
+ maSwitcher->SetClickHdl( LINK(this, SvxLightCtl3D, ButtonPress) );
// check selection
CheckSelection();
@@ -1007,6 +1007,16 @@ void SvxLightCtl3D::Init()
SvxLightCtl3D::~SvxLightCtl3D()
{
+ disposeOnce();
+}
+
+void SvxLightCtl3D::dispose()
+{
+ maLightControl.disposeAndClear();
+ maHorScroller.disposeAndClear();
+ maVerScroller.disposeAndClear();
+ maSwitcher.disposeAndClear();
+ Control::dispose();
}
void SvxLightCtl3D::Resize()
@@ -1022,43 +1032,43 @@ void SvxLightCtl3D::NewLayout()
{
// Layout members
const Size aSize(GetOutputSizePixel());
- const sal_Int32 nScrollSize(maHorScroller.GetSizePixel().Height());
+ const sal_Int32 nScrollSize(maHorScroller->GetSizePixel().Height());
// Preview control
Point aPoint(0, 0);
Size aDestSize(aSize.Width() - nScrollSize, aSize.Height() - nScrollSize);
- maLightControl.SetPosSizePixel(aPoint, aDestSize);
+ maLightControl->SetPosSizePixel(aPoint, aDestSize);
// hor scrollbar
aPoint.Y() = aSize.Height() - nScrollSize;
aDestSize.Height() = nScrollSize;
- maHorScroller.SetPosSizePixel(aPoint, aDestSize);
+ maHorScroller->SetPosSizePixel(aPoint, aDestSize);
// vert scrollbar
aPoint.X() = aSize.Width() - nScrollSize;
aPoint.Y() = 0;
aDestSize.Width() = nScrollSize;
aDestSize.Height() = aSize.Height() - nScrollSize;
- maVerScroller.SetPosSizePixel(aPoint, aDestSize);
+ maVerScroller->SetPosSizePixel(aPoint, aDestSize);
// button
aPoint.Y() = aSize.Height() - nScrollSize;
aDestSize.Height() = nScrollSize;
- maSwitcher.SetPosSizePixel(aPoint, aDestSize);
+ maSwitcher->SetPosSizePixel(aPoint, aDestSize);
}
void SvxLightCtl3D::CheckSelection()
{
- const bool bSelectionValid(maLightControl.IsSelectionValid() || maLightControl.IsGeometrySelected());
- maHorScroller.Enable(bSelectionValid);
- maVerScroller.Enable(bSelectionValid);
+ const bool bSelectionValid(maLightControl->IsSelectionValid() || maLightControl->IsGeometrySelected());
+ maHorScroller->Enable(bSelectionValid);
+ maVerScroller->Enable(bSelectionValid);
if(bSelectionValid)
{
double fHor(0.0), fVer(0.0);
- maLightControl.GetPosition(fHor, fVer);
- maHorScroller.SetThumbPos( sal_Int32(fHor * 100.0) );
- maVerScroller.SetThumbPos( 18000 - sal_Int32((fVer + 90.0) * 100.0) );
+ maLightControl->GetPosition(fHor, fVer);
+ maHorScroller->SetThumbPos( sal_Int32(fHor * 100.0) );
+ maVerScroller->SetThumbPos( 18000 - sal_Int32((fVer + 90.0) * 100.0) );
}
}
@@ -1066,7 +1076,7 @@ void SvxLightCtl3D::move( double fDeltaHor, double fDeltaVer )
{
double fHor(0.0), fVer(0.0);
- maLightControl.GetPosition(fHor, fVer);
+ maLightControl->GetPosition(fHor, fVer);
fHor += fDeltaHor;
fVer += fDeltaVer;
@@ -1076,9 +1086,9 @@ void SvxLightCtl3D::move( double fDeltaHor, double fDeltaVer )
if ( fVer < -90.0 )
return;
- maLightControl.SetPosition(fHor, fVer);
- maHorScroller.SetThumbPos( sal_Int32(fHor * 100.0) );
- maVerScroller.SetThumbPos( 18000 - sal_Int32((fVer + 90.0) * 100.0) );
+ maLightControl->SetPosition(fHor, fVer);
+ maHorScroller->SetThumbPos( sal_Int32(fHor * 100.0) );
+ maVerScroller->SetThumbPos( 18000 - sal_Int32((fVer + 90.0) * 100.0) );
if(maUserInteractiveChangeCallback.IsSet())
{
@@ -1124,9 +1134,9 @@ void SvxLightCtl3D::KeyInput( const KeyEvent& rKEvt )
}
case KEY_PAGEUP:
{
- sal_Int32 nLight(maLightControl.GetSelectedLight() - 1);
+ sal_Int32 nLight(maLightControl->GetSelectedLight() - 1);
- while((nLight >= 0) && !maLightControl.GetLightOnOff(nLight))
+ while((nLight >= 0) && !maLightControl->GetLightOnOff(nLight))
{
nLight--;
}
@@ -1135,7 +1145,7 @@ void SvxLightCtl3D::KeyInput( const KeyEvent& rKEvt )
{
nLight = 7;
- while((nLight >= 0) && !maLightControl.GetLightOnOff(nLight))
+ while((nLight >= 0) && !maLightControl->GetLightOnOff(nLight))
{
nLight--;
}
@@ -1143,7 +1153,7 @@ void SvxLightCtl3D::KeyInput( const KeyEvent& rKEvt )
if(nLight >= 0)
{
- maLightControl.SelectLight(nLight);
+ maLightControl->SelectLight(nLight);
CheckSelection();
if(maUserSelectionChangeCallback.IsSet())
@@ -1156,9 +1166,9 @@ void SvxLightCtl3D::KeyInput( const KeyEvent& rKEvt )
}
case KEY_PAGEDOWN:
{
- sal_Int32 nLight(maLightControl.GetSelectedLight() - 1);
+ sal_Int32 nLight(maLightControl->GetSelectedLight() - 1);
- while(nLight <= 7 && !maLightControl.GetLightOnOff(nLight))
+ while(nLight <= 7 && !maLightControl->GetLightOnOff(nLight))
{
nLight++;
}
@@ -1167,7 +1177,7 @@ void SvxLightCtl3D::KeyInput( const KeyEvent& rKEvt )