summaryrefslogtreecommitdiff
path: root/qt4/src
diff options
context:
space:
mode:
authorFabio D'Urso <fabiodurso@hotmail.it>2012-04-12 20:31:23 +0200
committerAlbert Astals Cid <aacid@kde.org>2012-04-12 20:31:23 +0200
commit9a10d31fca7f060f24bae9efe15662f02a9684ca (patch)
tree8a9a24dd792b62104753ef89e7e146fd536851a4 /qt4/src
parent0531329aeb8783c48f056929e6e81cebda33500f (diff)
qt4: Remove unimplemented revision setters from public API
Diffstat (limited to 'qt4/src')
-rw-r--r--qt4/src/poppler-annotation-private.h2
-rw-r--r--qt4/src/poppler-annotation.cc62
-rw-r--r--qt4/src/poppler-annotation.h13
3 files changed, 16 insertions, 61 deletions
diff --git a/qt4/src/poppler-annotation-private.h b/qt4/src/poppler-annotation-private.h
index ea4a88cf..2ee7d771 100644
--- a/qt4/src/poppler-annotation-private.h
+++ b/qt4/src/poppler-annotation-private.h
@@ -44,6 +44,8 @@ class AnnotationPrivate : public QSharedData
AnnotationPrivate();
virtual ~AnnotationPrivate();
+ void addRevision(Annotation *ann, Annotation::RevScope scope, Annotation::RevType type);
+
/* Returns an Annotation of the right subclass whose d_ptr points to
* this AnnotationPrivate */
virtual Annotation * makeAlias() = 0;
diff --git a/qt4/src/poppler-annotation.cc b/qt4/src/poppler-annotation.cc
index 37b78299..4d7cd847 100644
--- a/qt4/src/poppler-annotation.cc
+++ b/qt4/src/poppler-annotation.cc
@@ -126,6 +126,16 @@ AnnotationPrivate::AnnotationPrivate()
{
}
+void AnnotationPrivate::addRevision( Annotation *ann, Annotation::RevScope scope, Annotation::RevType type )
+{
+ /* Since ownership stays with the caller, create an alias of ann */
+ revisions.append( ann->d_ptr->makeAlias() );
+
+ /* Set revision properties */
+ revisionScope = scope;
+ revisionType = type;
+}
+
AnnotationPrivate::~AnnotationPrivate()
{
// Delete all children revisions
@@ -173,8 +183,7 @@ void AnnotationPrivate::flushBaseAnnotationProperties()
// Flush revisions
foreach (Annotation *r, revisions)
{
- // addRevision creates a native Annot because pdfAnnot is set
- q->addRevision(r, r->d_ptr->revisionScope, r->d_ptr->revisionType);
+ // TODO: Flush revision
delete r; // Object is no longer needed
}
@@ -748,6 +757,8 @@ Annotation::~Annotation()
Annotation::Annotation( AnnotationPrivate &dd, const QDomNode &annNode )
: d_ptr( &dd )
{
+ Q_D( Annotation );
+
window.width = window.height = 0;
// get the [base] element of the annotation node
@@ -884,7 +895,7 @@ Annotation::Annotation( AnnotationPrivate &dd, const QDomNode &annNode )
{
RevScope scope = (RevScope)revElement.attribute( "revScope" ).toInt();
RevType type = (RevType)revElement.attribute( "revType" ).toInt();
- addRevision(reply, scope, type);
+ d->addRevision(reply, scope, type);
delete reply;
}
}
@@ -1443,19 +1454,6 @@ Annotation::RevScope Annotation::revisionScope() const
return Annotation::Root; // It's not a revision
}
-void Annotation::setRevisionScope( Annotation::RevScope scope )
-{
- Q_D( Annotation );
-
- if (!d->pdfAnnot)
- {
- d->revisionScope = scope;
- return;
- }
-
- // TODO: Set pdfAnnot
-}
-
Annotation::RevType Annotation::revisionType() const
{
Q_D( const Annotation );
@@ -1489,19 +1487,6 @@ Annotation::RevType Annotation::revisionType() const
return Annotation::None;
}
-void Annotation::setRevisionType( Annotation::RevType type )
-{
- Q_D( Annotation );
-
- if (!d->pdfAnnot)
- {
- d->revisionType = type;
- return;
- }
-
- // TODO: Set pdfAnnot
-}
-
QList<Annotation*> Annotation::revisions() const
{
Q_D( const Annotation );
@@ -1518,25 +1503,6 @@ QList<Annotation*> Annotation::revisions() const
return AnnotationPrivate::findAnnotations( d->pdfPage, d->parentDoc, d->pdfAnnot->getId() );
}
-void Annotation::addRevision( Annotation *ann, RevScope scope, RevType type )
-{
- Q_D( Annotation );
-
- if (!d->pdfAnnot)
- {
- /* Since ownership stays with the caller, create an alias of ann */
- d->revisions.append( ann->d_ptr->makeAlias() );
- }
- else
- {
- // TODO: Add annotation to page and set IRT
- }
-
- /* Set revision properties */
- ann->setRevisionScope(scope);
- ann->setRevisionType(type);
-}
-
//END Annotation implementation
diff --git a/qt4/src/poppler-annotation.h b/qt4/src/poppler-annotation.h
index e0e98ee9..b8976037 100644
--- a/qt4/src/poppler-annotation.h
+++ b/qt4/src/poppler-annotation.h
@@ -279,19 +279,6 @@ class POPPLER_QT4_EXPORT Annotation
void storeBaseAnnotationProperties( QDomNode & parentNode, QDomDocument & document ) const;
Q_DECLARE_PRIVATE( Annotation )
QExplicitlySharedDataPointer<AnnotationPrivate> d_ptr;
-
- //BEGIN: To be made public when revision write support is implemented
- void setRevisionType( RevType type );
- void setRevisionScope( RevScope scope );
- /**
- * Adds a revision to this annotation. Scope and type are assigned to the
- * newly added annotation.
- *
- * \note Ownership of the annotation object stays with the caller, who can
- * delete it at any time.
- */
- void addRevision( Annotation *ann, RevScope scope = Reply, RevType type = None );
- //END
/// \endcond
private: