-rw-r--r-- | noncore/apps/opie-sheet/ChangeLog | 4 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/sheet.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/sheet.h | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/noncore/apps/opie-sheet/ChangeLog b/noncore/apps/opie-sheet/ChangeLog index 56887c5..e8a31ee 100644 --- a/noncore/apps/opie-sheet/ChangeLog +++ b/noncore/apps/opie-sheet/ChangeLog @@ -1,4 +1,8 @@ +January 8, 2004 + - fixed issue : "-if someone enters directly text as parameter to a string function the text renders as uppercase due to the calculation engine that uppercases all the parsing sentence." + now the text is handled correctly. + January 7, 2004 * Release by hayzel (koppermind@panafonet.gr) This version has many valuable changes, though It may have some annoying bugs. Please if you are interested in opie-sheet try it hard, so I can fix some of them. Also If you want some other functions that must be here and are missing feel free to ask them. (no financial functions please. :) I really hate them ) -Fixed a bug with non closed parenthesis editing&recalculation infinite loop. diff --git a/noncore/apps/opie-sheet/sheet.cpp b/noncore/apps/opie-sheet/sheet.cpp index 103b83b..e1e4744 100644 --- a/noncore/apps/opie-sheet/sheet.cpp +++ b/noncore/apps/opie-sheet/sheet.cpp @@ -908,17 +908,19 @@ double Sheet::functionCountIf(const QString ¶m1, const QString ¶m2, cons return divider; } -QString Sheet::calculateFunction(const QString &function, const QString ¶meters, int NumOfParams) +QString Sheet::calculateFunction(const QString &func, const QString ¶meters, int NumOfParams) { bool ok; double val1=0.0,val2=0.0,val3=0.0; long int vali=0; int w1,w2; int row,col; QString s1,s2; //basic functions + QString function; + function=func.upper(); if (function=="+") { s1=calculateVariable(getParameter(parameters, 0)); s2=calculateVariable(getParameter(parameters, 1)); @@ -1776,9 +1778,9 @@ QString Sheet::dataParserHelper(const QString &data) //printf("Parse:Number=%s\r\n",s1->latin1()); } else if(tokentype==VARIABLE_TOKEN) { - stack1.push(new QString(*s1)); + stack1.push(new QString(QString(*s1).upper())); //printf("Parse:Var=%s\r\n",s1->latin1()); //here to put implementation of other types of variables except cell. //for example names } @@ -1800,9 +1802,9 @@ QString Sheet::dataParserHelper(const QString &data) if(params==NULL) params="0"; //printf("Parse:Func=%s, params=%s, stackcount=%d,args=%d\r\n" // ,s1->latin1(),params.latin1(),stack1.count(),args); tempval=calculateFunction(*s1,params,args); - tempval=tempval.upper(); + tempval=tempval; stack1.push(new QString(tempval)); }; //loops to next token @@ -1824,9 +1826,9 @@ QString Sheet::dataParser(const QString &cell, const QString &data) if (strippedData.isEmpty() || strippedData[0]!='=') return data; if (listDataParser.find(cell)!=listDataParser.end()) return "0"; listDataParser.append(cell); // printf("DATAPARSER: data=%s, cell=%s\r\n",data.ascii(),cell.ascii()); - strippedData=dataParserHelper(strippedData.remove(0, 1).upper().replace(QRegExp(":"), ",")); + strippedData=dataParserHelper(strippedData.remove(0, 1).replace(QRegExp(":"), ",")); int i=0; QString tempParameter(getParameter(strippedData, i)), result=""; do diff --git a/noncore/apps/opie-sheet/sheet.h b/noncore/apps/opie-sheet/sheet.h index 41f1b86..f705cd0 100644 --- a/noncore/apps/opie-sheet/sheet.h +++ b/noncore/apps/opie-sheet/sheet.h @@ -99,9 +99,9 @@ class Sheet: public QTable bool findRowColumn(const QString &variable, int *row, int *col, bool giveError=FALSE); QString findCellName(int row, int col); bool findRange(const QString &variable1, const QString &variable2, int *row1, int *col1, int *row2, int *col2); QString calculateVariable(const QString &variable); - QString calculateFunction(const QString &function, const QString ¶meters, int NumOfParams); + QString calculateFunction(const QString &func, const QString ¶meters, int NumOfParams); QString getParameter(const QString ¶meters, int paramNo, bool giveError=FALSE, const QString funcName=""); QString dataParser(const QString &cell, const QString &data); QString dataParserHelper(const QString &data); typeCellData *createCellData(int row, int col); |