summaryrefslogtreecommitdiff
path: root/sd/source/ui/presenter/PresenterTextView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/presenter/PresenterTextView.cxx')
-rw-r--r--sd/source/ui/presenter/PresenterTextView.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx
index 7fde4a4c5e08..0df3b852583a 100644
--- a/sd/source/ui/presenter/PresenterTextView.cxx
+++ b/sd/source/ui/presenter/PresenterTextView.cxx
@@ -82,7 +82,7 @@ public:
private:
Reference<rendering::XBitmap> mxBitmap;
cppcanvas::CanvasSharedPtr mpCanvas;
- VirtualDevice* mpOutputDevice;
+ VclPtr<VirtualDevice> mpOutputDevice;
EditEngine* mpEditEngine;
SfxItemPool* mpEditEngineItemPool;
Size maSize;
@@ -242,7 +242,7 @@ PresenterTextView::Implementation::Implementation()
msTotalHeightPropertyName("TotalHeight"),
mxBitmap(),
mpCanvas(),
- mpOutputDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0)),
+ mpOutputDevice(VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 0, 0)),
mpEditEngine(NULL),
mpEditEngineItemPool(EditEngine::CreatePool()),
maSize(100,100),
@@ -261,7 +261,7 @@ PresenterTextView::Implementation::~Implementation()
{
delete mpEditEngine;
SfxItemPool::Free(mpEditEngineItemPool);
- delete mpOutputDevice;
+ mpOutputDevice.disposeAndClear();
}
EditEngine * PresenterTextView::Implementation::GetEditEngine()
@@ -453,9 +453,8 @@ Reference<rendering::XBitmap> PresenterTextView::Implementation::GetBitmap()
if ( ! mxBitmap.is())
{
- if (mpOutputDevice != NULL)
- delete mpOutputDevice;
- mpOutputDevice = new VirtualDevice(*Application::GetDefaultDevice(), 0, 0);
+ mpOutputDevice.disposeAndClear();
+ mpOutputDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), 0, 0);
mpOutputDevice->SetMapMode(MAP_PIXEL);
mpOutputDevice->SetOutputSizePixel(maSize, true);
mpOutputDevice->SetLineColor();