[poppler] cpp/poppler-page-transition.cpp cpp/poppler-page-transition.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 5 14:45:46 UTC 2022


 cpp/poppler-page-transition.cpp |    7 ++++++-
 cpp/poppler-page-transition.h   |    5 +++--
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit d55f9ee33ea3a7d233b9e40a548345bc0ca7653f
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Apr 5 16:40:38 2022 +0200

    cpp: Add page_transition::durationReal
    
    The duration is really a double, so add a function that doesn't turns
    that double into an int

diff --git a/cpp/poppler-page-transition.cpp b/cpp/poppler-page-transition.cpp
index 211ed051..7d19e910 100644
--- a/cpp/poppler-page-transition.cpp
+++ b/cpp/poppler-page-transition.cpp
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009-2010, Pino Toscano <pino at kde.org>
- * Copyright (C) 2011, 2021, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2011, 2021, 2022, Albert Astals Cid <aacid at kde.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -81,6 +81,11 @@ page_transition::type_enum page_transition::type() const
 }
 
 int page_transition::duration() const
+{
+    return static_cast<int>(d->pt.getDuration());
+}
+
+double page_transition::durationReal() const
 {
     return d->pt.getDuration();
 }
diff --git a/cpp/poppler-page-transition.h b/cpp/poppler-page-transition.h
index d4d6ddf5..68447508 100644
--- a/cpp/poppler-page-transition.h
+++ b/cpp/poppler-page-transition.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2009, Pino Toscano <pino at kde.org>
- * Copyright (C) 2021, Albert Astals Cid <aacid at kde.org>
+ * Copyright (C) 2021, 2022, Albert Astals Cid <aacid at kde.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -64,7 +64,8 @@ public:
     ~page_transition();
 
     type_enum type() const;
-    int duration() const;
+    [[deprecated]] int duration() const;
+    double durationReal() const;
     alignment_enum alignment() const;
     direction_enum direction() const;
     int angle() const;


More information about the poppler mailing list