[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [okular/frameworks] generators/poppler: Assume Poppler 0.22 or newer (0.22 was the first one with qt
From: Fabio D'Urso <fabiodurso () hotmail ! it>
Date: 2014-08-24 19:56:24
Message-ID: E1XLdto-0002VS-NW () scm ! kde ! org
[Download RAW message or body]
Git commit 0b662faf35ffe021405a1f73098e3cd76cd10b75 by Fabio D'Urso.
Committed on 24/08/2014 at 19:47.
Pushed by fabiod into branch 'frameworks'.
Assume Poppler 0.22 or newer (0.22 was the first one with qt5 support)
M +0 -22 generators/poppler/annots.cpp
M +0 -6 generators/poppler/formfields.cpp
http://commits.kde.org/okular/0b662faf35ffe021405a1f73098e3cd76cd10b75
diff --git a/generators/poppler/annots.cpp b/generators/poppler/annots.cpp
index 3c3e3ec..782bb29 100644
--- a/generators/poppler/annots.cpp
+++ b/generators/poppler/annots.cpp
@@ -25,9 +25,7 @@ Q_DECLARE_METATYPE( Poppler::Annotation* )
extern Okular::Sound* createSoundFromPopplerSound( const Poppler::SoundObject *popplerSound );
extern Okular::Movie* createMovieFromPopplerMovie( const Poppler::MovieObject *popplerMovie );
-#ifdef HAVE_POPPLER_0_20
extern Okular::Movie* createMovieFromPopplerScreen( const Poppler::LinkRendition *popplerScreen );
-#endif
static void disposeAnnotation( const Okular::Annotation *ann )
@@ -72,12 +70,10 @@ bool PopplerAnnotationProxy::supports( Capability cap ) const
{
switch ( cap )
{
-#ifdef HAVE_POPPLER_0_20
case Addition:
case Modification:
case Removal:
return true;
-#endif
default:
return false;
}
@@ -85,7 +81,6 @@ bool PopplerAnnotationProxy::supports( Capability cap ) const
void PopplerAnnotationProxy::notifyAddition( Okular::Annotation *okl_ann, int page )
{
-#ifdef HAVE_POPPLER_0_20
// Export annotation to DOM
QDomDocument doc;
QDomElement dom_ann = doc.createElement( "root" );
@@ -130,12 +125,10 @@ void PopplerAnnotationProxy::notifyAddition( Okular::Annotation *okl_ann, int pa
okl_ann->setDisposeDataFunction( disposeAnnotation );
kDebug(PDFGenerator::PDFDebug) << okl_ann->uniqueName();
-#endif
}
void PopplerAnnotationProxy::notifyModification( const Okular::Annotation *okl_ann, int page, bool \
appearanceChanged ) {
-#ifdef HAVE_POPPLER_0_20
Q_UNUSED( page );
Q_UNUSED( appearanceChanged );
@@ -244,12 +237,10 @@ void PopplerAnnotationProxy::notifyModification( const Okular::Annotation *okl_a
}
kDebug(PDFGenerator::PDFDebug) << okl_ann->uniqueName();
-#endif
}
void PopplerAnnotationProxy::notifyRemoval( Okular::Annotation *okl_ann, int page )
{
-#ifdef HAVE_POPPLER_0_20
Poppler::Annotation *ppl_ann = qvariant_cast<Poppler::Annotation*>( okl_ann->nativeId() );
if ( !ppl_ann ) // Ignore non-native annotations
@@ -264,7 +255,6 @@ void PopplerAnnotationProxy::notifyRemoval( Okular::Annotation *okl_ann, int pag
okl_ann->setNativeId( qVariantFromValue(0) ); // So that we don't double-free in disposeAnnotation
kDebug(PDFGenerator::PDFDebug) << okl_ann->uniqueName();
-#endif
}
//END PopplerAnnotationProxy implementation
@@ -312,28 +302,17 @@ Okular::Annotation* createAnnotationFromPopplerAnnotation( Poppler::Annotation *
break;
}
-#ifdef HAVE_POPPLER_0_22
case Poppler::Annotation::AWidget:
{
annotation = new Okular::WidgetAnnotation();
break;
}
-#endif
-#ifdef HAVE_POPPLER_0_20
case Poppler::Annotation::AScreen:
{
-#ifdef HAVE_POPPLER_0_22
Okular::ScreenAnnotation * m = new Okular::ScreenAnnotation();
annotation = m;
tieToOkularAnn = true;
*doDelete = false;
-#else
- Poppler::ScreenAnnotation * screenann = static_cast< Poppler::ScreenAnnotation * >( ann );
- Okular::MovieAnnotation * m = new Okular::MovieAnnotation();
- annotation = m;
-
- m->setMovie( createMovieFromPopplerScreen( screenann->action() ) );
-#endif
break;
}
case Poppler::Annotation::AText:
@@ -351,7 +330,6 @@ Okular::Annotation* createAnnotationFromPopplerAnnotation( Poppler::Annotation *
*doDelete = false;
/* fallback */
}
-#endif
default:
{
// this is uber ugly but i don't know a better way to do it without introducing a \
poppler::annotation dependency on core
diff --git a/generators/poppler/formfields.cpp b/generators/poppler/formfields.cpp
index fd1de5e..f57f230 100644
--- a/generators/poppler/formfields.cpp
+++ b/generators/poppler/formfields.cpp
@@ -279,18 +279,12 @@ void PopplerFormFieldChoice::setCurrentChoices( const QList<int>& choices )
QString PopplerFormFieldChoice::editChoice() const
{
-#ifdef HAVE_POPPLER_0_22
return m_field->editChoice();
-#else
- return QString();
-#endif
}
void PopplerFormFieldChoice::setEditChoice( const QString& text )
{
-#ifdef HAVE_POPPLER_0_22
m_field->setEditChoice( text );
-#endif
}
Qt::Alignment PopplerFormFieldChoice::textAlignment() const
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic