give the right parent page to the annotations also when restoring them from xml

svn path=/trunk/KDE/kdegraphics/okular/; revision=689162
remotes/origin/KDE/4.0
Pino Toscano 19 years ago
parent 0e7aeb2ba8
commit ba765a3b69
  1. 2
      core/annotations.h
  2. 1
      core/page.cpp

@ -28,6 +28,7 @@ class AnnotationObjectRect;
class AnnotationPrivate; class AnnotationPrivate;
class Document; class Document;
class Page; class Page;
class PagePrivate;
class TextAnnotationPrivate; class TextAnnotationPrivate;
class LineAnnotationPrivate; class LineAnnotationPrivate;
class GeomAnnotationPrivate; class GeomAnnotationPrivate;
@ -84,6 +85,7 @@ class OKULAR_EXPORT Annotation
friend class AnnotationObjectRect; friend class AnnotationObjectRect;
friend class Document; friend class Document;
friend class Page; friend class Page;
friend class PagePrivate;
public: public:
/** /**

@ -677,6 +677,7 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode )
// append annotation to the list or show warning // append annotation to the list or show warning
if ( annotation ) if ( annotation )
{ {
annotation->d_ptr->m_page = this;
m_page->m_annotations.append( annotation ); m_page->m_annotations.append( annotation );
m_page->m_rects.append( new AnnotationObjectRect( annotation ) ); m_page->m_rects.append( new AnnotationObjectRect( annotation ) );
int pos = annotation->uniqueName().lastIndexOf("-"); int pos = annotation->uniqueName().lastIndexOf("-");

Loading…
Cancel
Save