Skip to content

Commit e0b8eb2

Browse files
author
g_j_m
committed
Tidy up indenting in some of the qgslegend.cpp file
git-svn-id: http://svn.osgeo.org/qgis/trunk@6339 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent f66cb7f commit e0b8eb2

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed

src/legend/qgslegend.cpp

+37-34
Original file line numberDiff line numberDiff line change
@@ -1677,15 +1677,15 @@ void QgsLegend::zoomToLayerExtent()
16771677
//find current Layer
16781678
QgsLegendLayer* currentLayer=dynamic_cast<QgsLegendLayer*>(currentItem());
16791679
if(!currentLayer)
1680-
{
1681-
return;
1682-
}
1680+
{
1681+
return;
1682+
}
16831683

16841684
std::list<QgsLegendLayerFile*> layerFiles = currentLayer->legendLayerFiles();
16851685
if(layerFiles.size() == 0)
1686-
{
1687-
return;
1688-
}
1686+
{
1687+
return;
1688+
}
16891689

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

17001700
for(std::list<QgsLegendLayerFile*>::iterator it= layerFiles.begin(); it != layerFiles.end(); ++it)
1701+
{
1702+
theLayer = (*it)->layer();
1703+
if(theLayer)
17011704
{
1702-
theLayer = (*it)->layer();
1703-
if(theLayer)
1704-
{
1705-
layerExtent = theLayer->extent();
1705+
layerExtent = theLayer->extent();
17061706

17071707
if (QgsProject::instance()->readNumEntry("SpatialRefSys", "/ProjectionsEnabled",0) != 0
17081708
&& (ct = theLayer->coordinateTransform()))
17091709
{
1710-
//transform layer extent to canvas coordinate system
1711-
transformedExtent = ct->transform(layerExtent);
1712-
}
1713-
else
1714-
{
1710+
//transform layer extent to canvas coordinate system
1711+
transformedExtent = ct->transform(layerExtent);
1712+
}
1713+
else
1714+
{
17151715
// do not transform when projections are not enabled
1716-
transformedExtent = layerExtent;
1717-
}
1716+
transformedExtent = layerExtent;
1717+
}
17181718

1719-
if(transformedExtent.xMin() < xmin)
1720-
{
1721-
xmin = transformedExtent.xMin();
1722-
}
1723-
if(transformedExtent.yMin() < ymin)
1724-
{
1725-
ymin = transformedExtent.yMin();
1726-
}
1727-
if(transformedExtent.xMax() > xmax)
1728-
{
1729-
xmax = transformedExtent.xMax();
1730-
}
1731-
if(transformedExtent.yMax() > ymax)
1732-
{
1733-
ymax = transformedExtent.yMax();
1734-
}
1735-
}
1719+
if(transformedExtent.xMin() < xmin)
1720+
{
1721+
xmin = transformedExtent.xMin();
1722+
}
1723+
1724+
if(transformedExtent.yMin() < ymin)
1725+
{
1726+
ymin = transformedExtent.yMin();
1727+
}
1728+
1729+
if(transformedExtent.xMax() > xmax)
1730+
{
1731+
xmax = transformedExtent.xMax();
1732+
}
1733+
1734+
if(transformedExtent.yMax() > ymax)
1735+
{
1736+
ymax = transformedExtent.yMax();
1737+
}
17361738
}
1739+
}
17371740

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

0 commit comments

Comments
 (0)