Do not assume pdfdoc hints won't change

Since sometimes we even change the pdfdoc pointer itself ;-)
This was working previously by pure luck (read bug in poppler :D)
BUGS: 284464
FIXED-IN: 4.7.3
(cherry picked from commit eb705417fa)
This commit is contained in:
Albert Astals Cid 2011-10-19 15:44:53 +02:00
parent d41f230123
commit fc58c9824f

View file

@ -1118,17 +1118,13 @@ void PDFGenerator::addPages( KConfigDialog * )
bool PDFGenerator::setDocumentRenderHints()
{
bool changed = false;
static Poppler::Document::RenderHints oldhints = 0;
const Poppler::Document::RenderHints oldhints = pdfdoc->renderHints();
#define SET_HINT(hintname, hintdefvalue, hintflag) \
{ \
bool newhint = documentMetaData(hintname, hintdefvalue).toBool(); \
if (newhint != (oldhints & hintflag)) \
{ \
pdfdoc->setRenderHint(hintflag, newhint); \
if (newhint) \
oldhints |= hintflag; \
else \
oldhints &= ~(int)hintflag; \
changed = true; \
} \
}