Use the default provided Ref = operator, it's good enough
diff --git a/poppler/Link.cc b/poppler/Link.cc
index 33b842f..5a5e868 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -239,8 +239,7 @@
     pageNum = obj0.getInt() + 1;
     pageIsRef = false;
   } else if (obj0.isRef()) {
-    pageRef.num = obj0.getRefNum();
-    pageRef.gen = obj0.getRefGen();
+    pageRef = obj0.getRef();
     pageIsRef = true;
   } else {
     error(errSyntaxWarning, -1, "Bad annotation destination");
@@ -859,8 +858,7 @@
         if (stList) {
 	  Ref ocgRef = obj2.getRef();
 	  Ref *item = new Ref();
-	  item->num = ocgRef.num;
-	  item->gen = ocgRef.gen;
+	  *item = ocgRef;
 	  stList->list->push_back(item);
 	} else {
 	  error(errSyntaxWarning, -1, "Invalid OCG Action State array, expected name instead of ref");
diff --git a/poppler/Object.h b/poppler/Object.h
index 914b10b..2dbc9e9 100644
--- a/poppler/Object.h
+++ b/poppler/Object.h
@@ -179,7 +179,7 @@
   explicit Object(Stream *streamA)
     { assert(streamA); type = objStream; stream = streamA; }
   explicit Object(const Ref r)
-    { type = objRef; ref.num = r.num; ref.gen = r.gen; }
+    { type = objRef; ref = r; }
 
   template<typename T> Object(T) = delete;
 
diff --git a/poppler/StructElement.h b/poppler/StructElement.h
index 4cc052a..83023ee 100644
--- a/poppler/StructElement.h
+++ b/poppler/StructElement.h
@@ -279,7 +279,7 @@
     };
 
     ContentData(int mcidA): mcid(mcidA) {}
-    ContentData(const Ref r) { ref.num = r.num; ref.gen = r.gen; }
+    ContentData(const Ref r) { ref = r; }
   };
 
   // Common data