Skip to content

Commit

Permalink
fix msvc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 3, 2014
1 parent 6c2e385 commit 72552bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -376,7 +376,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
QList<double>::iterator zoom_it;
for ( zoom_it = mStatusZoomLevelsList.begin(); zoom_it != mStatusZoomLevelsList.end(); ++zoom_it )
{
mStatusZoomCombo->insertItem( 0, QString( tr( "%1\%" ) ).arg(( *zoom_it ) * 100 ) );
mStatusZoomCombo->insertItem( 0, tr( "%1%" ).arg( *zoom_it * 100.0, 0, 'f', 1 ) );
}
connect( mStatusZoomCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( statusZoomCombo_currentIndexChanged( int ) ) );
connect( mStatusZoomCombo->lineEdit(), SIGNAL( returnPressed() ), this, SLOT( statusZoomCombo_zoomEntered() ) );
Expand Down Expand Up @@ -735,7 +735,7 @@ void QgsComposer::updateStatusZoom()
double zoomLevel = mView->transform().m11() * 100 / scale100;

mStatusZoomCombo->blockSignals( true );
mStatusZoomCombo->lineEdit()->setText( QString( tr( "%1\%" ) ).arg( QString::number( zoomLevel, 'f', 1 ) ) );
mStatusZoomCombo->lineEdit()->setText( tr( "%1%" ).arg( zoomLevel, 0, 'f', 1 ) );
mStatusZoomCombo->blockSignals( false );
}

Expand All @@ -747,7 +747,7 @@ void QgsComposer::statusZoomCombo_currentIndexChanged( int index )
mView->setZoomLevel( selectedZoom );
//update zoom combobox text for correct format (one decimal place, trailing % sign)
mStatusZoomCombo->blockSignals( true );
mStatusZoomCombo->lineEdit()->setText( QString( tr( "%1\%" ) ).arg( QString::number( selectedZoom * 100, 'f', 1 ) ) );
mStatusZoomCombo->lineEdit()->setText( tr( "%1%" ).arg( selectedZoom * 100.0, 0, 'f', 1 ) );
mStatusZoomCombo->blockSignals( false );
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/composer/qgscomposermousehandles.cpp
Expand Up @@ -592,7 +592,7 @@ void QgsComposerMouseHandles::mouseReleaseEvent( QGraphicsSceneMouseEvent* event
QList<QgsComposerItem*>::iterator itemIter = selectedItems.begin();
for ( ; itemIter != selectedItems.end(); ++itemIter )
{
if (( *itemIter )->positionLock() || ( !( *itemIter )->flags() & QGraphicsItem::ItemIsSelectable ) )
if (( *itemIter )->positionLock() || (( *itemIter )->flags() & QGraphicsItem::ItemIsSelectable ) == 0 )
{
//don't move locked items
continue;
Expand All @@ -615,7 +615,7 @@ void QgsComposerMouseHandles::mouseReleaseEvent( QGraphicsSceneMouseEvent* event
QList<QgsComposerItem*>::iterator itemIter = selectedItems.begin();
for ( ; itemIter != selectedItems.end(); ++itemIter )
{
if (( *itemIter )->positionLock() || ( !( *itemIter )->flags() & QGraphicsItem::ItemIsSelectable ) )
if (( *itemIter )->positionLock() || (( *itemIter )->flags() & QGraphicsItem::ItemIsSelectable ) == 0 )
{
//don't resize locked items or unselectable items (eg, items which make up an item group)
continue;
Expand Down
7 changes: 6 additions & 1 deletion src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -1993,7 +1993,7 @@ bool QgsCoordinateReferenceSystem::syncDatumTransform( const QString& dbPath )

int n = CSLCount( fieldnames );

int idxid, idxrx, idxry, idxrz;
int idxid = -1, idxrx = -1, idxry = -1, idxrz = -1;
for ( unsigned int i = 0; i < sizeof( map ) / sizeof( *map ); i++ )
{
bool last = i == sizeof( map ) / sizeof( *map ) - 1;
Expand Down Expand Up @@ -2046,6 +2046,11 @@ bool QgsCoordinateReferenceSystem::syncDatumTransform( const QString& dbPath )

CSLDestroy( fieldnames );

Q_ASSERT( idxid >= 0 );
Q_ASSERT( idxrx >= 0 );
Q_ASSERT( idxry >= 0 );
Q_ASSERT( idxrz >= 0 );

sqlite3 *db;
int openResult = sqlite3_open( dbPath.toUtf8().constData(), &db );
if ( openResult != SQLITE_OK )
Expand Down

0 comments on commit 72552bc

Please sign in to comment.