poppler/Link.cc |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 87b2436275c19b23dd3b50c5ed2cc83cc0a514f6
Author: Albert Astals Cid <aa...@kde.org>
Date:   Tue Dec 14 12:37:20 2021 +0100

    LinkResetForm: Also understand strings in the Fields field

diff --git a/poppler/Link.cc b/poppler/Link.cc
index a4f05f3d..11ef879b 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -16,7 +16,7 @@
 // Copyright (C) 2006, 2008 Pino Toscano <p...@kde.org>
 // Copyright (C) 2007, 2010, 2011 Carlos Garcia Campos <carlo...@gnome.org>
 // Copyright (C) 2008 Hugo Mercier <hmercie...@gmail.com>
-// Copyright (C) 2008-2010, 2012-2014, 2016-2020 Albert Astals Cid 
<aa...@kde.org>
+// Copyright (C) 2008-2010, 2012-2014, 2016-2021 Albert Astals Cid 
<aa...@kde.org>
 // Copyright (C) 2009 Kovid Goyal <ko...@kovidgoyal.net>
 // Copyright (C) 2009 Ilya Gorenbein <igorenb...@finjan.com>
 // Copyright (C) 2012 Tobias Koening <tobias.koe...@kdab.com>
@@ -859,13 +859,17 @@ LinkResetForm::LinkResetForm(const Object *obj)
         fields.resize(obj1.arrayGetLength());
         for (int i = 0; i < obj1.arrayGetLength(); ++i) {
             const Object &obj2 = obj1.arrayGetNF(i);
-            if (obj2.isName())
+            if (obj2.isName()) {
                 fields[i] = std::string(obj2.getName());
-            else if (obj2.isRef()) {
+            } else if (obj2.isString()) {
+                fields[i] = obj2.getString()->toStr();
+            } else if (obj2.isRef()) {
                 fields[i] = std::to_string(obj2.getRef().num);
                 fields[i].append(" ");
                 fields[i].append(std::to_string(obj2.getRef().gen));
                 fields[i].append(" R");
+            } else {
+                error(errSyntaxWarning, -1, "LinkResetForm: unexpected Field 
type");
             }
         }
     }

Reply via email to