Fix obscure xpdfimport crash on missing fonts

Invert logic, such that the case WMode == 0 and no font set now run
the former else branch. Happened here for an obscure pdf I was missing
some fonts for.

Change-Id: I2825c914a04f6a95d459eeeffb8091ed8f1819dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162029
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
This commit is contained in:
Thorsten Behrens 2024-01-13 21:40:09 +01:00
parent 0cfb4aa262
commit 1637610478

View file

@ -956,19 +956,19 @@ void PDFOutDev::drawChar(GfxState *state, double x, double y,
double csdx = 0.0;
double csdy = 0.0;
if (state->getFont()->getWMode())
{
csdy = state->getCharSpace();
if (*u == ' ')
csdy += state->getWordSpace();
}
else
if (!state->getFont() || !state->getFont()->getWMode())
{
csdx = state->getCharSpace();
if (*u == ' ')
csdx += state->getWordSpace();
csdx *= state->getHorizScaling();
}
else
{
csdy = state->getCharSpace();
if (*u == ' ')
csdy += state->getWordSpace();
}
double cstdx = 0.0;
double cstdy = 0.0;