[poppler] poppler/PageTransition.cc poppler/PageTransition.h qt4/src qt5/src

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Sep 20 09:35:43 PDT 2015


 poppler/PageTransition.cc          |    5 +++--
 poppler/PageTransition.h           |    5 +++--
 qt4/src/poppler-page-transition.cc |    6 ++++++
 qt4/src/poppler-page-transition.h  |   14 ++++++++++++--
 qt5/src/poppler-page-transition.cc |    6 ++++++
 qt5/src/poppler-page-transition.h  |   14 ++++++++++++--
 6 files changed, 42 insertions(+), 8 deletions(-)

New commits:
commit 7028f835a603e12dd73452a39f56ac0b633207b2
Author: Arseniy Lartsev <arseniy at alumni.chalmers.se>
Date:   Sun Sep 20 18:32:36 2015 +0200

    PageTransition D is a number not an int
    
    See bug #92040

diff --git a/poppler/PageTransition.cc b/poppler/PageTransition.cc
index 441634c..d5a84f8 100644
--- a/poppler/PageTransition.cc
+++ b/poppler/PageTransition.cc
@@ -2,6 +2,7 @@
  * Copyright (C) 2005, Net Integration Technologies, Inc.
  * Copyright (C) 2010, Albert Astals Cid <aacid at kde.org>
  * Copyright (C) 2013 Adrian Johnson <ajohnson at redneon.com>
+ * Copyright (C) 2015, Arseniy Lartsev <arseniy at alumni.chalmers.se>
  *
  * 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
@@ -80,8 +81,8 @@ PageTransition::PageTransition (Object *trans) {
   obj.free();
 
   // get duration
-  if (dict->lookup("D", &obj)->isInt()) {
-    duration = obj.getInt();
+  if (dict->lookup("D", &obj)->isNum()) {
+    duration = obj.getNum();
   }
   obj.free();
 
diff --git a/poppler/PageTransition.h b/poppler/PageTransition.h
index e892c6c..82f080f 100644
--- a/poppler/PageTransition.h
+++ b/poppler/PageTransition.h
@@ -1,5 +1,6 @@
 /* PageTransition.cc
  * Copyright (C) 2005, Net Integration Technologies, Inc.
+ * Copyright (C) 2015, Arseniy Lartsev <arseniy at alumni.chalmers.se>
  *
  * 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
@@ -72,7 +73,7 @@ public:
   PageTransitionType getType() { return type; }
 
   // Get duration
-  int getDuration() { return duration;}
+  double getDuration() { return duration; }
 
   // Get alignment
   PageTransitionAlignment getAlignment() { return alignment; }
@@ -92,7 +93,7 @@ public:
 private:
   
   PageTransitionType type;           // transition style
-  int duration;                      // duration of the effect in seconds
+  double duration;                   // duration of the effect in seconds
   PageTransitionAlignment alignment; // dimension of the effect
   PageTransitionDirection direction; // direction of motion
   int angle;                         // direction in degrees
diff --git a/qt4/src/poppler-page-transition.cc b/qt4/src/poppler-page-transition.cc
index cde8818..4fa39ed 100644
--- a/qt4/src/poppler-page-transition.cc
+++ b/qt4/src/poppler-page-transition.cc
@@ -1,5 +1,6 @@
 /* PageTransition.cc
  * Copyright (C) 2005, Net Integration Technologies, Inc.
+ * Copyright (C) 2015, Arseniy Lartsev <arseniy at alumni.chalmers.se>
  *
  * 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
@@ -68,6 +69,11 @@ int PageTransition::duration() const
   return data->pt->getDuration();
 }
 
+double PageTransition::durationReal() const
+{
+  return data->pt->getDuration();
+}
+
 PageTransition::Alignment PageTransition::alignment() const
 {
   return (Poppler::PageTransition::Alignment)data->pt->getAlignment();
diff --git a/qt4/src/poppler-page-transition.h b/qt4/src/poppler-page-transition.h
index e7f39e2..e92adbd 100644
--- a/qt4/src/poppler-page-transition.h
+++ b/qt4/src/poppler-page-transition.h
@@ -1,6 +1,7 @@
 /* PageTransition.h
  * Copyright (C) 2005, Net Integration Technologies, Inc.
  * Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
+ * Copyright (C) 2015, Arseniy Lartsev <arseniy at alumni.chalmers.se>
  *
  * 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
@@ -22,6 +23,8 @@
 
 #include "poppler-export.h"
 
+#include <QtCore/qglobal.h>
+
 namespace Poppler {
 
 class PageTransitionParams;
@@ -109,9 +112,16 @@ class POPPLER_QT4_EXPORT PageTransition {
   Type type() const;
   
   /**
-     \brief Get duration of the transition in seconds.
+     \brief Get duration of the transition in seconds as integer
+
+     \deprecated This function is left for backward compatibility, use durationReal() instead.
+  */
+  Q_DECL_DEPRECATED int duration() const;
+
+  /**
+     \brief Get duration of the transition in seconds
   */
-  int duration() const;
+  double durationReal() const;
   
   /**
      \brief Get dimension in which the transition effect occurs.
diff --git a/qt5/src/poppler-page-transition.cc b/qt5/src/poppler-page-transition.cc
index cde8818..4fa39ed 100644
--- a/qt5/src/poppler-page-transition.cc
+++ b/qt5/src/poppler-page-transition.cc
@@ -1,5 +1,6 @@
 /* PageTransition.cc
  * Copyright (C) 2005, Net Integration Technologies, Inc.
+ * Copyright (C) 2015, Arseniy Lartsev <arseniy at alumni.chalmers.se>
  *
  * 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
@@ -68,6 +69,11 @@ int PageTransition::duration() const
   return data->pt->getDuration();
 }
 
+double PageTransition::durationReal() const
+{
+  return data->pt->getDuration();
+}
+
 PageTransition::Alignment PageTransition::alignment() const
 {
   return (Poppler::PageTransition::Alignment)data->pt->getAlignment();
diff --git a/qt5/src/poppler-page-transition.h b/qt5/src/poppler-page-transition.h
index 2d408a5..57a2388 100644
--- a/qt5/src/poppler-page-transition.h
+++ b/qt5/src/poppler-page-transition.h
@@ -1,6 +1,7 @@
 /* PageTransition.h
  * Copyright (C) 2005, Net Integration Technologies, Inc.
  * Copyright (C) 2005, Brad Hards <bradh at frogmouth.net>
+ * Copyright (C) 2015, Arseniy Lartsev <arseniy at alumni.chalmers.se>
  *
  * 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
@@ -22,6 +23,8 @@
 
 #include "poppler-export.h"
 
+#include <QtCore/qglobal.h>
+
 namespace Poppler {
 
 class PageTransitionParams;
@@ -109,9 +112,16 @@ class POPPLER_QT5_EXPORT PageTransition {
   Type type() const;
   
   /**
-     \brief Get duration of the transition in seconds.
+     \brief Get duration of the transition in seconds as integer
+
+     \deprecated This function is left for backward compatibility, use durationReal() instead.
+  */
+  Q_DECL_DEPRECATED int duration() const;
+
+  /**
+     \brief Get duration of the transition in seconds
   */
-  int duration() const;
+  double durationReal() const;
   
   /**
      \brief Get dimension in which the transition effect occurs.


More information about the poppler mailing list