[Libreoffice-commits] core.git: Branch 'feature/vclptr' - 2 commits - include/vcl vcl/source

Noel Grandin noel at peralex.com
Fri Apr 10 06:25:57 PDT 2015


 include/vcl/button.hxx        |    2 +-
 vcl/source/control/button.cxx |    5 ++---
 vcl/source/window/winproc.cxx |    4 ++--
 3 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit ee33b094f6e02f8fcde2743c8d2ce400cfef64df
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 10 15:25:33 2015 +0200

    loplugin:vclwidgets workaround
    
    workaround "OutputDevice subclass should have nothing in it's destructor
    but a call to disposeOnce()."
    
    Change-Id: Icc7e09ea4dec3292b62d1aba4dc881220c115414

diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index de7fbee..937c4ff 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -37,7 +37,7 @@ class ImplCommonButtonData;
 class VCL_DLLPUBLIC Button : public Control
 {
 private:
-    ImplCommonButtonData *mpButtonData;
+    std::unique_ptr<ImplCommonButtonData> mpButtonData;
     Link maClickHdl;
 
     /// Command URL (like .uno:Save) in case the button should handle it.
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 09a6ee5..b5ba836 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -88,15 +88,14 @@ ImplCommonButtonData::~ImplCommonButtonData()
 }
 
 Button::Button( WindowType nType ) :
-    Control( nType )
+    Control( nType ),
+    mpButtonData( new ImplCommonButtonData )
 {
-    mpButtonData = new ImplCommonButtonData;
 }
 
 Button::~Button()
 {
     disposeOnce();
-    delete mpButtonData;
 }
 
 void Button::dispose()
commit a4a18d393c66ce5ed59a1f8dbcd8093bee7c657c
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 10 15:22:30 2015 +0200

    wrap vcl::Window* in VclPtr
    
    Change-Id: Ia0c259a4518e91b3dac50927812bef717bce5273

diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 4570b75..5e63e64 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1371,14 +1371,14 @@ class HandleGestureEventBase
 {
 protected:
     ImplSVData* m_pSVData;
-    vcl::Window *m_pWindow;
+    VclPtr<vcl::Window> m_pWindow;
     Point m_aMousePos;
 
 public:
 
     struct WindowDescription
     {
-        vcl::Window *m_pMouseWindow;
+        VclPtr<vcl::Window> m_pMouseWindow;
         bool m_bIsFloat;
         WindowDescription(vcl::Window *pMouseWindow, bool bIsFloat)
             : m_pMouseWindow(pMouseWindow)


More information about the Libreoffice-commits mailing list