[poppler] Branch 'qt5' - qt5/src qt5/tests

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Jun 16 15:19:44 PDT 2013


 qt5/src/poppler-annotation.cc |   19 +------
 qt5/src/poppler-annotation.h  |   18 -------
 qt5/src/poppler-document.cc   |   19 -------
 qt5/src/poppler-link.cc       |    5 -
 qt5/src/poppler-link.h        |   10 ---
 qt5/src/poppler-page.cc       |   18 -------
 qt5/src/poppler-qt5.h         |   41 ----------------
 qt5/tests/check_fonts.cpp     |   21 +-------
 qt5/tests/check_metadata.cpp  |    1 
 qt5/tests/check_search.cpp    |  107 ++++++++++++++++++++++--------------------
 10 files changed, 65 insertions(+), 194 deletions(-)

New commits:
commit e2264ce82af3e971e34930f5307b7c9b43a1e346
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Jun 17 00:19:27 2013 +0200

    remove deprecated stuff

diff --git a/qt5/src/poppler-annotation.cc b/qt5/src/poppler-annotation.cc
index 7e8bfae..956e028 100644
--- a/qt5/src/poppler-annotation.cc
+++ b/qt5/src/poppler-annotation.cc
@@ -788,7 +788,6 @@ void Annotation::Popup::setText( const QString &text )
 Annotation::Annotation( AnnotationPrivate &dd )
     : d_ptr( &dd )
 {
-    window.width = window.height = 0;
 }
 
 Annotation::~Annotation()
@@ -800,8 +799,6 @@ Annotation::Annotation( AnnotationPrivate &dd, const QDomNode &annNode )
 {
     Q_D( Annotation );
 
-    window.width = window.height = 0;
-
     // get the [base] element of the annotation node
     QDomElement e = AnnotationUtils::findChildElement( annNode, "base" );
     if ( e.isNull() )
@@ -1672,7 +1669,7 @@ TextAnnotation::TextAnnotation( const QDomNode & node )
 
             if ( ee.tagName() == "escapedText" )
             {
-                setInplaceText(ee.firstChild().toCDATASection().data());
+                setContents(ee.firstChild().toCDATASection().data());
             }
             else if ( ee.tagName() == "callout" )
             {
@@ -1718,11 +1715,11 @@ void TextAnnotation::store( QDomNode & node, QDomDocument & document ) const
     textElement.setAttribute( "font", textFont().toString() );
 
     // Sub-Node-1 - escapedText
-    if ( !inplaceText().isEmpty() )
+    if ( !contents().isEmpty() )
     {
         QDomElement escapedText = document.createElement( "escapedText" );
         textElement.appendChild( escapedText );
-        QDomCDATASection textCData = document.createCDATASection( inplaceText() );
+        QDomCDATASection textCData = document.createCDATASection( contents() );
         escapedText.appendChild( textCData );
     }
 
@@ -1886,16 +1883,6 @@ void TextAnnotation::setInplaceAlign( int align )
     }
 }
 
