[Libreoffice-commits] core.git: 4 commits - editeng/source sd/inc sd/source

Caolán McNamara caolanm at redhat.com
Wed May 6 15:55:50 PDT 2015


 editeng/source/editeng/impedit2.cxx                   |    4 ++--
 sd/inc/sdmod.hxx                                      |    4 ++--
 sd/source/ui/app/sdmod.cxx                            |    7 +++----
 sd/source/ui/framework/factories/BasicViewFactory.hxx |    2 +-
 sd/source/ui/view/viewshel.cxx                        |    2 +-
 5 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 0393df4f9c2cb163350aef3fa14e7d1662367065
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 6 21:15:38 2015 +0100

    VclPtr: one ref too many
    
    Change-Id: Ie360ae76f8692abbc5487f9b76b543477cce438b

diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx
index 3d2b268..c99acde 100644
--- a/sd/inc/sdmod.hxx
+++ b/sd/inc/sdmod.hxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/text/WritingMode.hpp>
 #include <sfx2/module.hxx>
 #include <vcl/vclevent.hxx>
+#include <vcl/virdev.hxx>
 #include <sal/types.h>
 #include <map>
 #include <memory>
@@ -41,7 +42,6 @@ class EditFieldInfo;
 class SdTransferable;
 class SvNumberFormatter;
 class SfxErrorHandler;
-class OutputDevice;
 class SdDrawDocument;
 class SfxFrame;
 
@@ -144,7 +144,7 @@ protected:
         in the sense that it does not represent a printer.  The pointer may
         be NULL when the virtual device could not be created.
     */
-    VclPtr< OutputDevice >  mpVirtualRefDevice;
+    VclPtr< VirtualDevice >  mpVirtualRefDevice;
 
     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
 
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index 5c3b2dd..422e2a8 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -94,10 +94,9 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 )
     // Create a new ref device and (by calling SetReferenceDevice())
     // set its resolution to 600 DPI.  This leads to a visually better
     // formatting of text in small sizes (6 point and below.)
-    VirtualDevice* pDevice = new VirtualDevice;
-    mpVirtualRefDevice = pDevice;
-    pDevice->SetMapMode( MAP_100TH_MM );
-    pDevice->SetReferenceDevice ( VirtualDevice::REFDEV_MODE06 );
+    mpVirtualRefDevice.reset(VclPtr<VirtualDevice>::Create());
+    mpVirtualRefDevice->SetMapMode( MAP_100TH_MM );
+    mpVirtualRefDevice->SetReferenceDevice ( VirtualDevice::REFDEV_MODE06 );
 }
 
 // Dtor
commit 0237d8a6917ff486034747c4d28bf97611abcd3b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 6 20:58:42 2015 +0100

    VclPtr: someone needs to dispose this mpWindow
    
    Change-Id: Ib08482d0a3f6cb62e16a21fba2025913ca1aedad

diff --git a/sd/source/ui/framework/factories/BasicViewFactory.hxx b/sd/source/ui/framework/factories/BasicViewFactory.hxx
index 1f4cd34..f2278bb 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.hxx
@@ -105,7 +105,7 @@ private:
     FrameView* mpFrameView;
 
     class ViewCache;
-    VclPtr<vcl::Window> mpWindow;
+    ScopedVclPtr<vcl::Window> mpWindow;
     ::boost::shared_ptr<ViewCache> mpViewCache;
 
     css::uno::Reference<css::drawing::framework::XPane> mxLocalPane;
commit 19fddecd3c2858accecce8f88415f1dfd8e4368e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 6 20:42:49 2015 +0100

    VclPtr: one ref too many
    
    Change-Id: I0a299050d8ae19bdac555e75116c5b85f409a6c2

diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 7f5aea1..f5168b5 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -197,7 +197,7 @@ void ViewShell::construct()
 
     mpZoomList = new ZoomList( this );
 
-    mpContentWindow.reset(new ::sd::Window(GetParentWindow()));
+    mpContentWindow.reset(VclPtr< ::sd::Window >::Create(GetParentWindow()));
     SetActiveWindow (mpContentWindow.get());
 
     GetParentWindow()->SetBackground (Wallpaper());
commit 2c9dac6dfd875465a7b16997c5523af5a4953b4e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed May 6 20:32:52 2015 +0100

    VclPtr: one ref too many
    
    Change-Id: I0efce31e0f7cc5aa4895b6e5e35432d3f0c6fb70

diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 975da67..7e5f1d0 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -191,7 +191,7 @@ void ImpEditEngine::SetRefDevice( OutputDevice* pRef )
 
     if ( !pRef )
     {
-        pRefDev = new VirtualDevice;
+        pRefDev = VclPtr<VirtualDevice>::Create();
         pRefDev->SetMapMode( MAP_TWIP );
         bOwnerOfRefDev = true;
     } else
@@ -216,7 +216,7 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode )
 
     if ( !bOwnerOfRefDev )
     {
-        pRefDev = new VirtualDevice;
+        pRefDev = VclPtr<VirtualDevice>::Create();
         pRefDev->SetMapMode( MAP_TWIP );
         SetRefDevice( pRefDev );
         bOwnerOfRefDev = true;


More information about the Libreoffice-commits mailing list