Skip to content

Commit c87105d

Browse files
author
ersts
committed
-Added check to qgsrect intersect to see if rects actually intersect
-Patch for custom dialog box, closes ticket #1232 git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9267 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 4d78496 commit c87105d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/app/qgscustomprojectiondialog.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ void QgsCustomProjectionDialog::on_pbnSave_clicked()
855855

856856
sqlite3_finalize( myPreparedStatement );
857857
sqlite3_close( myDatabase );
858+
pbnDelete->setEnabled( true );
858859
}
859860

860861
void QgsCustomProjectionDialog::on_pbnCalculate_clicked()

src/core/qgsrect.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ void QgsRect::expand( double scaleFactor, const QgsPoint * cp )
132132
QgsRect QgsRect::intersect( QgsRect * rect ) const
133133
{
134134
QgsRect intersection = QgsRect();
135-
135+
//If they don't actually intersect an empty QgsRect should be returned
136+
if ( !rect || !intersects( *rect ) )
137+
{
138+
return intersection;
139+
}
140+
136141
intersection.setXMinimum( xmin > rect->xMin() ? xmin : rect->xMin() );
137142
intersection.setXMaximum( xmax < rect->xMax() ? xmax : rect->xMax() );
138143
intersection.setYMinimum( ymin > rect->yMin() ? ymin : rect->yMin() );

0 commit comments

Comments
 (0)