[poppler] poppler/Annot.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 14 14:06:09 UTC 2018


 poppler/Annot.cc |   14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 09952b05990a4c5bcd9763dd6701cefb13ab8e69
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Nov 14 15:05:52 2018 +0100

    AnnotFileAttachment::initialize: Save a Object::copy()

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index e6530d2d..0732de92 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -5853,19 +5853,17 @@ AnnotFileAttachment::AnnotFileAttachment(PDFDoc *docA, Object *dictObject, Objec
 AnnotFileAttachment::~AnnotFileAttachment() = default;
 
 void AnnotFileAttachment::initialize(PDFDoc *docA, Dict* dict) {
-  Object obj1;
-
-  obj1 = dict->lookup("FS");
-  if (obj1.isDict() || obj1.isString()) {
-    file = obj1.copy();
+  Object objFS = dict->lookup("FS");
+  if (objFS.isDict() || objFS.isString()) {
+    file = std::move(objFS);
   } else {
     error(errSyntaxError, -1, "Bad Annot File Attachment");
     ok = false;
   }
 
-  obj1 = dict->lookup("Name");
-  if (obj1.isName()) {
-    name = std::make_unique<GooString>(obj1.getName());
+  Object objName = dict->lookup("Name");
+  if (objName.isName()) {
+    name = std::make_unique<GooString>(objName.getName());
   } else {
     name = std::make_unique<GooString>("PushPin");
   }


More information about the poppler mailing list