Skip to content

Commit e65f208

Browse files
committedMar 7, 2013
Modify testqgsscalecombobox to match modified behaviour of QgsScaleComboBox
1 parent cd2be4b commit e65f208

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/gui/qgsscalecombobox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void QgsScaleComboBox::fixupScale()
157157
if ( ok && ( newScale != oldScale ) )
158158
{
159159
// if a user types scale = 2345, we transform to 1:2345
160-
if ( userSetScale )
160+
if ( userSetScale && newScale >= 1.0 )
161161
{
162162
mScale = 1 / newScale;
163163
}

‎tests/src/gui/testqgsscalecombobox.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ void TestQgsScaleComboBox::basic()
7575
QCOMPARE( s->scaleString(), QString( "1:50" ) );
7676
QCOMPARE( s->scale(), ( double ) 0.02 );
7777

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

8585
// Testing rounding and conversion from illegal
8686

0 commit comments

Comments
 (0)
Please sign in to comment.