Skip to content

Commit

Permalink
Formatting/layout changes only
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@5328 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Apr 21, 2006
1 parent 3486175 commit b7b44bb
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions src/gui/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3231,9 +3231,9 @@ void QgisApp::attributeTable()
std::cerr << ">> = " << std::endl;
if (layer)
{
std::cerr << ">>> = " << std::endl;
std::cerr << ">>> = " << std::endl;
layer->table();
std::cerr << ">>> = " << std::endl;
std::cerr << ">>> = " << std::endl;
}
else
{
Expand Down Expand Up @@ -3529,30 +3529,32 @@ void QgisApp::zoomToLayerExtent()
// zoom only if one or more layers loaded
if(QgsMapLayerRegistry::instance()->count() > 0)
{

QgsMapLayer *layer = mMapLegend->currentLayer();
if(layer)
{
// Check if the layer extent has to be transformed to the map canvas
// coordinate system
{
// Check if the layer extent has to be transformed to the map canvas
// coordinate system
#ifdef QGISDEBUG
std::cout << "Layer extent is : " << (layer->extent()).stringRep().toLocal8Bit().data() << std::endl;
std::cout << "Layer extent is : " << layer->extent() << std::endl;
#endif
if (QgsProject::instance()->readNumEntry("SpatialRefSys","/ProjectionsEnabled",0)!=0)
{
QgsCoordinateTransform *ct = layer->coordinateTransform();
try {
QgsRect transformedExtent = ct->transform(layer->extent());
mMapCanvas->setExtent(transformedExtent);
if (QgsProject::instance()->readNumEntry("SpatialRefSys",
"/ProjectionsEnabled",0)!=0)
{
QgsCoordinateTransform *ct = layer->coordinateTransform();
try
{
QgsRect transformedExtent = ct->transform(layer->extent());
mMapCanvas->setExtent(transformedExtent);
#ifdef QGISDEBUG
std::cout << "Canvas extent is : " << transformedExtent.stringRep().toLocal8Bit().data() << std::endl;
std::cout << "Canvas extent is : " << transformedExtent
<< std::endl;
#endif
}
catch(QgsCsException &cse)
{
}
catch(QgsCsException &cse)
{
#ifdef QGISDEBUG
std::cout << "Caught transform error in zoomToLayerExtent(). "
<< "Setting untransformed extents." << std::endl;
std::cout << "Caught transform error in zoomToLayerExtent(). "
<< "Setting untransformed extents." << std::endl;
#endif
mMapCanvas->setExtent(layer->extent());
}
Expand All @@ -3563,9 +3565,9 @@ void QgisApp::zoomToLayerExtent()
}
mMapCanvas->refresh();

// notify the project we've made a change
QgsProject::instance()->dirty(true);
}
// notify the project we've made a change
QgsProject::instance()->dirty(true);
}
}
} // QgisApp::zoomToLayerExtent()

Expand Down

0 comments on commit b7b44bb

Please sign in to comment.