summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-sheet/sheet.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-sheet/sheet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/sheet.cpp10
1 files changed, 6 insertions, 4 deletions
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
@@ -909,7 +909,7 @@ double Sheet::functionCountIf(const QString &param1, const QString &param2, cons
909} 909}
910 910
911 911
912QString Sheet::calculateFunction(const QString &function, const QString &parameters, int NumOfParams) 912QString Sheet::calculateFunction(const QString &func, const QString &parameters, int NumOfParams)
913{ 913{
914 bool ok; 914 bool ok;
915 double val1=0.0,val2=0.0,val3=0.0; 915 double val1=0.0,val2=0.0,val3=0.0;
@@ -918,6 +918,8 @@ QString Sheet::calculateFunction(const QString &function, const QString &paramet
918 int row,col; 918 int row,col;
919 QString s1,s2; 919 QString s1,s2;
920//basic functions 920//basic functions
921 QString function;
922 function=func.upper();
921 if (function=="+") 923 if (function=="+")
922 { 924 {
923 s1=calculateVariable(getParameter(parameters, 0)); 925 s1=calculateVariable(getParameter(parameters, 0));
@@ -1777,7 +1779,7 @@ QString Sheet::dataParserHelper(const QString &data)
1777 } 1779 }
1778 else if(tokentype==VARIABLE_TOKEN) 1780 else if(tokentype==VARIABLE_TOKEN)
1779 { 1781 {
1780 stack1.push(new QString(*s1)); 1782 stack1.push(new QString(QString(*s1).upper()));
1781 //printf("Parse:Var=%s\r\n",s1->latin1()); 1783 //printf("Parse:Var=%s\r\n",s1->latin1());
1782 //here to put implementation of other types of variables except cell. 1784 //here to put implementation of other types of variables except cell.
1783 //for example names 1785 //for example names
@@ -1801,7 +1803,7 @@ QString Sheet::dataParserHelper(const QString &data)
1801 //printf("Parse:Func=%s, params=%s, stackcount=%d,args=%d\r\n" 1803 //printf("Parse:Func=%s, params=%s, stackcount=%d,args=%d\r\n"
1802 //,s1->latin1(),params.latin1(),stack1.count(),args); 1804 //,s1->latin1(),params.latin1(),stack1.count(),args);
1803 tempval=calculateFunction(*s1,params,args); 1805 tempval=calculateFunction(*s1,params,args);
1804 tempval=tempval.upper(); 1806 tempval=tempval;
1805 stack1.push(new QString(tempval)); 1807 stack1.push(new QString(tempval));
1806 }; 1808 };
1807 1809
@@ -1825,7 +1827,7 @@ QString Sheet::dataParser(const QString &cell, const QString &data)
1825 if (listDataParser.find(cell)!=listDataParser.end()) return "0"; 1827 if (listDataParser.find(cell)!=listDataParser.end()) return "0";
1826 listDataParser.append(cell); 1828 listDataParser.append(cell);
1827 // printf("DATAPARSER: data=%s, cell=%s\r\n",data.ascii(),cell.ascii()); 1829 // printf("DATAPARSER: data=%s, cell=%s\r\n",data.ascii(),cell.ascii());
1828 strippedData=dataParserHelper(strippedData.remove(0, 1).upper().replace(QRegExp(":"), ",")); 1830 strippedData=dataParserHelper(strippedData.remove(0, 1).replace(QRegExp(":"), ","));
1829 1831
1830 int i=0; 1832 int i=0;
1831 QString tempParameter(getParameter(strippedData, i)), result=""; 1833 QString tempParameter(getParameter(strippedData, i)), result="";