From e5a7ee832b4385fa83a914f4d7d81ed860da0667 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Mon, 22 Oct 2018 21:00:30 +0200 Subject: Return bool from InitFont and try to init the font InitFont() is always called after ImplNewFont(). Calling InitFont() without a call to ImplNewFont() doesn't make much sense. There are some places which don't need to set the SalGraphics font, but these are fine with calling ImplNewFont() as is. It now looks like Printer' and OutputDevice' InitFont() do the same, after commit c766a05ae035 ("Antialias drawing is part of the font selection") moved Antialias handling into the common ImplNewFont() function. Change-Id: I77b9a5b6dbed186a2b0868537930d6bf3fccd9d5 Reviewed-on: https://gerrit.libreoffice.org/62202 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski --- vcl/source/outdev/textline.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'vcl/source/outdev/textline.cxx') diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index 550fc781f6d0..9b4f6be2a042 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -930,10 +930,6 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth, if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() ) return; - // we need a graphics - if( !mpGraphics && !AcquireGraphics() ) - return; - if( mbInitClipRegion ) InitClipRegion(); @@ -942,12 +938,9 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth, // initialize font if needed to get text offsets // TODO: only needed for mnTextOff!=(0,0) - if( mbNewFont && !ImplNewFont() ) + if (!InitFont()) return; - if( mbInitFont ) - InitFont(); - Point aPos = ImplLogicToDevicePixel( rPos ); DeviceCoordinate fWidth; fWidth = LogicWidthToDeviceCoordinate( nWidth ); @@ -975,7 +968,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos ) if ( mbOutputClipped ) return; - if( mbNewFont && !ImplNewFont() ) + if (!InitFont()) return; Point aStartPt = ImplLogicToDevicePixel( rStartPos ); -- cgit