poppler/Gfx.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-)
New commits: commit f390d834ecbfe1350f82467d44291d0f567942ee Author: Albert Astals Cid <aa...@kde.org> Date: Wed Jul 17 17:34:15 2019 +0200 Simplify GfxResources::lookupPattern by using the new Dict::lookup that returns the Ref if the object is a Ref diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index a9b93b61..47627ad3 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -454,20 +454,13 @@ Object GfxResources::lookupColorSpace(const char *name) { GfxPattern *GfxResources::lookupPattern(const char *name, OutputDev *out, GfxState *state) { GfxResources *resPtr; - GfxPattern *pattern; for (resPtr = this; resPtr; resPtr = resPtr->next) { if (resPtr->patternDict.isDict()) { - Object obj = resPtr->patternDict.dictLookupNF(name).copy(); + Ref patternRef = Ref::INVALID(); + Object obj = resPtr->patternDict.getDict()->lookup(name, &patternRef); if (!obj.isNull()) { - Ref patternRef = { -1, -1 }; - if (obj.isRef()) { - patternRef = obj.getRef(); - obj = obj.fetch(resPtr->patternDict.getDict()->getXRef()); - } - - pattern = GfxPattern::parse(resPtr, &obj, out, state, patternRef.num); - return pattern; + return GfxPattern::parse(resPtr, &obj, out, state, patternRef.num); } } } _______________________________________________ poppler mailing list poppler@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/poppler