From 9d70cddccdec2cbcd3d2a240d5f253e8253b7063 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sat, 8 Dec 2012 12:27:33 +0100 Subject: [PATCH 1/2] qt4: Replace use of Q_DECL_DEPRECATED with POPPLER_DECL_DEPRECATED --- qt4/src/CMakeLists.txt | 1 + qt4/src/Makefile.am | 1 + qt4/src/poppler-annotation.h | 3 ++- qt4/src/poppler-deprecation.h | 3 +++ qt4/src/poppler-link.h | 3 ++- qt4/src/poppler-qt4.h | 7 ++++--- 6 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 qt4/src/poppler-deprecation.h diff --git a/qt4/src/CMakeLists.txt b/qt4/src/CMakeLists.txt index b546954..25221b7 100644 --- a/qt4/src/CMakeLists.txt +++ b/qt4/src/CMakeLists.txt @@ -44,6 +44,7 @@ install(FILES poppler-form.h poppler-optcontent.h poppler-export.h + poppler-deprecation.h poppler-page-transition.h poppler-media.h DESTINATION include/poppler/qt4) diff --git a/qt4/src/Makefile.am b/qt4/src/Makefile.am index 7742647..6ecb84d 100644 --- a/qt4/src/Makefile.am +++ b/qt4/src/Makefile.am @@ -15,6 +15,7 @@ poppler_include_HEADERS = \ poppler-form.h \ poppler-optcontent.h \ poppler-export.h \ + poppler-deprecation.h \ poppler-media.h \ poppler-page-transition.h diff --git a/qt4/src/poppler-annotation.h b/qt4/src/poppler-annotation.h index 9208ca7..be0ee48 100644 --- a/qt4/src/poppler-annotation.h +++ b/qt4/src/poppler-annotation.h @@ -38,6 +38,7 @@ #include #include #include "poppler-export.h" +#include "poppler-deprecation.h" namespace Poppler { @@ -245,7 +246,7 @@ class POPPLER_QT4_EXPORT Annotation /// \cond PRIVATE // This field is deprecated and not used any more. Use popup - Q_DECL_DEPRECATED struct { int width, height; } window; // Always set to zero + POPPLER_DECL_DEPRECATED struct { int width, height; } window; // Always set to zero /// \endcond /// \since 0.20 diff --git a/qt4/src/poppler-deprecation.h b/qt4/src/poppler-deprecation.h new file mode 100644 index 0000000..d52e8a6 --- /dev/null +++ b/qt4/src/poppler-deprecation.h @@ -0,0 +1,3 @@ +#ifndef POPPLER_DECL_DEPRECATED +#define POPPLER_DECL_DEPRECATED Q_DECL_DEPRECATED +#endif diff --git a/qt4/src/poppler-link.h b/qt4/src/poppler-link.h index ef93bf0..f6f0851 100644 --- a/qt4/src/poppler-link.h +++ b/qt4/src/poppler-link.h @@ -28,6 +28,7 @@ #include #include #include "poppler-export.h" +#include "poppler-deprecation.h" struct Ref; class MediaRendition; @@ -475,7 +476,7 @@ class POPPLER_QT4_EXPORT LinkRendition : public Link * * \deprecated Use the constructor that takes all parameter instead */ - Q_DECL_DEPRECATED LinkRendition( const QRectF &linkArea, ::MediaRendition *rendition ); + POPPLER_DECL_DEPRECATED LinkRendition( const QRectF &linkArea, ::MediaRendition *rendition ); /** * Create a new rendition link. diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h index f4f6fc6..e9bf34b 100644 --- a/qt4/src/poppler-qt4.h +++ b/qt4/src/poppler-qt4.h @@ -43,6 +43,7 @@ #include #include #include "poppler-export.h" +#include "poppler-deprecation.h" class EmbFile; class Sound; @@ -590,7 +591,7 @@ delete it; \param caseSensitive be case sensitive? \param rotate the rotation to apply for the search order **/ - Q_DECL_DEPRECATED bool search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive, Rotation rotate = Rotate0) const; + POPPLER_DECL_DEPRECATED bool search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive, Rotation rotate = Rotate0) const; /** Returns true if the specified text was found. @@ -1128,7 +1129,7 @@ QString subject = m_doc->info("Subject"); \deprecated use getPdfVersion and avoid float point comparisons/handling */ - Q_DECL_DEPRECATED double pdfVersion() const; + POPPLER_DECL_DEPRECATED double pdfVersion() const; /** The version of the PDF specification that the document @@ -1174,7 +1175,7 @@ QString subject = m_doc->info("Subject"); \see fonts(), newFontIterator() */ - Q_DECL_DEPRECATED bool scanForFonts( int numPages, QList *fontList ) const; + POPPLER_DECL_DEPRECATED bool scanForFonts( int numPages, QList *fontList ) const; /** Creates a new FontIterator object for font scanning. -- 1.7.5.4 From c41efa55eab7641b7f69cdf77b31af20427b84da Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sat, 8 Dec 2012 12:30:07 +0100 Subject: [PATCH 2/2] qt4: Fix warning on deprecated Poppler::Annotation::window The use of Poppler::Annotation::window is deprecated for external use, but its use cannot be avoided internally in the class constructor as long as it is not removed completely. Fixes warning: CXX libpoppler_qt4_la-poppler-annotation.lo ../../../poppler/qt4/src/poppler-annotation.cc: In constructor 'Poppler::Annotation::Annotation(Poppler::AnnotationPrivate&)': ../../../poppler/qt4/src/poppler-annotation.cc:789:18: warning: 'Poppler::Annotation::window' is deprecated (declared at ../../../poppler/qt4/src/poppler-annotation.h:249) [-Wdeprecated-declarations] ../../../poppler/qt4/src/poppler-annotation.cc:791:5: warning: 'Poppler::Annotation::window' is deprecated (declared at ../../../poppler/qt4/src/poppler-annotation.h:249) [-Wdeprecated-declarations] ../../../poppler/qt4/src/poppler-annotation.cc:791:20: warning: 'Poppler::Annotation::window' is deprecated (declared at ../../../poppler/qt4/src/poppler-annotation.h:249) [-Wdeprecated-declarations] ../../../poppler/qt4/src/poppler-annotation.cc: In constructor 'Poppler::Annotation::Annotation(Poppler::AnnotationPrivate&, const QDomNode&)': ../../../poppler/qt4/src/poppler-annotation.cc:799:18: warning: 'Poppler::Annotation::window' is deprecated (declared at ../../../poppler/qt4/src/poppler-annotation.h:249) [-Wdeprecated-declarations] ../../../poppler/qt4/src/poppler-annotation.cc:803:5: warning: 'Poppler::Annotation::window' is deprecated (declared at ../../../poppler/qt4/src/poppler-annotation.h:249) [-Wdeprecated-declarations] ../../../poppler/qt4/src/poppler-annotation.cc:803:20: warning: 'Poppler::Annotation::window' is deprecated (declared at ../../../poppler/qt4/src/poppler-annotation.h:249) [-Wdeprecated-declarations] --- qt4/src/poppler-annotation.cc | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qt4/src/poppler-annotation.cc b/qt4/src/poppler-annotation.cc index 5fd8d93..a893eae 100644 --- a/qt4/src/poppler-annotation.cc +++ b/qt4/src/poppler-annotation.cc @@ -29,7 +29,9 @@ #include // local includes +#define POPPLER_DECL_DEPRECATED #include "poppler-annotation.h" +#undef POPPLER_DECL_DEPRECATED #include "poppler-link.h" #include "poppler-qt4.h" #include "poppler-annotation-helper.h" -- 1.7.5.4