summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-30 20:16:53 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-30 20:16:53 +0100
commitcd8a295444690b9c0dfb43ee4de01bf6ffeb1aa1 (patch)
tree73ed3975915f42028c35bc59aab70c0f287f99ba /desktop
parent5adaf30d7403dab3f81f2efc457bfb78e0e49f7b (diff)
loplugin:vclwidgets
Change-Id: I520e27de82f11cc3c44c0e059ad60f3edaa4c370
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 49a1ef1b0462..c6da34c647dc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1566,12 +1566,14 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
if (!aSearchedFontName.equals(aFontName.toUtf8().getStr()))
continue;
- VirtualDevice aDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT);
+ auto aDevice(
+ VclPtr<VirtualDevice>::Create(
+ nullptr, Size(1, 1), DeviceFormat::DEFAULT));
::Rectangle aRect;
vcl::Font aFont(rInfo);
aFont.SetSize(Size(0, 25));
- aDevice.SetFont(aFont);
- aDevice.GetTextBoundRect(aRect, aFontName);
+ aDevice->SetFont(aFont);
+ aDevice->GetTextBoundRect(aRect, aFontName);
int nFontWidth = aRect.BottomRight().X() + 1;
*pFontWidth = nFontWidth;
int nFontHeight = aRect.BottomRight().Y() + 1;
@@ -1581,11 +1583,11 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/,
memset(pBuffer, 0, nFontWidth * nFontHeight * 4);
boost::shared_array<sal_uInt8> aBuffer(pBuffer, NoDelete< sal_uInt8 >());
- aDevice.SetBackground(Wallpaper(COL_TRANSPARENT));
- aDevice.SetOutputSizePixelScaleOffsetAndBuffer(
+ aDevice->SetBackground(Wallpaper(COL_TRANSPARENT));
+ aDevice->SetOutputSizePixelScaleOffsetAndBuffer(
Size(nFontWidth, nFontHeight), Fraction(1.0), Point(),
aBuffer, nullptr);
- aDevice.DrawText(Point(0,0), aFontName);
+ aDevice->DrawText(Point(0,0), aFontName);
return pBuffer;
}