diff --git a/core/document.cpp b/core/document.cpp index 08e4fa32f..441a82001 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -1419,7 +1419,7 @@ void Document::modifyPageAnnotation( int page, Annotation * newannotation ) if ( !d->m_generator || !kp ) return; - kp->modifyAnnotation( newannotation ); + kp->d->modifyAnnotation( newannotation ); // notify observers about the change foreachObserver( notifyPageChanged( page, DocumentObserver::Annotations ) ); } diff --git a/core/page.cpp b/core/page.cpp index 30aa900a4..00b3d68bb 100644 --- a/core/page.cpp +++ b/core/page.cpp @@ -488,12 +488,12 @@ void Page::addAnnotation( Annotation * annotation ) m_rects.append( rect ); } -void Page::modifyAnnotation(Annotation * newannotation ) +void PagePrivate::modifyAnnotation(Annotation * newannotation ) { if(!newannotation) return; - QLinkedList< Annotation * >::iterator aIt = m_annotations.begin(), aEnd = m_annotations.end(); + QLinkedList< Annotation * >::iterator aIt = m_page->m_annotations.begin(), aEnd = m_page->m_annotations.end(); for ( ; aIt != aEnd; ++aIt ) { if((*aIt)==newannotation) @@ -501,7 +501,7 @@ void Page::modifyAnnotation(Annotation * newannotation ) if((*aIt) && (*aIt)->uniqueName()==newannotation->uniqueName()) { int rectfound = false; - QLinkedList< ObjectRect * >::iterator it = m_rects.begin(), end = m_rects.end(); + QLinkedList< ObjectRect * >::iterator it = m_page->m_rects.begin(), end = m_page->m_rects.end(); for ( ; it != end && !rectfound; ++it ) if ( ( (*it)->objectType() == ObjectRect::OAnnotation ) && ( (*it)->object() == (*aIt) ) ) { diff --git a/core/page.h b/core/page.h index 84c544cba..620be7402 100644 --- a/core/page.h +++ b/core/page.h @@ -277,13 +277,6 @@ class OKULAR_EXPORT Page */ void addAnnotation( Annotation * annotation ); - /** - * Modifies an existing annotation by replacing it with a new @p annotation. - * - * The unique name is used to find the old annotation. - */ - void modifyAnnotation( Annotation * annotation ); - /** * Removes the @p annotation from the page. */ @@ -342,6 +335,7 @@ class OKULAR_EXPORT Page private: PagePrivate* const d; friend class PagePrivate; + friend class Document; friend class DocumentPrivate; /** diff --git a/core/page_p.h b/core/page_p.h index 82676e519..846af62da 100644 --- a/core/page_p.h +++ b/core/page_p.h @@ -25,6 +25,7 @@ class QDomNode; namespace Okular { +class Annotation; class FormField; class HighlightAreaRect; class Link; @@ -52,6 +53,13 @@ class PagePrivate */ void saveLocalContents( QDomNode & parentNode, QDomDocument & document ) const; + /** + * Modifies an existing annotation by replacing it with a new @p annotation. + * + * The unique name is used to find the old annotation. + */ + void modifyAnnotation( Annotation * annotation ); + class PixmapObject { public: