Minor tweaks

This commit is contained in:
Albert Astals Cid 2013-04-06 00:28:39 +02:00
parent 78faf1e68f
commit d0fd156dc9
5 changed files with 51 additions and 46 deletions

View file

@ -752,7 +752,7 @@ void Annotation::store( QDomNode & annNode, QDomDocument & document ) const
}
}
QDomNode Annotation::getAnnotationPropertiesDomNode()
QDomNode Annotation::getAnnotationPropertiesDomNode() const
{
QDomDocument doc( "documentInfo" );
QDomElement node = doc.createElement( "annotation" );

View file

@ -660,11 +660,15 @@ class OKULAR_EXPORT Annotation
/**
* Retrieve the QDomNode representing this annotation's properties
* @since 0.17 (KDE 4.11)
*/
QDomNode getAnnotationPropertiesDomNode();
QDomNode getAnnotationPropertiesDomNode() const;
/**
* Sets annotations internal properties according to the contents of @p node
*
* @since 0.17 (KDE 4.11)
*/
void setAnnotationProperties( const QDomNode & node );

View file

@ -2045,7 +2045,8 @@ RemoveAnnotationCommand::RemoveAnnotationCommand(Okular::DocumentPrivate * doc,
setText( i18nc( "Remove an annotation from the page", "remove annotation" ) );
}
RemoveAnnotationCommand::~RemoveAnnotationCommand(){
RemoveAnnotationCommand::~RemoveAnnotationCommand()
{
if ( m_done )
{
delete m_annotation;
@ -3196,10 +3197,10 @@ bool Document::canModifyPageAnnotation( const Annotation * annotation ) const
void Document::prepareToModifyAnnotationProperties( Annotation * annotation )
{
Q_ASSERT(d->m_prevPropsOfAnnotBeingModified.isNull());
if (!d->m_prevPropsOfAnnotBeingModified.isNull())
{
kError(OkularDebug) << "Error: Document::prepareToModifyAnnotationProperties has already been called since last call to Document::modifyPageAnnotationProperties";
Q_ASSERT(d->m_prevPropsOfAnnotBeingModified.isNull());
return;
}
d->m_prevPropsOfAnnotBeingModified = annotation->getAnnotationPropertiesDomNode();
@ -3207,10 +3208,10 @@ void Document::prepareToModifyAnnotationProperties( Annotation * annotation )
void Document::modifyPageAnnotationProperties( int page, Annotation * annotation )
{
Q_ASSERT(!d->m_prevPropsOfAnnotBeingModified.isNull());
if (d->m_prevPropsOfAnnotBeingModified.isNull())
{
kError(OkularDebug) << "Error: Document::prepareToModifyAnnotationProperties must be called before Annotation is modified";
Q_ASSERT(!d->m_prevPropsOfAnnotBeingModified.isNull());
return;
}
QDomNode prevProps = d->m_prevPropsOfAnnotBeingModified;

View file

@ -20,7 +20,6 @@
#include <QtCore/QStringList>
#include <QtCore/QVector>
#include <QtGui/QPrinter>
#include <QUndoCommand>
#include <QtXml/QDomDocument>
#include <kmimetype.h>

View file

@ -19,6 +19,7 @@
#include <QtCore/QMap>
#include <QtCore/QMutex>
#include <QtCore/QPointer>
#include <QtGui/QUndoCommand>
#include <kcomponentdata.h>
#include <kservicetypetrader.h>