Changeset View
Changeset View
Standalone View
Standalone View
autotests/testingutils.cpp
Show All 15 Lines | 15 | { | |||
---|---|---|---|---|---|
16 | QString getAnnotationXml(const Okular::Annotation* annotation) | 16 | QString getAnnotationXml(const Okular::Annotation* annotation) | ||
17 | { | 17 | { | ||
18 | QString annotXmlString; | 18 | QString annotXmlString; | ||
19 | QTextStream stream(&annotXmlString, QIODevice::Append); | 19 | QTextStream stream(&annotXmlString, QIODevice::Append); | ||
20 | annotation->getAnnotationPropertiesDomNode().save(stream, 0); | 20 | annotation->getAnnotationPropertiesDomNode().save(stream, 0); | ||
21 | return annotXmlString; | 21 | return annotXmlString; | ||
22 | } | 22 | } | ||
23 | 23 | | |||
24 | bool pointListsAlmostEqual( QLinkedList< Okular::NormalizedPoint > points1, QLinkedList< Okular::NormalizedPoint > points2 ) { | 24 | bool pointListsAlmostEqual( const QLinkedList< Okular::NormalizedPoint > &points1, const QLinkedList< Okular::NormalizedPoint > &points2 ) { | ||
25 | 25 | | |||
26 | QLinkedListIterator<Okular::NormalizedPoint> it1( points1 ); | 26 | QLinkedListIterator<Okular::NormalizedPoint> it1( points1 ); | ||
27 | QLinkedListIterator<Okular::NormalizedPoint> it2( points2 ); | 27 | QLinkedListIterator<Okular::NormalizedPoint> it2( points2 ); | ||
28 | while ( it1.hasNext() && it2.hasNext() ) | 28 | while ( it1.hasNext() && it2.hasNext() ) | ||
29 | { | 29 | { | ||
30 | const Okular::NormalizedPoint& p1 = it1.next(); | 30 | const Okular::NormalizedPoint& p1 = it1.next(); | ||
31 | const Okular::NormalizedPoint& p2 = it2.next(); | 31 | const Okular::NormalizedPoint& p2 = it2.next(); | ||
32 | if ( !qFuzzyCompare( p1.x, p2.x ) || !qFuzzyCompare( p1.y, p2.y ) ) { | 32 | if ( !qFuzzyCompare( p1.x, p2.x ) || !qFuzzyCompare( p1.y, p2.y ) ) { | ||
Show All 22 Lines |