diff --git a/core/document.cpp b/core/document.cpp index 236959c1e..4e24abc3a 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -1967,7 +1967,7 @@ void Document::setPageTextSelection( int page, RegularAreaRect * rect, const QCo if ( rect ) kp->d->setTextSelections( rect, color ); else - kp->deleteTextSelections(); + kp->d->deleteTextSelections(); // notify observers about the change foreachObserver( notifyPageChanged( page, DocumentObserver::TextSelection ) ); diff --git a/core/page.cpp b/core/page.cpp index 82e4b46a6..330e12b1e 100644 --- a/core/page.cpp +++ b/core/page.cpp @@ -130,7 +130,7 @@ Page::~Page() deleteRects(); d->deleteHighlights(); deleteAnnotations(); - deleteTextSelections(); + d->deleteTextSelections(); deleteSourceReferences(); delete d; @@ -274,7 +274,7 @@ void PagePrivate::rotateAt( Rotation orientation ) return; deleteHighlights(); - m_page->deleteTextSelections(); + deleteTextSelections(); if ( ( (int)m_orientation + (int)m_rotation ) % 2 != ( (int)m_orientation + (int)orientation ) % 2 ) qSwap( m_width, m_height ); @@ -432,7 +432,7 @@ void PagePrivate::setHighlight( int s_id, RegularAreaRect *rect, const QColor & void PagePrivate::setTextSelections( RegularAreaRect *r, const QColor & color ) { - m_page->deleteTextSelections(); + deleteTextSelections(); if ( r ) { HighlightAreaRect * hr = new HighlightAreaRect( r ); @@ -637,10 +637,10 @@ void PagePrivate::deleteHighlights( int s_id ) } } -void Page::deleteTextSelections() +void PagePrivate::deleteTextSelections() { - delete d->m_textSelections; - d->m_textSelections = 0; + delete m_textSelections; + m_textSelections = 0; } void Page::deleteSourceReferences() diff --git a/core/page.h b/core/page.h index 07a5d61b2..a8761831b 100644 --- a/core/page.h +++ b/core/page.h @@ -288,11 +288,6 @@ class OKULAR_EXPORT Page */ void deleteRects(); - /** - * Deletes all text selection objects of the page. - */ - void deleteTextSelections(); - /** * Deletes all source reference objects of the page. */ diff --git a/core/page_p.h b/core/page_p.h index b4a1ec1d7..59765cc3a 100644 --- a/core/page_p.h +++ b/core/page_p.h @@ -91,6 +91,11 @@ class PagePrivate */ void deleteHighlights( int id = -1 ); + /** + * Deletes all text selection objects of the page. + */ + void deleteTextSelections(); + class PixmapObject { public: