Changeset View
Changeset View
Standalone View
Standalone View
core/page.cpp
Show First 20 Lines • Show All 495 Lines • ▼ Show 20 Line(s) | |||||
496 | 496 | | |||
497 | QLinkedList< Annotation* > Page::annotations() const | 497 | QLinkedList< Annotation* > Page::annotations() const | ||
498 | { | 498 | { | ||
499 | return m_annotations; | 499 | return m_annotations; | ||
500 | } | 500 | } | ||
501 | 501 | | |||
502 | Annotation * Page::annotation( const QString & uniqueName ) const | 502 | Annotation * Page::annotation( const QString & uniqueName ) const | ||
503 | { | 503 | { | ||
504 | foreach(Annotation *a, m_annotations) | 504 | for (Annotation *a : m_annotations) | ||
aacid: we don't need qAsConst here, do we? | |||||
505 | { | 505 | { | ||
506 | if ( a->uniqueName() == uniqueName ) | 506 | if ( a->uniqueName() == uniqueName ) | ||
507 | return a; | 507 | return a; | ||
508 | } | 508 | } | ||
509 | return nullptr; | 509 | return nullptr; | ||
510 | } | 510 | } | ||
511 | 511 | | |||
512 | const Action * Page::pageAction( PageAction action ) const | 512 | const Action * Page::pageAction( PageAction action ) const | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 618 | { | |||
622 | m_textSelections = hr; | 622 | m_textSelections = hr; | ||
623 | delete r; | 623 | delete r; | ||
624 | } | 624 | } | ||
625 | } | 625 | } | ||
626 | 626 | | |||
627 | void Page::setSourceReferences( const QLinkedList< SourceRefObjectRect * > & refRects ) | 627 | void Page::setSourceReferences( const QLinkedList< SourceRefObjectRect * > & refRects ) | ||
628 | { | 628 | { | ||
629 | deleteSourceReferences(); | 629 | deleteSourceReferences(); | ||
630 | foreach( SourceRefObjectRect * rect, refRects ) | 630 | for ( SourceRefObjectRect *rect : refRects ) { | ||
631 | m_rects << rect; | 631 | m_rects << rect; | ||
632 | } | 632 | } | ||
633 | } | ||||
633 | 634 | | |||
634 | void Page::setDuration( double seconds ) | 635 | void Page::setDuration( double seconds ) | ||
635 | { | 636 | { | ||
636 | d->m_duration = seconds; | 637 | d->m_duration = seconds; | ||
637 | } | 638 | } | ||
638 | 639 | | |||
639 | double Page::duration() const | 640 | double Page::duration() const | ||
640 | { | 641 | { | ||
▲ Show 20 Lines • Show All 450 Lines • ▼ Show 20 Line(s) | 1075 | { | |||
1091 | restoredLocalAnnotationList = oldPage->restoredLocalAnnotationList; | 1092 | restoredLocalAnnotationList = oldPage->restoredLocalAnnotationList; | ||
1092 | restoredFormFieldList = oldPage->restoredFormFieldList; | 1093 | restoredFormFieldList = oldPage->restoredFormFieldList; | ||
1093 | } | 1094 | } | ||
1094 | 1095 | | |||
1095 | FormField *PagePrivate::findEquivalentForm( const Page *p, FormField *oldField ) | 1096 | FormField *PagePrivate::findEquivalentForm( const Page *p, FormField *oldField ) | ||
1096 | { | 1097 | { | ||
1097 | // given how id is not very good of id (at least for pdf) we do a few passes | 1098 | // given how id is not very good of id (at least for pdf) we do a few passes | ||
1098 | // same rect, type and id | 1099 | // same rect, type and id | ||
1099 | foreach(FormField *f, p->d->formfields) | 1100 | for (FormField *f : qAsConst(p->d->formfields)) | ||
1100 | { | 1101 | { | ||
1101 | if (f->rect() == oldField->rect() && f->type() == oldField->type() && f->id() == oldField->id()) | 1102 | if (f->rect() == oldField->rect() && f->type() == oldField->type() && f->id() == oldField->id()) | ||
1102 | return f; | 1103 | return f; | ||
1103 | } | 1104 | } | ||
1104 | // same rect and type | 1105 | // same rect and type | ||
1105 | foreach(FormField *f, p->d->formfields) | 1106 | for (FormField *f : qAsConst(p->d->formfields)) | ||
1106 | { | 1107 | { | ||
1107 | if (f->rect() == oldField->rect() && f->type() == oldField->type()) | 1108 | if (f->rect() == oldField->rect() && f->type() == oldField->type()) | ||
1108 | return f; | 1109 | return f; | ||
1109 | } | 1110 | } | ||
1110 | // fuzzy rect, same type and id | 1111 | // fuzzy rect, same type and id | ||
1111 | foreach(FormField *f, p->d->formfields) | 1112 | for (FormField *f : qAsConst(p->d->formfields)) | ||
1112 | { | 1113 | { | ||
1113 | if (f->type() == oldField->type() && f->id() == oldField->id() && qFuzzyCompare(f->rect().left, oldField->rect().left) && qFuzzyCompare(f->rect().top, oldField->rect().top) && qFuzzyCompare(f->rect().right, oldField->rect().right) && qFuzzyCompare(f->rect().bottom, oldField->rect().bottom)) | 1114 | if (f->type() == oldField->type() && f->id() == oldField->id() && qFuzzyCompare(f->rect().left, oldField->rect().left) && qFuzzyCompare(f->rect().top, oldField->rect().top) && qFuzzyCompare(f->rect().right, oldField->rect().right) && qFuzzyCompare(f->rect().bottom, oldField->rect().bottom)) | ||
1114 | { | 1115 | { | ||
1115 | return f; | 1116 | return f; | ||
1116 | } | 1117 | } | ||
1117 | } | 1118 | } | ||
1118 | // fuzzy rect and same type | 1119 | // fuzzy rect and same type | ||
1119 | foreach(FormField *f, p->d->formfields) | 1120 | for (FormField *f : qAsConst(p->d->formfields)) | ||
1120 | { | 1121 | { | ||
1121 | if (f->type() == oldField->type() && qFuzzyCompare(f->rect().left, oldField->rect().left) && qFuzzyCompare(f->rect().top, oldField->rect().top) && qFuzzyCompare(f->rect().right, oldField->rect().right) && qFuzzyCompare(f->rect().bottom, oldField->rect().bottom)) | 1122 | if (f->type() == oldField->type() && qFuzzyCompare(f->rect().left, oldField->rect().left) && qFuzzyCompare(f->rect().top, oldField->rect().top) && qFuzzyCompare(f->rect().right, oldField->rect().right) && qFuzzyCompare(f->rect().bottom, oldField->rect().bottom)) | ||
1122 | { | 1123 | { | ||
1123 | return f; | 1124 | return f; | ||
1124 | } | 1125 | } | ||
1125 | } | 1126 | } | ||
1126 | return nullptr; | 1127 | return nullptr; | ||
1127 | } | 1128 | } |
we don't need qAsConst here, do we?