[poppler] qt5/src qt6/src

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 3 16:24:55 UTC 2022


 qt5/src/poppler-annotation.cc |    3 +++
 qt5/src/poppler-link.h        |    5 +++--
 qt5/src/poppler-page.cc       |    7 +++++--
 qt6/src/poppler-link.h        |    5 +++--
 qt6/src/poppler-page.cc       |    7 +++++--
 5 files changed, 19 insertions(+), 8 deletions(-)

New commits:
commit 26f56c073bdcccb5780e8cc3226ff2a2df6fe97d
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Mar 1 23:28:47 2022 +0100

    qt: Handle SaveAs named action

diff --git a/qt5/src/poppler-annotation.cc b/qt5/src/poppler-annotation.cc
index d25b3a00..c7607b88 100644
--- a/qt5/src/poppler-annotation.cc
+++ b/qt5/src/poppler-annotation.cc
@@ -3848,6 +3848,9 @@ void LinkAnnotation::store(QDomNode &node, QDomDocument &document) const
             case Poppler::LinkAction::Print:
                 hyperlinkElement.setAttribute(QStringLiteral("action"), QStringLiteral("Print"));
                 break;
+            case Poppler::LinkAction::SaveAs:
+                hyperlinkElement.setAttribute(QStringLiteral("action"), QStringLiteral("SaveAs"));
+                break;
             }
             break;
         }
diff --git a/qt5/src/poppler-link.h b/qt5/src/poppler-link.h
index e83e2f8f..5de35429 100644
--- a/qt5/src/poppler-link.h
+++ b/qt5/src/poppler-link.h
@@ -1,5 +1,5 @@
 /* poppler-link.h: qt interface to poppler
- * Copyright (C) 2006, 2013, 2016, 2018, 2019, 2021, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2006, 2013, 2016, 2018, 2019, 2021, 2022, Albert Astals Cid <aacid at kde.org>
  * Copyright (C) 2007-2008, 2010, Pino Toscano <pino at kde.org>
  * Copyright (C) 2010, 2012, Guillermo Amaral <gamaral at kdab.com>
  * Copyright (C) 2012, Tobias Koenig <tokoe at kdab.com>
@@ -385,7 +385,8 @@ public:
         Find = 10,
         GoToPage = 11,
         Close = 12,
-        Print = 13 ///< \since 0.16
+        Print = 13, ///< \since 0.16
+        SaveAs = 14 ///< \since 22.04
     };
 
     /**
diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc
index eedc580f..1e808f7a 100644
--- a/qt5/src/poppler-page.cc
+++ b/qt5/src/poppler-page.cc
@@ -1,7 +1,7 @@
 /* poppler-page.cc: qt interface to poppler
  * Copyright (C) 2005, Net Integration Technologies, Inc.
  * Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
- * Copyright (C) 2005-2021, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2005-2022, Albert Astals Cid <aacid at kde.org>
  * Copyright (C) 2005, Stefan Kebekus <stefan.kebekus at math.uni-koeln.de>
  * Copyright (C) 2006-2011, Pino Toscano <pino at kde.org>
  * Copyright (C) 2008 Carlos Garcia Campos <carlosgc at gnome.org>
@@ -50,6 +50,7 @@
 #include <QtCore/QVarLengthArray>
 #include <QtGui/QImage>
 #include <QtGui/QPainter>
+#include <QDebug>
 
 #include <config.h>
 #include <cfloat>
@@ -256,8 +257,10 @@ Link *PageData::convertLinkActionToLink(::LinkAction *a, DocumentData *parentDoc
             // its presentation mode or not
             // popplerLink = new LinkAction( linkArea, LinkAction::EndPresentation );
             popplerLink = new LinkAction(linkArea, LinkAction::Close);
+        } else if (name == "SaveAs") {
+            popplerLink = new LinkAction(linkArea, LinkAction::SaveAs);
         } else {
-            // TODO
+            qWarning() << "Unhandled action name" << name.c_str();
         }
     } break;
 
diff --git a/qt6/src/poppler-link.h b/qt6/src/poppler-link.h
index 7cadd218..52065a2e 100644
--- a/qt6/src/poppler-link.h
+++ b/qt6/src/poppler-link.h
@@ -1,5 +1,5 @@
 /* poppler-link.h: qt interface to poppler
- * Copyright (C) 2006, 2013, 2016, 2018, 2019, 2021, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2006, 2013, 2016, 2018, 2019, 2021, 2022, Albert Astals Cid <aacid at kde.org>
  * Copyright (C) 2007-2008, 2010, Pino Toscano <pino at kde.org>
  * Copyright (C) 2010, 2012, Guillermo Amaral <gamaral at kdab.com>
  * Copyright (C) 2012, Tobias Koenig <tokoe at kdab.com>
@@ -382,7 +382,8 @@ public:
         Find = 10,
         GoToPage = 11,
         Close = 12,
-        Print = 13
+        Print = 13,
+        SaveAs = 14 ///< \since 22.04
     };
 
     /**
diff --git a/qt6/src/poppler-page.cc b/qt6/src/poppler-page.cc
index afdbf692..84786d33 100644
--- a/qt6/src/poppler-page.cc
+++ b/qt6/src/poppler-page.cc
@@ -1,7 +1,7 @@
 /* poppler-page.cc: qt interface to poppler
  * Copyright (C) 2005, Net Integration Technologies, Inc.
  * Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
- * Copyright (C) 2005-2021, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2005-2022, Albert Astals Cid <aacid at kde.org>
  * Copyright (C) 2005, Stefan Kebekus <stefan.kebekus at math.uni-koeln.de>
  * Copyright (C) 2006-2011, Pino Toscano <pino at kde.org>
  * Copyright (C) 2008 Carlos Garcia Campos <carlosgc at gnome.org>
@@ -49,6 +49,7 @@
 #include <QtCore/QVarLengthArray>
 #include <QtGui/QImage>
 #include <QtGui/QPainter>
+#include <QDebug>
 
 #include <config.h>
 #include <cfloat>
@@ -255,8 +256,10 @@ std::unique_ptr<Link> PageData::convertLinkActionToLink(::LinkAction *a, Documen
             // its presentation mode or not
             // popplerLink = std::make_unique<LinkAction>(linkArea, LinkAction::EndPresentation);
             popplerLink = std::make_unique<LinkAction>(linkArea, LinkAction::Close);
+        } else if (name == "SaveAs") {
+            popplerLink = std::make_unique<LinkAction>(linkArea, LinkAction::SaveAs);
         } else {
-            // TODO
+            qWarning() << "Unhandled action name" << name.c_str();
         }
     } break;
 


More information about the poppler mailing list