Dead code removed (PagePrivate::modifyAnnotation)

The first if ("modified already") is always taken
remotes/origin/KDE/4.9
Fabio D'Urso 14 years ago committed by Albert Astals Cid
parent f6781637c0
commit 07c57bb2ab
  1. 1
      core/document.cpp
  2. 28
      core/page.cpp
  3. 7
      core/page_p.h

@ -2356,7 +2356,6 @@ void Document::modifyPageAnnotation( int page, Annotation * newannotation )
if ( !d->m_generator || !kp )
return;
kp->d->modifyAnnotation( newannotation );
// notify observers about the change
foreachObserver( notifyPageChanged( page, DocumentObserver::Annotations ) );
}

@ -596,34 +596,6 @@ void Page::addAnnotation( Annotation * annotation )
m_rects.append( rect );
}
void PagePrivate::modifyAnnotation(Annotation * newannotation )
{
if(!newannotation)
return;
QLinkedList< Annotation * >::iterator aIt = m_page->m_annotations.begin(), aEnd = m_page->m_annotations.end();
for ( ; aIt != aEnd; ++aIt )
{
if((*aIt)==newannotation)
return; //modified already
if((*aIt) && (*aIt)->uniqueName()==newannotation->uniqueName())
{
int rectfound = false;
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) ) )
{
delete *it;
*it = new AnnotationObjectRect( newannotation );
rectfound = true;
}
delete *aIt;
*aIt = newannotation;
break;
}
}
}
bool Page::removeAnnotation( Annotation * annotation )
{
if ( !annotation || ( annotation->flags() & Annotation::DenyDelete ) )

@ -66,13 +66,6 @@ class PagePrivate
*/
void saveLocalContents( QDomNode & parentNode, QDomDocument & document, PageItems what = AllPageItems ) 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 );
/**
* Rotates the image and object rects of the page to the given @p orientation.
*/

Loading…
Cancel
Save