-QString TextAnnotation::inplaceText() const
-{
-    return contents();
-}
-
-void TextAnnotation::setInplaceText( const QString &text )
-{
-    setContents(text);
-}
-
 QPointF TextAnnotation::calloutPoint( int id ) const
 {
     const QVector<QPointF> points = calloutPoints();
diff --git a/qt5/src/poppler-annotation.h b/qt5/src/poppler-annotation.h
index 2ae2c83..19f6bd0 100644
--- a/qt5/src/poppler-annotation.h
+++ b/qt5/src/poppler-annotation.h
@@ -244,11 +244,6 @@ class POPPLER_QT5_EXPORT Annotation
     /// \since 0.20
     void setPopup( const Popup& popup );
 
-    /// \cond PRIVATE
-    // This field is deprecated and not used any more. Use popup
-    Q_DECL_DEPRECATED struct { int width, height; } window; // Always set to zero
-    /// \endcond
-
     /// \since 0.20
     RevScope revisionScope() const; // Root
 
@@ -363,19 +358,6 @@ class POPPLER_QT5_EXPORT TextAnnotation : public Annotation
     int inplaceAlign() const;
     void setInplaceAlign( int align );
 
-    /**
-       Synonym for contents()
-
-       \deprecated Use contents() instead
-    */
-    QString inplaceText() const;
-    /**
-       Synonym for setContents()
-
-       \deprecated Use setContents() instead
-    */
-    void setInplaceText( const QString &text );
-
     QPointF calloutPoint( int id ) const;
     /// \since 0.20
     QVector<QPointF> calloutPoints() const;
diff --git a/qt5/src/poppler-document.cc b/qt5/src/poppler-document.cc
index 369e5e3..edc8008 100644
--- a/qt5/src/poppler-document.cc
+++ b/qt5/src/poppler-document.cc
@@ -214,20 +214,6 @@ namespace Poppler {
 	return m_doc->m_embeddedFiles;
     }
 
-    bool Document::scanForFonts( int numPages, QList<FontInfo> *fontList ) const
-    {
-	if ( !m_doc->m_fontInfoIterator )
-		return false;
-	if ( !m_doc->m_fontInfoIterator->hasNext() )
-		return false;
-	while ( m_doc->m_fontInfoIterator->hasNext() && numPages )
-	{
-		(*fontList) += m_doc->m_fontInfoIterator->next();
-		--numPages;
-	}
-	return true;
-    }
-
     FontIterator* Document::newFontIterator( int startPage ) const
     {
 	return new FontIterator( startPage, m_doc );
@@ -398,11 +384,6 @@ namespace Poppler {
 	return m_doc->doc->okToAssemble();
     }
 
-    double Document::pdfVersion() const
-    {
-	return m_doc->doc->getPDFMajorVersion () + m_doc->doc->getPDFMinorVersion() / 10.0;
-    }
-
     void Document::getPdfVersion(int *major, int *minor) const
     {
 	if (major)
diff --git a/qt5/src/poppler-link.cc b/qt5/src/poppler-link.cc
index e19816c..7de569c 100644
--- a/qt5/src/poppler-link.cc
+++ b/qt5/src/poppler-link.cc
@@ -602,11 +602,6 @@ class LinkMoviePrivate : public LinkPrivate
 	}
 
 	// LinkRendition
-	LinkRendition::LinkRendition( const QRectF &linkArea, ::MediaRendition *rendition )
-		: Link( *new LinkRenditionPrivate( linkArea, rendition, ::LinkRendition::NoRendition, QString(), Ref() ) )
-	{
-	}
-	
 	LinkRendition::LinkRendition( const QRectF &linkArea, ::MediaRendition *rendition, int operation, const QString &script, const Ref &annotationReference )
 		: Link( *new LinkRenditionPrivate( linkArea, rendition, static_cast<enum ::LinkRendition::RenditionOperation>(operation), script, annotationReference ) )
 	{
diff --git a/qt5/src/poppler-link.h b/qt5/src/poppler-link.h
index a84cf85..172effa 100644
--- a/qt5/src/poppler-link.h
+++ b/qt5/src/poppler-link.h
@@ -473,16 +473,6 @@ class POPPLER_QT5_EXPORT LinkRendition : public Link
 		 *
 		 * \param linkArea the active area of the link
 		 * \param rendition the media rendition object. Ownership is taken
-		 *
-		 * \deprecated Use the constructor that takes all parameter instead
-		 */
-		Q_DECL_DEPRECATED LinkRendition( const QRectF &linkArea, ::MediaRendition *rendition );
-
-		/**
-		 * Create a new rendition link.
-		 *
-		 * \param linkArea the active area of the link
-		 * \param rendition the media rendition object. Ownership is taken
 		 * \param operation the numeric operation (action) (@see ::LinkRendition::RenditionOperation)
 		 * \param script the java script code
 		 * \param annotationReference the object reference of the screen annotation associated with this rendition action
diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc
index 212e776..df2ef69 100644
--- a/qt5/src/poppler-page.cc
+++ b/qt5/src/poppler-page.cc
@@ -479,24 +479,6 @@ bool Page::search(const QString &text, double &sLeft, double &sTop, double &sRig
   return found;
 }
 
-bool Page::search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive, Rotation rotate) const
-{
-  double sLeft, sTop, sRight, sBottom;
-  sLeft = rect.left();
-  sTop = rect.top();
-  sRight = rect.right();
-  sBottom = rect.bottom();
-
-  bool found = search(text, sLeft, sTop, sRight, sBottom, direction, caseSensitive, rotate);
-
-  rect.setLeft( sLeft );
-  rect.setTop( sTop );
-  rect.setRight( sRight );
-  rect.setBottom( sBottom );
-
-  return found;
-}
-
 QList<QRectF> Page::search(const QString &text, SearchMode caseSensitive, Rotation rotate) const
 {
   GBool sCase;
diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h
index 2aabd4c..65e91b8 100644
--- a/qt5/src/poppler-qt5.h
+++ b/qt5/src/poppler-qt5.h
@@ -585,18 +585,6 @@ delete it;
 	   Returns true if the specified text was found.
 
 	   \param text the text the search
-	   \param rect in all directions is used to return where the text was found, for NextResult and PreviousResult
-	               indicates where to continue searching for
-	   \param direction in which direction do the search
-	   \param caseSensitive be case sensitive?
-	   \param rotate the rotation to apply for the search order
-	**/
-	Q_DECL_DEPRECATED bool search(const QString &text, QRectF &rect, SearchDirection direction, SearchMode caseSensitive, Rotation rotate = Rotate0) const;
-	
-	/**
-	   Returns true if the specified text was found.
-
-	   \param text the text the search
 	   \param rectXXX in all directions is used to return where the text was found, for NextResult and PreviousResult
 	               indicates where to continue searching for
 	   \param direction in which direction do the search
@@ -1128,15 +1116,6 @@ QString subject = m_doc->info("Subject");
 	   The version of the PDF specification that the document
 	   conforms to
 
-	   \deprecated use getPdfVersion and avoid float point
-	   comparisons/handling
-	*/
-	Q_DECL_DEPRECATED double pdfVersion() const;
-
-	/**
-	   The version of the PDF specification that the document
-	   conforms to
-
 	   \param major an optional pointer to a variable where store the
 	   "major" number of the version
 	   \param minor an optional pointer to a variable where store the
@@ -1160,26 +1139,6 @@ QString subject = m_doc->info("Subject");
 	QList<FontInfo> fonts() const;
 
 	/**
-	   Scans for fonts within the PDF document.
-
-	   \param numPages the number of pages to scan
-	   \param fontList pointer to the list where the font information
-	   should be placed
-
-	   \note with this method you can scan for fonts only \em once for each
-	   document; once the end is reached, no more scanning with this method
-	   can be done
-
-	   \return false if the end of the document has been reached
-
-	   \deprecated this function is quite limited in its job (see note),
-	   better use fonts() or newFontIterator()
-
-	   \see fonts(), newFontIterator()
-	*/
-	Q_DECL_DEPRECATED bool scanForFonts( int numPages, QList<FontInfo> *fontList ) const;
-
-	/**
 	   Creates a new FontIterator object for font scanning.
 
 	   The new iterator can be used for reading the font information of the
diff --git a/qt5/tests/check_fonts.cpp b/qt5/tests/check_fonts.cpp
index 99ce5ca..5d3c38e 100644
--- a/qt5/tests/check_fonts.cpp
+++ b/qt5/tests/check_fonts.cpp
@@ -15,7 +15,7 @@ private slots:
     void checkFontIterator();
     void checkSecondDocumentQuery();
     void checkMultipleIterations();
-    void checkScanForFonts();
+    void checkIteratorFonts();
 };
 
 
@@ -216,7 +216,7 @@ void TestFontsData::checkMultipleIterations()
     delete doc;
 }
 
-void TestFontsData::checkScanForFonts()
+void TestFontsData::checkIteratorFonts()
 {
     Poppler::Document *doc;
     doc = Poppler::Document::load(TESTDATADIR "/tests/fonts.pdf");
@@ -224,22 +224,11 @@ void TestFontsData::checkScanForFonts()
 
     QList<Poppler::FontInfo> listOfFonts = doc->fonts();
     QCOMPARE( listOfFonts.size(), 3 );
-    // check we get the very same result when gatering fonts using scanForFonts
-    QList<Poppler::FontInfo> listOfFonts2;
-    for ( int i = 0; i < doc->numPages(); ++i )
-    {
-        doc->scanForFonts( 1, &listOfFonts2 );
-    }
+    
+    // check we get the very same result when gatering fonts using the iterator
+    QList<Poppler::FontInfo> listOfFonts2 = loadFontsViaIterator( doc );
     QCOMPARE( listOfFonts, listOfFonts2 );
 
-   // check doing a second scanForFonts gives no result
-    QList<Poppler::FontInfo> listOfFonts3;
-    for ( int i = 0; i < doc->numPages(); ++i )
-    {
-        doc->scanForFonts( 1, &listOfFonts3 );
-    }
-    QVERIFY( listOfFonts3.isEmpty() );
-
     delete doc;
 }
 
diff --git a/qt5/tests/check_metadata.cpp b/qt5/tests/check_metadata.cpp
index 473f046..05abbaf 100644
--- a/qt5/tests/check_metadata.cpp
+++ b/qt5/tests/check_metadata.cpp
@@ -213,7 +213,6 @@ void TestMetaData::checkVersion()
     doc = Poppler::Document::load(TESTDATADIR "/unittestcases/doublepage.pdf");
     QVERIFY( doc );
 
-    QCOMPARE( doc->pdfVersion(), 1.6 );
     int major = 0, minor = 0;
     doc->getPdfVersion( &major, &minor );
     QCOMPARE( major, 1 );
diff --git a/qt5/tests/check_search.cpp b/qt5/tests/check_search.cpp
index d678d64..efb5556 100644
--- a/qt5/tests/check_search.cpp
+++ b/qt5/tests/check_search.cpp
@@ -17,21 +17,24 @@ void TestSearch::bug7063()
     QVERIFY( doc );
    
     Poppler::Page *page = doc->page(0);
-    QRectF pageRegion( QPointF(0,0), page->pageSize() );
+    double rectLeft, rectTop, rectRight, rectBottom;
+    rectLeft = 0;
+    rectTop = 0;
+    rectRight = page->pageSize().width();
+    rectBottom = page->pageSize().height();
+    QCOMPARE( page->search(QString("non-ascii:"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
 
-    QCOMPARE( page->search(QString("non-ascii:"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString("Ascii"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
+    QCOMPARE( page->search(QString("Ascii"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseInsensitive), true );
 
-    QCOMPARE( page->search(QString("Ascii"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
-    QCOMPARE( page->search(QString("Ascii"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseInsensitive), true );
+    QCOMPARE( page->search(QString("latin1:"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
 
-    QCOMPARE( page->search(QString("latin1:"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
-
-    QCOMPARE( page->search(QString::fromUtf8("é"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
-    QCOMPARE( page->search(QString::fromUtf8("à"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
-    QCOMPARE( page->search(QString::fromUtf8("ç"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
-    QCOMPARE( page->search(QString::fromUtf8("search \"é\", \"à\" or \"ç\""), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
-    QCOMPARE( page->search(QString::fromUtf8("¥µ©"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
-    QCOMPARE( page->search(QString::fromUtf8("¥©"), pageRegion, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
+    QCOMPARE( page->search(QString::fromUtf8("é"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("à"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("ç"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("search \"é\", \"à\" or \"ç\""), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("¥µ©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QCOMPARE( page->search(QString::fromUtf8("¥©"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), false );
   
     delete doc;
 }
@@ -43,45 +46,49 @@ void TestSearch::testNextAndPrevious()
     QVERIFY( doc );
   
     Poppler::Page *page = doc->page(0);
-    QRectF region( QPointF(0,0), page->pageSize() );
+    double rectLeft, rectTop, rectRight, rectBottom;
+    rectLeft = 0;
+    rectTop = 0;
+    rectRight = page->pageSize().width();
+    rectBottom = page->pageSize().height();
     
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
-    QVERIFY( qAbs(region.x() - 161.44) < 0.01 );
-    QVERIFY( qAbs(region.y() - 127.85) < 0.01 );
-    QVERIFY( qAbs(region.width() - 6.70) < 0.01 );
-    QVERIFY( qAbs(region.height() - 8.85) < 0.01 );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), true );
-    QVERIFY( qAbs(region.x() - 171.46) < 0.01 );
-    QVERIFY( qAbs(region.y() - 127.85) < 0.01 );
-    QVERIFY( qAbs(region.width() - 6.70) < 0.01 );
-    QVERIFY( qAbs(region.height() - 8.85) < 0.01 );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), true );
-    QVERIFY( qAbs(region.x() - 161.44) < 0.01 );
-    QVERIFY( qAbs(region.y() - 139.81) < 0.01 );
-    QVERIFY( qAbs(region.width() - 6.70) < 0.01 );
-    QVERIFY( qAbs(region.height() - 8.85) < 0.01 );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), true );
-    QVERIFY( qAbs(region.x() - 171.46) < 0.01 );
-    QVERIFY( qAbs(region.y() - 139.81) < 0.01 );
-    QVERIFY( qAbs(region.width() - 6.70) < 0.01 );
-    QVERIFY( qAbs(region.height() - 8.85) < 0.01 );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), false );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), true );
-    QVERIFY( qAbs(region.x() - 161.44) < 0.01 );
-    QVERIFY( qAbs(region.y() - 139.81) < 0.01 );
-    QVERIFY( qAbs(region.width() - 6.70) < 0.01 );
-    QVERIFY( qAbs(region.height() - 8.85) < 0.01 );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), true );
-    QVERIFY( qAbs(region.x() - 171.46) < 0.01 );
-    QVERIFY( qAbs(region.y() - 127.85) < 0.01 );
-    QVERIFY( qAbs(region.width() - 6.70) < 0.01 );
-    QVERIFY( qAbs(region.height() - 8.85) < 0.01 );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), true );
-    QVERIFY( qAbs(region.x() - 161.44) < 0.01 );
-    QVERIFY( qAbs(region.y() - 127.85) < 0.01 );
-    QVERIFY( qAbs(region.width() - 6.70) < 0.01 );
-    QVERIFY( qAbs(region.height() - 8.85) < 0.01 );
-    QCOMPARE( page->search(QString("is"), region, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), false );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::FromTop, Poppler::Page::CaseSensitive), true );
+    QVERIFY( qAbs(rectLeft - 161.44) < 0.01 );
+    QVERIFY( qAbs(rectTop - 127.85) < 0.01 );
+    QVERIFY( qAbs(rectRight - rectLeft - 6.70) < 0.01 );
+    QVERIFY( qAbs(rectBottom - rectTop - 8.85) < 0.01 );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), true );
+    QVERIFY( qAbs(rectLeft - 171.46) < 0.01 );
+    QVERIFY( qAbs(rectTop - 127.85) < 0.01 );
+    QVERIFY( qAbs(rectRight - rectLeft - 6.70) < 0.01 );
+    QVERIFY( qAbs(rectBottom - rectTop - 8.85) < 0.01 );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), true );
+    QVERIFY( qAbs(rectLeft - 161.44) < 0.01 );
+    QVERIFY( qAbs(rectTop - 139.81) < 0.01 );
+    QVERIFY( qAbs(rectRight - rectLeft - 6.70) < 0.01 );
+    QVERIFY( qAbs(rectBottom - rectTop - 8.85) < 0.01 );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), true );
+    QVERIFY( qAbs(rectLeft - 171.46) < 0.01 );
+    QVERIFY( qAbs(rectTop - 139.81) < 0.01 );
+    QVERIFY( qAbs(rectRight - rectLeft - 6.70) < 0.01 );
+    QVERIFY( qAbs(rectBottom - rectTop - 8.85) < 0.01 );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::NextResult, Poppler::Page::CaseSensitive), false );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), true );
+    QVERIFY( qAbs(rectLeft - 161.44) < 0.01 );
+    QVERIFY( qAbs(rectTop - 139.81) < 0.01 );
+    QVERIFY( qAbs(rectRight - rectLeft - 6.70) < 0.01 );
+    QVERIFY( qAbs(rectBottom - rectTop - 8.85) < 0.01 );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), true );
+    QVERIFY( qAbs(rectLeft - 171.46) < 0.01 );
+    QVERIFY( qAbs(rectTop - 127.85) < 0.01 );
+    QVERIFY( qAbs(rectRight - rectLeft - 6.70) < 0.01 );
+    QVERIFY( qAbs(rectBottom - rectTop - 8.85) < 0.01 );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), true );
+    QVERIFY( qAbs(rectLeft - 161.44) < 0.01 );
+    QVERIFY( qAbs(rectTop - 127.85) < 0.01 );
+    QVERIFY( qAbs(rectRight - rectLeft - 6.70) < 0.01 );
+    QVERIFY( qAbs(rectBottom - rectTop - 8.85) < 0.01 );
+    QCOMPARE( page->search(QString("is"), rectLeft, rectTop, rectRight, rectBottom, Poppler::Page::PreviousResult, Poppler::Page::CaseSensitive), false );
     
     delete doc;
 }


More information about the poppler mailing list