TextAnnotation stamp: fix icon name mismatch in DOM methods with poppler 0.20.1

Fixes the situation where Poppler thinks "Note" and omits the icon
attribute, Okular sees nothing and defaults to "Comment".
remotes/origin/KDE/4.9
Fabio D'Urso 14 years ago
parent 07495549bb
commit 42c4e4c5db
  1. 17
      generators/poppler/annots.cpp

@ -382,15 +382,26 @@ Okular::Annotation* createAnnotationFromPopplerAnnotation( Poppler::Annotation *
}
}
#ifndef HAVE_POPPLER_0_20
// Poppler <0.20 returns the inplaceText in contents
if ( annotation->subType() == Okular::Annotation::AText )
{
Okular::TextAnnotation * txtann = static_cast<Okular::TextAnnotation*>( annotation );
if ( txtann->textType() == Okular::TextAnnotation::InPlace )
{
#ifndef HAVE_POPPLER_0_20
// Poppler before 0.20 returns the inplaceText in contents
txtann->setInplaceText( txtann->contents() );
}
#endif
}
else if ( txtann->textType() == Okular::TextAnnotation::Linked )
{
Poppler::TextAnnotation * ppl_txtann = static_cast<Poppler::TextAnnotation*>( ann );
// Poppler and Okular assume a different default icon name in XML
// We re-read it via getter, which always tells the right one
txtann->setTextIcon( ppl_txtann->textIcon() );
}
}
// TODO clone style
// TODO clone window

Loading…
Cancel
Save