summaryrefslogtreecommitdiff
path: root/chart2/source/view/main/DummyXShape.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-03-19 14:45:20 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-04-10 12:15:05 +0100
commiteac22a0630bcf3780142f64a022fa432e13bb7e1 (patch)
tree303b3dd00dea373d12198ed3c07b02679e7b8718 /chart2/source/view/main/DummyXShape.cxx
parent057347dad41f7df3222cc483fdff83fa631606bb (diff)
Fix OutputDevice members / stack allocation: chart, canvas, cui.
Change-Id: Ieb6f58222ffc3e03c1d599752a6f02600e1bee1f
Diffstat (limited to 'chart2/source/view/main/DummyXShape.cxx')
-rw-r--r--chart2/source/view/main/DummyXShape.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index b6f6237aa3c8..6701de177a8f 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -836,19 +836,19 @@ DummyText::DummyText(const OUString& rText, const tNameSequence& rNames,
{
vcl::Font aFont;
std::for_each(maProperties.begin(), maProperties.end(), FontAttribSetter(aFont));
- VirtualDevice aDevice(*Application::GetDefaultDevice(), 0, 0);
- aDevice.Erase();
+ ScopedVclPtr<VirtualDevice> pDevice(new VirtualDevice(*Application::GetDefaultDevice(), 0, 0));
+ pDevice->Erase();
Rectangle aRect;
- aDevice.SetFont(aFont);
- aDevice.GetTextBoundRect(aRect, rText);
+ pDevice->SetFont(aFont);
+ pDevice->GetTextBoundRect(aRect, rText);
int screenWidth = (aRect.BottomRight().X());
int screenHeight = (aRect.BottomRight().Y());
- aDevice.SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.DrawText(Point(0, 0), rText);
+ pDevice->SetOutputSizePixel(Size(screenWidth * 3, screenHeight));
+ pDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ pDevice->DrawText(Point(0, 0), rText);
bmpWidth = aRect.Right() - aRect.Left();
bmpHeight = aRect.Bottom() - aRect.Top();
- maBitmap = BitmapEx(aDevice.GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
+ maBitmap = BitmapEx(pDevice->GetBitmapEx(aRect.TopLeft(), Size(bmpWidth, bmpHeight)));
rCache.insertBitmap(aKey, maBitmap);
}