very small fixes about annotations

svn path=/trunk/playground/graphics/okular/; revision=582276
This commit is contained in:
Pino Toscano 2006-09-08 21:08:51 +00:00
parent 4c923f00ac
commit b66b54a9c9
3 changed files with 9 additions and 7 deletions

View file

@ -310,14 +310,16 @@ void Annotation::store( QDomNode & annNode, QDomDocument & document ) const
/** TextAnnotation [Annotation] */
/*
The default textIcon for text annotation is Note as the PDF Reference says
*/
TextAnnotation::TextAnnotation()
: Annotation(), textType( Linked ), textIcon( "Comment" ),
: Annotation(), textType( Linked ), textIcon( "Note" ),
inplaceAlign( 0 ), inplaceIntent( Unknown )
{}
TextAnnotation::TextAnnotation( const QDomNode & node )
: Annotation( node ), textType( Linked ), textIcon( "Comment" ),
: Annotation( node ), textType( Linked ), textIcon( "Note" ),
inplaceAlign( 0 ), inplaceIntent( Unknown )
{
// loop through the whole children looking for a 'text' element

View file

@ -456,10 +456,11 @@ void PagePainter::paintPageOnPainter( QPainter * destPainter, const KPDFPage * p
painter.begin( &pixmap );
painter.setPen( Qt::black );//( NoPen );
//painter.setBrush( bule);
painter.drawRect( 0, 0, sz.width()-2, sz.height()-2 );
painter.drawRect( 0, 0, sz.width()-1, sz.height()-1 );
//painter.drawText(2,sz.height()/2+int(rcf.height()/2),text->inplaceText);
Qt::AlignmentFlag halign = ( text->inplaceAlign == 1 ? Qt::AlignHCenter : ( text->inplaceAlign == 2 ? Qt::AlignRight : Qt::AlignLeft ) );
painter.drawText(0,0,sz.width(),sz.height(),
Qt::AlignVCenter|Qt::AlignLeft|Qt::TextWrapAnywhere,
Qt::AlignTop|halign|Qt::TextWrapAnywhere,
text->inplaceText);
painter.end();
QImage scaledImage;

View file

@ -320,7 +320,6 @@ class PickPointEngine : public AnnotatorEngine
ta->textType = TextAnnotation::Linked;
ta->window.text="";
//ta->window.flags &= ~(Annotation::Hidden);
ta->textIcon="comment";
double iconhei=0.03;
rect.left = point.x;
rect.top = point.y;
@ -346,7 +345,6 @@ class PickPointEngine : public AnnotatorEngine
annElement.attribute( "color" ) : m_engineColor;
if ( annElement.hasAttribute( "opacity" ) )
ann->style.opacity = annElement.attribute( "opacity" ).toDouble();
ann->creationDate=ann->modifyDate=QDateTime::currentDateTime();
// return annotation
return ann;
@ -637,6 +635,7 @@ if ( !item ) return; //STRAPAAAATCH !!! FIXME
// attach the newly filled annotation to the page
if ( annotation )
{
annotation->creationDate = annotation->modifyDate = QDateTime::currentDateTime();
annotation->author = KpdfSettings::annotationsAuthor();
m_document->addPageAnnotation( m_lockedItem->pageNumber(), annotation );
}