restore compatibility with older popplers

with poppler 20.09:

/home/rene/LibreOffice/git/libreoffice-7-2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx: In member function 'int
                 pdfi::PDFOutDev::parseFont(long long int, GfxFont*, GfxState*) const':
/home/rene/LibreOffice/git/libreoffice-7-2/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx:438:39: error: 'class
                 GfxFont' has no member named 'getNameWithoutSubsetTag'

https://www.google.com/search?q=getNameWithoutSubsetTag&oq=getNameWithoutSubsetTag&aqs=chrome..69i57.784j0j7&sourceid=chrome&ie=UTF-8 suggests it was added in 20.12

Change-Id: I4eacd2d740cb689ff9b3c6cab59376e01b1ba162
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118977
Tested-by: René Engelhard <rene@debian.org>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Kevin Suo
2021-07-16 09:06:47 +02:00
committed by Noel Grandin
parent 44db9f0807
commit 0708704161
@@ -432,10 +432,15 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* gfxFont, GfxState* state )
FontAttributes aNewFont;
int nSize = 0;
#if POPPLER_CHECK_VERSION(0, 64, 0)
const
#endif
#if POPPLER_CHECK_VERSION(20, 12, 0)
std::string familyName = gfxFont->getNameWithoutSubsetTag();
#else
std::string familyName = gfxFont->getName()->toStr();
if (familyName.length() > 7 && familyName.at(6) == '+')
{
familyName = familyName.substr(7);
}
#endif
if( familyName != "" )
{
aNewFont.familyName.clear();