summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/ChangeLog11
-rw-r--r--noncore/apps/opie-sheet/mainwindow.cpp3
-rw-r--r--noncore/apps/opie-sheet/opie-sheet.control2
-rw-r--r--noncore/apps/opie-sheet/sheet.cpp32
-rw-r--r--noncore/apps/opie-sheet/sheet.h4
5 files changed, 36 insertions, 16 deletions
diff --git a/noncore/apps/opie-sheet/ChangeLog b/noncore/apps/opie-sheet/ChangeLog
index c12a6db..90060e2 100644
--- a/noncore/apps/opie-sheet/ChangeLog
+++ b/noncore/apps/opie-sheet/ChangeLog
@@ -1,5 +1,14 @@
1October 08, 2002
2
3 * Release 1.0.2 (by thufir)
4 - Fixed bug #250 (exhibiting re-calculation error in multi-level calculation). (by thufir)
5
6October 06, 2002
7
8 - Fixed data edit box clear problem. (by thufir)
9
1October 05, 2002 10October 05, 2002
2 11
3 - Fixed bug #252. (by thufir) 12 - Fixed bug #252 (starting up in 'mouse button' mode). (by thufir)
4 13
5August 31, 2002 14August 31, 2002
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp
index 2f07bae..b9f8e57 100644
--- a/noncore/apps/opie-sheet/mainwindow.cpp
+++ b/noncore/apps/opie-sheet/mainwindow.cpp
@@ -196,4 +196,5 @@ void MainWindow::selectorFileNew(const DocLnk &lnkDoc)
196 if (currentDoc) delete currentDoc; 196 if (currentDoc) delete currentDoc;
197 currentDoc = new DocLnk(lnkDoc); 197 currentDoc = new DocLnk(lnkDoc);
198 editData->clear();
198 listSheets.clear(); 199 listSheets.clear();
199 comboSheets->clear(); 200 comboSheets->clear();
@@ -534,5 +535,5 @@ void MainWindow::slotHelpAbout()
534 dialogAbout.setCaption(tr("About Opie Sheet")); 535 dialogAbout.setCaption(tr("About Opie Sheet"));
535 536
536 QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.1\nRelease Date: July 04, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); 537 QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.2\nRelease Date: October 08, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout);
537 label.setGeometry(dialogAbout.rect()); 538 label.setGeometry(dialogAbout.rect());
538 label.setAlignment(Qt::AlignCenter | Qt::WordBreak); 539 label.setAlignment(Qt::AlignCenter | Qt::WordBreak);
diff --git a/noncore/apps/opie-sheet/opie-sheet.control b/noncore/apps/opie-sheet/opie-sheet.control
index 38f9083..cc322bb 100644
--- a/noncore/apps/opie-sheet/opie-sheet.control
+++ b/noncore/apps/opie-sheet/opie-sheet.control
@@ -4,5 +4,5 @@ Section: opie/applications
4Maintainer: Serdar Ozler <sozler@sitebest.com> 4Maintainer: Serdar Ozler <sozler@sitebest.com>
5Architecture: arm 5Architecture: arm
6Version: 1.0.1 6Version: 1.0.2
7Depends: opie-base ($QPE_VERSION) 7Depends: opie-base ($QPE_VERSION)
8License: Public Domain 8License: Public Domain
diff --git a/noncore/apps/opie-sheet/sheet.cpp b/noncore/apps/opie-sheet/sheet.cpp
index be4046b..c2563c2 100644
--- a/noncore/apps/opie-sheet/sheet.cpp
+++ b/noncore/apps/opie-sheet/sheet.cpp
@@ -89,5 +89,5 @@ void Sheet::slotCellChanged(int row, int col)
89 if (cellData) cellData->data=text(row, col); 89 if (cellData) cellData->data=text(row, col);
90 for (cellData=sheetData.first(); cellData; cellData=sheetData.next()) 90 for (cellData=sheetData.first(); cellData; cellData=sheetData.next())
91 setText(cellData->row, cellData->col, dataParser(cellData->data)); 91 setText(cellData->row, cellData->col, dataParser(findCellName(cellData->row, cellData->col), cellData->data));
92 emit sheetModified(); 92 emit sheetModified();
93} 93}
@@ -103,6 +103,6 @@ void Sheet::swapCells(int row1, int col1, int row2, int col2)
103 cellData1->data=cellData2->data; 103 cellData1->data=cellData2->data;
104 cellData2->data=tempData; 104 cellData2->data=tempData;
105 setText(cellData1->row, cellData1->col, dataParser(cellData1->data)); 105 setText(cellData1->row, cellData1->col, dataParser(findCellName(cellData1->row, cellData1->col), cellData1->data));
106 setText(cellData2->row, cellData2->col, dataParser(cellData2->data)); 106 setText(cellData2->row, cellData2->col, dataParser(findCellName(cellData2->row, cellData2->col), cellData2->data));
107 emit sheetModified(); 107 emit sheetModified();
108 } 108 }
@@ -167,5 +167,5 @@ double Sheet::calculateVariable(const QString &variable)
167 167
168 int row, col; 168 int row, col;
169 return (findRowColumn(variable, &row, &col, TRUE) ? text(row, col).toDouble() : 0); 169 return (findRowColumn(variable, &row, &col, TRUE) ? dataParser(variable, text(row, col)).toDouble() : 0);
170} 170}
171 171
@@ -421,9 +421,11 @@ QString Sheet::dataParserHelper(const QString &data)
421} 421}
422 422
423QString Sheet::dataParser(const QString &data) 423QString Sheet::dataParser(const QString &cell, const QString &data)
424{ 424{
425 QString strippedData(data); 425 QString strippedData(data);
426 strippedData.replace(QRegExp("\\s"), ""); 426 strippedData.replace(QRegExp("\\s"), "");
427 if (strippedData.isEmpty() || strippedData[0]!='=') return data; 427 if (strippedData.isEmpty() || strippedData[0]!='=') return data;
428 if (listDataParser.find(cell)!=listDataParser.end()) return "0";
429 listDataParser.append(cell);
428 strippedData=dataParserHelper(strippedData.remove(0, 1).upper().replace(QRegExp(":"), ",")); 430 strippedData=dataParserHelper(strippedData.remove(0, 1).upper().replace(QRegExp(":"), ","));
429 431
@@ -436,4 +438,5 @@ QString Sheet::dataParser(const QString &data)
436 } 438 }
437 while (!tempParameter.isNull()); 439 while (!tempParameter.isNull());
440 listDataParser.remove(cell);
438 return result.mid(1); 441 return result.mid(1);
439} 442}
@@ -540,7 +543,7 @@ void Sheet::viewportMouseReleaseEvent(QMouseEvent *e)
540 selectionNo=-1; 543 selectionNo=-1;
541 if (oldSelection.topRow()==oldSelection.bottomRow() && oldSelection.leftCol()==oldSelection.rightCol()) 544 if (oldSelection.topRow()==oldSelection.bottomRow() && oldSelection.leftCol()==oldSelection.rightCol())
542 emit cellClicked(getHeaderString(oldSelection.leftCol()+1)+QString::number(oldSelection.topRow()+1)); 545 emit cellClicked(findCellName(oldSelection.topRow(), oldSelection.leftCol()));
543 else 546 else
544 emit cellClicked(getHeaderString(oldSelection.leftCol()+1)+QString::number(oldSelection.topRow()+1)+','+getHeaderString(oldSelection.rightCol()+1)+QString::number(oldSelection.bottomRow()+1)); 547 emit cellClicked(findCellName(oldSelection.topRow(), oldSelection.leftCol())+','+findCellName(oldSelection.bottomRow(), oldSelection.rightCol()));
545 } 548 }
546 else 549 else
@@ -548,4 +551,9 @@ void Sheet::viewportMouseReleaseEvent(QMouseEvent *e)
548} 551}
549 552
553QString Sheet::findCellName(int row, int col)
554{
555 return (getHeaderString(col+1)+QString::number(row+1));
556}
557
550void Sheet::copySheetData(QList<typeCellData> *destSheetData) 558void Sheet::copySheetData(QList<typeCellData> *destSheetData)
551{ 559{
@@ -577,5 +585,5 @@ void Sheet::setSheetData(QList<typeCellData> *srcSheetData)
577 *newCellData=*tempCellData; 585 *newCellData=*tempCellData;
578 sheetData.append(newCellData); 586 sheetData.append(newCellData);
579 setText(newCellData->row, newCellData->col, dataParser(newCellData->data)); 587 setText(newCellData->row, newCellData->col, dataParser(findCellName(newCellData->row, newCellData->col), newCellData->data));
580 } 588 }
581 emit sheetModified(); 589 emit sheetModified();
@@ -757,5 +765,5 @@ void Sheet::editPaste(bool onlyContents)
757 cellData->col+=col1; 765 cellData->col+=col1;
758 } 766 }
759 setText(cellData->row, cellData->col, dataParser(cellData->data)); 767 setText(cellData->row, cellData->col, dataParser(findCellName(cellData->row, cellData->col), cellData->data));
760 emit sheetModified(); 768 emit sheetModified();
761 } 769 }
@@ -780,5 +788,5 @@ void Sheet::insertRows(int no, bool allColumns)
780 { 788 {
781 updateCell(tempCellData->row-no, tempCellData->col); 789 updateCell(tempCellData->row-no, tempCellData->col);
782 setText(tempCellData->row, tempCellData->col, dataParser(tempCellData->data)); 790 setText(tempCellData->row, tempCellData->col, dataParser(findCellName(tempCellData->row, tempCellData->col), tempCellData->data));
783 } 791 }
784 emit sheetModified(); 792 emit sheetModified();
@@ -806,5 +814,5 @@ void Sheet::insertColumns(int no, bool allRows)
806 { 814 {
807 updateCell(tempCellData->row, tempCellData->col-no); 815 updateCell(tempCellData->row, tempCellData->col-no);
808 setText(tempCellData->row, tempCellData->col, dataParser(tempCellData->data)); 816 setText(tempCellData->row, tempCellData->col, dataParser(findCellName(tempCellData->row, tempCellData->col), tempCellData->data));
809 } 817 }
810 emit sheetModified(); 818 emit sheetModified();
@@ -833,5 +841,5 @@ void Sheet::dataFindReplace(const QString &findStr, const QString &replaceStr, b
833 { 841 {
834 tempCellData->data=cellItem->text().replace(QRegExp(findStr, matchCase), replaceStr); 842 tempCellData->data=cellItem->text().replace(QRegExp(findStr, matchCase), replaceStr);
835 setText(tempCellData->row, tempCellData->col, dataParser(tempCellData->data)); 843 setText(tempCellData->row, tempCellData->col, dataParser(findCellName(tempCellData->row, tempCellData->col), tempCellData->data));
836 } 844 }
837 if (!replace || !replaceAll) break; 845 if (!replace || !replaceAll) break;
diff --git a/noncore/apps/opie-sheet/sheet.h b/noncore/apps/opie-sheet/sheet.h
index f78a684..f4e9d38 100644
--- a/noncore/apps/opie-sheet/sheet.h
+++ b/noncore/apps/opie-sheet/sheet.h
@@ -48,8 +48,10 @@ class Sheet: public QTable
48 QList<typeCellData> sheetData, clipboardData; 48 QList<typeCellData> sheetData, clipboardData;
49 QString pressedCell, releasedCell, sheetName; 49 QString pressedCell, releasedCell, sheetName;
50 QStringList listDataParser;
50 51
51 // Private functions 52 // Private functions
52 int getOperatorPriority(char oper); 53 int getOperatorPriority(char oper);
53 bool findRowColumn(const QString &variable, int *row, int *col, bool giveError=FALSE); 54 bool findRowColumn(const QString &variable, int *row, int *col, bool giveError=FALSE);
55 QString findCellName(int row, int col);
54 bool findRange(const QString &variable1, const QString &variable2, int *row1, int *col1, int *row2, int *col2); 56 bool findRange(const QString &variable1, const QString &variable2, int *row1, int *col1, int *row2, int *col2);
55 double calculateVariable(const QString &variable); 57 double calculateVariable(const QString &variable);
@@ -58,5 +60,5 @@ class Sheet: public QTable
58 QString popStringStack(QStack<QString> *stackStrings); 60 QString popStringStack(QStack<QString> *stackStrings);
59 QString getParameter(const QString &parameters, int paramNo, bool giveError=FALSE, const QString funcName=""); 61 QString getParameter(const QString &parameters, int paramNo, bool giveError=FALSE, const QString funcName="");
60 QString dataParser(const QString &data); 62 QString dataParser(const QString &cell, const QString &data);
61 QString dataParserHelper(const QString &data); 63 QString dataParserHelper(const QString &data);
62 typeCellData *createCellData(int row, int col); 64 typeCellData *createCellData(int row, int col);