Skip to content
Permalink
Browse files

Adapt compositionchecker for multi pages

  • Loading branch information
mhugent committed Jul 19, 2012
1 parent 937bffa commit 3af7ef30851210bf3629bf68c722a90fe4c1952d
Showing with 3 additions and 5 deletions.
  1. +2 −4 tests/src/core/qgscompositionchecker.cpp
  2. +1 −1 tests/src/core/qgscompositionchecker.h
@@ -34,7 +34,7 @@ QgsCompositionChecker::~QgsCompositionChecker()
{
}

bool QgsCompositionChecker::testComposition()
bool QgsCompositionChecker::testComposition( int page )
{
if ( !mComposition )
{
@@ -70,9 +70,7 @@ bool QgsCompositionChecker::testComposition()
outputImage.setDotsPerMeterY( expectedImage.dotsPerMeterX() );
outputImage.fill( 0 );
QPainter p( &outputImage );
QRectF sourceArea( 0, 0, mComposition->paperWidth(), mComposition->paperHeight() );
QRectF targetArea( 0, 0, width, height );
mComposition->render( &p, targetArea, sourceArea );
mComposition->renderPage( &p, page );
p.end();

QString renderedFilePath = QDir::tempPath() + QDir::separator() + QFileInfo( mExpectedImageFile ).baseName() + "_rendered.png";
@@ -27,7 +27,7 @@ class QgsCompositionChecker
QgsCompositionChecker( const QString& testName, QgsComposition* composition, const QString& expectedImageFile );
~QgsCompositionChecker();

bool testComposition();
bool testComposition( int page = 0 );

private:
QgsCompositionChecker(); //forbidden

0 comments on commit 3af7ef3

Please sign in to comment.
You can’t perform that action at this time.