[poppler] poppler/Gfx.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 30 08:29:57 UTC 2022


 poppler/Gfx.cc |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit f9d958ddee1e9a77d41c80793fd20ce5299f08ef
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Dec 27 09:38:55 2022 +0100

    Gfx::opBeginMarkedContent: Support Span with Name
    
    Issue #1327

diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 17202a07..63e6c963 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -14,7 +14,7 @@
 // under GPL version 2 or later
 //
 // Copyright (C) 2005 Jonathan Blandford <jrb at redhat.com>
-// Copyright (C) 2005-2013, 2015-2021 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2005-2013, 2015-2022 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2006 Thorkild Stray <thorkild at ifi.uio.no>
 // Copyright (C) 2006 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2006-2011 Carlos Garcia Campos <carlosgc at gnome.org>
@@ -5049,12 +5049,21 @@ void Gfx::opBeginMarkedContent(Object args[], int numArgs)
         } else {
             error(errSyntaxError, getPos(), "insufficient arguments for Marked Content");
         }
-    } else if (args[0].isName("Span") && numArgs == 2 && args[1].isDict()) {
-        Object obj = args[1].dictLookup("ActualText");
-        if (obj.isString()) {
-            out->beginActualText(state, obj.getString());
-            MarkedContentStack *mc = mcStack;
-            mc->kind = gfxMCActualText;
+    } else if (args[0].isName("Span") && numArgs == 2) {
+        Object dictToUse;
+        if (args[1].isDict()) {
+            dictToUse = args[1].copy();
+        } else if (args[1].isName()) {
+            dictToUse = res->lookupMarkedContentNF(args[1].getName()).fetch(xref);
+        }
+
+        if (dictToUse.isDict()) {
+            Object obj = dictToUse.dictLookup("ActualText");
+            if (obj.isString()) {
+                out->beginActualText(state, obj.getString());
+                MarkedContentStack *mc = mcStack;
+                mc->kind = gfxMCActualText;
+            }
         }
     }
 


More information about the poppler mailing list