Kaydet (Commit) 3fffbb74 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Caolán McNamara

Initialize graphics in OutputDevice::getFallbackFont.

OutputDevice::getFallbackFont requires mpGraphics to be created/initialized.
Without the check and initialization OutputDevice::getFallbackFont will segfault.

Change-Id: I18225a24a6767933c8f1ff8f1cfd392543a95132
Reviewed-on: https://gerrit.libreoffice.org/14287Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 343a2305
...@@ -2027,6 +2027,11 @@ SalLayout* OutputDevice::getFallbackFont(ImplFontEntry &rFallbackFont, ...@@ -2027,6 +2027,11 @@ SalLayout* OutputDevice::getFallbackFont(ImplFontEntry &rFallbackFont,
FontSelectPattern &rFontSelData, int nFallbackLevel, FontSelectPattern &rFontSelData, int nFallbackLevel,
ImplLayoutArgs& rLayoutArgs) const ImplLayoutArgs& rLayoutArgs) const
{ {
// we need a graphics
if (!mpGraphics && !AcquireGraphics())
return nullptr;
assert(mpGraphics != nullptr);
rFallbackFont.mnSetFontFlags = mpGraphics->SetFont( &rFontSelData, nFallbackLevel ); rFallbackFont.mnSetFontFlags = mpGraphics->SetFont( &rFontSelData, nFallbackLevel );
rLayoutArgs.ResetPos(); rLayoutArgs.ResetPos();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment