Skip to content

Commit 768ce9c

Browse files
author
jef
committed
fix histogram crash
git-svn-id: http://svn.osgeo.org/qgis/trunk@15508 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 59ce32e commit 768ce9c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/app/qgsrasterlayerproperties.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,15 @@ void QgsRasterLayerProperties::refreshHistogram()
18691869
int myBandCountInt = mRasterLayer->bandCount();
18701870
QList<QColor> myColors;
18711871
myColors << Qt::black << Qt::red << Qt::green << Qt::blue << Qt::magenta << Qt::darkRed << Qt::darkGreen << Qt::darkBlue;
1872+
1873+
while ( myColors.size() <= myBandCountInt )
1874+
{
1875+
myColors <<
1876+
QColor( 1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1877+
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ),
1878+
1 + ( int )( 255.0 * rand() / ( RAND_MAX + 1.0 ) ) );
1879+
}
1880+
18721881
//
18731882
//now draw actual graphs
18741883
//

0 commit comments

Comments
 (0)