Skip to content
Permalink
Browse files

Tidy up indenting in some of the qgslegend.cpp file

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6339 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m
g_j_m committed Dec 29, 2006
1 parent e2b1f19 commit 527a0b05dee5b63ce613333e98ff960270cf4770
Showing with 37 additions and 34 deletions.
  1. +37 −34 src/legend/qgslegend.cpp
@@ -1677,15 +1677,15 @@ void QgsLegend::zoomToLayerExtent()
//find current Layer
QgsLegendLayer* currentLayer=dynamic_cast<QgsLegendLayer*>(currentItem());
if(!currentLayer)
{
return;
}
{
return;
}

std::list<QgsLegendLayerFile*> layerFiles = currentLayer->legendLayerFiles();
if(layerFiles.size() == 0)
{
return;
}
{
return;
}

double xmin = DBL_MAX;
double ymin = DBL_MAX;
@@ -1698,42 +1698,45 @@ void QgsLegend::zoomToLayerExtent()
QgsMapLayer* theLayer;

for(std::list<QgsLegendLayerFile*>::iterator it= layerFiles.begin(); it != layerFiles.end(); ++it)
{
theLayer = (*it)->layer();
if(theLayer)
{
theLayer = (*it)->layer();
if(theLayer)
{
layerExtent = theLayer->extent();
layerExtent = theLayer->extent();

if (QgsProject::instance()->readNumEntry("SpatialRefSys", "/ProjectionsEnabled",0) != 0
&& (ct = theLayer->coordinateTransform()))
{
//transform layer extent to canvas coordinate system
transformedExtent = ct->transform(layerExtent);
}
else
{
//transform layer extent to canvas coordinate system
transformedExtent = ct->transform(layerExtent);
}
else
{
// do not transform when projections are not enabled
transformedExtent = layerExtent;
}
transformedExtent = layerExtent;
}

if(transformedExtent.xMin() < xmin)
{
xmin = transformedExtent.xMin();
}
if(transformedExtent.yMin() < ymin)
{
ymin = transformedExtent.yMin();
}
if(transformedExtent.xMax() > xmax)
{
xmax = transformedExtent.xMax();
}
if(transformedExtent.yMax() > ymax)
{
ymax = transformedExtent.yMax();
}
}
if(transformedExtent.xMin() < xmin)
{
xmin = transformedExtent.xMin();
}

if(transformedExtent.yMin() < ymin)
{
ymin = transformedExtent.yMin();
}

if(transformedExtent.xMax() > xmax)
{
xmax = transformedExtent.xMax();
}

if(transformedExtent.yMax() > ymax)
{
ymax = transformedExtent.yMax();
}
}
}

//zoom to bounding box
mMapCanvas->setExtent(QgsRect(xmin, ymin, xmax, ymax));

0 comments on commit 527a0b0

Please sign in to comment.
You can’t perform that action at this time.