[QGIS Commit] r9267 - in trunk/qgis/src: app core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Sep 5 17:16:58 EDT 2008


Author: ersts
Date: 2008-09-05 17:16:58 -0400 (Fri, 05 Sep 2008)
New Revision: 9267

Modified:
   trunk/qgis/src/app/qgscustomprojectiondialog.cpp
   trunk/qgis/src/core/qgsrect.cpp
Log:
-Added check to qgsrect intersect to see if rects actually intersect
-Patch for custom dialog box, closes ticket #1232

Modified: trunk/qgis/src/app/qgscustomprojectiondialog.cpp
===================================================================
--- trunk/qgis/src/app/qgscustomprojectiondialog.cpp	2008-09-05 20:23:28 UTC (rev 9266)
+++ trunk/qgis/src/app/qgscustomprojectiondialog.cpp	2008-09-05 21:16:58 UTC (rev 9267)
@@ -855,6 +855,7 @@
 
   sqlite3_finalize( myPreparedStatement );
   sqlite3_close( myDatabase );
+  pbnDelete->setEnabled( true );  
 }
 
 void QgsCustomProjectionDialog::on_pbnCalculate_clicked()

Modified: trunk/qgis/src/core/qgsrect.cpp
===================================================================
--- trunk/qgis/src/core/qgsrect.cpp	2008-09-05 20:23:28 UTC (rev 9266)
+++ trunk/qgis/src/core/qgsrect.cpp	2008-09-05 21:16:58 UTC (rev 9267)
@@ -132,7 +132,12 @@
 QgsRect QgsRect::intersect( QgsRect * rect ) const
 {
   QgsRect intersection = QgsRect();
-
+  //If they don't actually intersect an empty QgsRect should be returned
+  if ( !rect || !intersects( *rect ) )
+  {
+    return intersection;
+  }
+  
   intersection.setXMinimum( xmin > rect->xMin() ? xmin : rect->xMin() );
   intersection.setXMaximum( xmax < rect->xMax() ? xmax : rect->xMax() );
   intersection.setYMinimum( ymin > rect->yMin() ? ymin : rect->yMin() );



More information about the QGIS-commit mailing list