Version: branch 1.5 (using KDE KDE 3.5.3) Installed from: Compiled From Sources Compiler: gcc 4.03 OS: Linux Create some data in a column, in kspread starting with a name for instance ("my label", 1, 2, 3), select the data, create a new chart, select the checkbox "First row as label", and then click "finish". You will get a chart, but the serie will be called "Series 1" instead of "my label". Now, if instead of checking "First row as label", you leave it uncheck, then the serie will be called "my label" but you will also have a fourth value in your chart.
SVN commit 602773 by ingwa: Fix bug 128758: misinterpretation of the checkbox "first row as label" - Pass the parameters to createLabelsAndLegend as references. BUG: 128758 M +6 -0 ChangeLog M +1 -1 kchart_params.cc M +6 -4 kchart_part.cc M +2 -2 kchart_part.h --- branches/koffice/1.6/koffice/kchart/ChangeLog #602772:602773 @@ -1,3 +1,9 @@ +2006-11-06 Inge Wallin <inge@lysator.liu.se> + + Fix bug 128758: misinterpretation of the checkbox "first row as label" + * kchart_part.cc (createLabelsAndLegend): Pass parameters as + references. + 2006-10-29 Inge Wallin <inge@lysator.liu.se> * Imported KDChart 1.1.4. --- branches/koffice/1.6/koffice/kchart/kchart_params.cc #602772:602773 @@ -170,7 +170,7 @@ loadingContext.fillStyleStack( chartElem, KoXmlNS::chart, "style-name" ); const QString fillColor = styleStack.attributeNS( KoXmlNS::draw, "fill-color" ); - kdDebug() << "fillColor=" << fillColor << endl; + kDebug() << "fillColor=" << fillColor << endl; styleStack.restore(); #endif --- branches/koffice/1.6/koffice/kchart/kchart_part.cc #602772:602773 @@ -460,8 +460,8 @@ } -void KChartPart::createLabelsAndLegend( QStringList longLabels, - QStringList shortLabels ) +void KChartPart::createLabelsAndLegend( QStringList &longLabels, + QStringList &shortLabels ) { longLabels.clear(); shortLabels.clear(); @@ -641,8 +641,9 @@ // Generate m_rowlabels from the column headers if applicable. m_rowLabels.clear(); if ( firstColHeader ) { - for( row = rowStart; row < data.rows(); row++ ) + for( row = rowStart; row < data.rows(); row++ ) { m_rowLabels << data.cellVal( row, 0 ).toString(); + } } else { for( row = rowStart; row < data.rows(); row++ ) @@ -656,8 +657,9 @@ // Generate X labels from the row headers if applicable m_colLabels.clear(); if ( firstRowHeader ) { - for( col = colStart; col < data.cols(); col++ ) + for( col = colStart; col < data.cols(); col++ ) { m_colLabels << data.cellVal( 0, col ).toString(); + } } else { for( col = colStart; col < data.cols(); col++ ) --- branches/koffice/1.6/koffice/kchart/kchart_part.h #602772:602773 @@ -104,8 +104,8 @@ private: // Helper methods for painting. int createDisplayData(); - void createLabelsAndLegend( QStringList longLabels, - QStringList shortLabels ); + void createLabelsAndLegend( QStringList &longLabels, + QStringList &shortLabels ); QDomElement createElement(const QString &tagName,
You need to log in before you can comment on or make changes to this bug.