Skip to content

Commit

Permalink
Modify testqgsscalecombobox to match modified behaviour of QgsScaleCo…
Browse files Browse the repository at this point in the history
…mboBox
  • Loading branch information
mhugent committed Mar 7, 2013
1 parent cd2be4b commit e65f208
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgsscalecombobox.cpp
Expand Up @@ -157,7 +157,7 @@ void QgsScaleComboBox::fixupScale()
if ( ok && ( newScale != oldScale ) )
{
// if a user types scale = 2345, we transform to 1:2345
if ( userSetScale )
if ( userSetScale && newScale >= 1.0 )
{
mScale = 1 / newScale;
}
Expand Down
6 changes: 3 additions & 3 deletions tests/src/gui/testqgsscalecombobox.cpp
Expand Up @@ -75,12 +75,12 @@ void TestQgsScaleComboBox::basic()
QCOMPARE( s->scaleString(), QString( "1:50" ) );
QCOMPARE( s->scale(), ( double ) 0.02 );

// Testing conversion from number to "x:1"
// Testing conversion from number to "1:x"
l->setText( "" );
QTest::keyClicks( l, QLocale::system().toString( 42 ) );
QTest::keyClick( l, Qt::Key_Return );
QCOMPARE( s->scaleString(), QString( "42:1" ) );
QCOMPARE( s->scale(), ( double ) 42 );
QCOMPARE( s->scaleString(), QString( "1:42" ) );
QCOMPARE( s->scale(), ( double ) 1.0 / ( double ) 42.0 );

// Testing rounding and conversion from illegal

Expand Down

0 comments on commit e65f208

Please sign in to comment.