summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/Excel.cpp83
-rw-r--r--noncore/apps/opie-sheet/Excel.h47
-rw-r--r--noncore/apps/opie-sheet/cellformat.cpp42
-rw-r--r--noncore/apps/opie-sheet/cellformat.h42
-rw-r--r--noncore/apps/opie-sheet/finddlg.cpp42
-rw-r--r--noncore/apps/opie-sheet/finddlg.h39
-rw-r--r--noncore/apps/opie-sheet/main.cpp35
-rw-r--r--noncore/apps/opie-sheet/mainwindow.cpp43
-rw-r--r--noncore/apps/opie-sheet/mainwindow.h43
-rw-r--r--noncore/apps/opie-sheet/numberdlg.cpp38
-rw-r--r--noncore/apps/opie-sheet/numberdlg.h36
-rw-r--r--noncore/apps/opie-sheet/opie-sheet.pro19
-rw-r--r--noncore/apps/opie-sheet/sheet.cpp122
-rw-r--r--noncore/apps/opie-sheet/sheet.h36
-rw-r--r--noncore/apps/opie-sheet/sortdlg.cpp42
-rw-r--r--noncore/apps/opie-sheet/sortdlg.h39
-rw-r--r--noncore/apps/opie-sheet/textdlg.cpp38
-rw-r--r--noncore/apps/opie-sheet/textdlg.h36
18 files changed, 618 insertions, 204 deletions
diff --git a/noncore/apps/opie-sheet/Excel.cpp b/noncore/apps/opie-sheet/Excel.cpp
index fc49d56..57aef20 100644
--- a/noncore/apps/opie-sheet/Excel.cpp
+++ b/noncore/apps/opie-sheet/Excel.cpp
@@ -1,4 +1,33 @@
1/*
2 =. This file is part of the Opie Project
3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 .>+-=
5 _;:, .> :=|. This program is free software; you can
6.> <`_, > . <= redistribute it and/or modify it under
7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
1 28
29#include "Excel.h"
2 30
31/* STD */
3#include <stdio.h> 32#include <stdio.h>
4#include <stdlib.h> 33#include <stdlib.h>
@@ -7,5 +36,4 @@
7#include <sys/types.h> 36#include <sys/types.h>
8#include <strings.h> 37#include <strings.h>
9#include "Excel.h"
10 38
11static xfrecord formatter[] = { 39static xfrecord formatter[] = {
@@ -64,5 +92,6 @@ int ExcelBook::Integer4Byte(int b1,int b2,int b3,int b4)
64}; 92};
65 93
66int ExcelBook::Integer2ByteFile(FILE *f) { 94int ExcelBook::Integer2ByteFile(FILE *f)
95{
67 int i1, i2; 96 int i1, i2;
68 i1 = fgetc(f); 97 i1 = fgetc(f);
@@ -103,5 +132,6 @@ double ExcelBook::Double4Byte(int b1, int b2, int b3, int b4)
103 }; 132 };
104 return value; 133 return value;
105 }else 134 }
135 else
106 { 136 {
107 137
@@ -133,8 +163,11 @@ void ExcelBook::DetectEndian(void)
133 unsigned char* a = (unsigned char*) &i; 163 unsigned char* a = (unsigned char*) &i;
134 end = (*a != 0x11); 164 end = (*a != 0x11);
135 if (end == 1) { 165 if (end == 1)
166 {
136 endian = BIG_ENDIAN; 167 endian = BIG_ENDIAN;
137 printf("BIGENDIAN!\r\n"); 168 printf("BIGENDIAN!\r\n");
138 } else { 169 }
170 else
171 {
139 endian = LITTLE_ENDIAN; 172 endian = LITTLE_ENDIAN;
140 printf("LITTLEENDIAN!\r\n"); 173 printf("LITTLEENDIAN!\r\n");
@@ -149,10 +182,13 @@ double ExcelBook::Double8Byte(int b1, int b2, int b3, int b4, int b5, int b6, in
149 ieee = (unsigned char *)&d; 182 ieee = (unsigned char *)&d;
150 for (i = 0; i < 8; i++) ieee[i] = 0; 183 for (i = 0; i < 8; i++) ieee[i] = 0;
151 if (endian == BIG_ENDIAN) { 184 if (endian == BIG_ENDIAN)
185 {
152 ieee[0] = ((int)b8) & 0xff;ieee[1] = ((int)b7) & 0xff; 186 ieee[0] = ((int)b8) & 0xff;ieee[1] = ((int)b7) & 0xff;
153 ieee[2] = ((int)b6) & 0xff;ieee[3] = ((int)b5) & 0xff; 187 ieee[2] = ((int)b6) & 0xff;ieee[3] = ((int)b5) & 0xff;
154 ieee[4] = ((int)b4) & 0xff;ieee[5] = ((int)b3) & 0xff; 188 ieee[4] = ((int)b4) & 0xff;ieee[5] = ((int)b3) & 0xff;
155 ieee[6] = ((int)b2) & 0xff;ieee[7] = ((int)b1) & 0xff; 189 ieee[6] = ((int)b2) & 0xff;ieee[7] = ((int)b1) & 0xff;
156 } else { 190 }
191 else
192 {
157 ieee[0] = ((int)b1) & 0xff;ieee[1] = ((int)b2) & 0xff; 193 ieee[0] = ((int)b1) & 0xff;ieee[1] = ((int)b2) & 0xff;
158 ieee[2] = ((int)b3) & 0xff;ieee[3] = ((int)b4) & 0xff; 194 ieee[2] = ((int)b3) & 0xff;ieee[3] = ((int)b4) & 0xff;
@@ -394,5 +430,6 @@ int ExcelBook::SheetHandleRecord(ExcelSheet* sheet, ExcelBREC* record)
394 sheet->rows = Integer2Byte(data[2], data[3]); 430 sheet->rows = Integer2Byte(data[2], data[3]);
395 sheet->cols = Integer2Byte(data[6], data[7]); 431 sheet->cols = Integer2Byte(data[6], data[7]);
396 } else 432 }
433 else
397 { 434 {
398 sheet->rows = Integer4Byte(data[4], data[5], data[6], data[7]); 435 sheet->rows = Integer4Byte(data[4], data[5], data[6], data[7]);
@@ -603,5 +640,6 @@ void ExcelBook::HandleBoundSheet(ExcelBREC* rec)
603 //ascii 640 //ascii
604 name=GetASCII(data,pos,length); 641 name=GetASCII(data,pos,length);
605 }else 642 }
643 else
606 { 644 {
607 name=GetUnicode(data,pos,length); 645 name=GetUnicode(data,pos,length);
@@ -809,9 +847,11 @@ QString* ExcelBook::CellDataString(ExcelSheet* sh, int row, int col)
809 { 847 {
810 strftime(str,1024,dateformat.ascii(),tmptr); 848 strftime(str,1024,dateformat.ascii(),tmptr);
811 } else 849 }
850 else
812 { 851 {
813 strftime(str,1024,format.ascii(),tmptr); 852 strftime(str,1024,format.ascii(),tmptr);
814 }; 853 };
815 } else 854 }
855 else
816 if (XFRecords[c->xfindex]->type == NUMBERFORMAT) 856 if (XFRecords[c->xfindex]->type == NUMBERFORMAT)
817 { 857 {
@@ -822,5 +862,6 @@ QString* ExcelBook::CellDataString(ExcelSheet* sh, int row, int col)
822 precision = CellGetPrecision(c->valued); 862 precision = CellGetPrecision(c->valued);
823 sprintf(str,"%.*f",precision,c->valued); 863 sprintf(str,"%.*f",precision,c->valued);
824 }else 864 }
865 else
825 { 866 {
826 precision = CellGetPrecision(c->valued); 867 precision = CellGetPrecision(c->valued);
@@ -1003,9 +1044,11 @@ void ExcelBook::HandleFormula(ExcelSheet* sheet, ExcelBREC* record)
1003 { 1044 {
1004 // string 1045 // string
1005 } else 1046 }
1047 else
1006 if (data[6] == 1 && data[12] == -1 && data[13] == -1) 1048 if (data[6] == 1 && data[12] == -1 && data[13] == -1)
1007 { 1049 {
1008 // boolean 1050 // boolean
1009 } else 1051 }
1052 else
1010 if ( data[6] == 2 && data[12] == -1 && data[13] == -1) 1053 if ( data[6] == 2 && data[12] == -1 && data[13] == -1)
1011 { 1054 {
@@ -1124,5 +1167,6 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1124 s1=QString("""")+s1+QString(""""); 1167 s1=QString("""")+s1+QString("""");
1125 operands.prepend(new QString(s1)); 1168 operands.prepend(new QString(s1));
1126 }else 1169 }
1170 else
1127 { 1171 {
1128 w1=data[idx];idx++; 1172 w1=data[idx];idx++;
@@ -1143,5 +1187,6 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1143 w3=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col1 1187 w3=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col1
1144 w4=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col2 1188 w4=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col2
1145 }else 1189 }
1190 else
1146 { 1191 {
1147 w1=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row1 1192 w1=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row1
@@ -1162,5 +1207,6 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1162 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row 1207 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row
1163 w2=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col 1208 w2=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col
1164 }else 1209 }
1210 else
1165 { 1211 {
1166 w1=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row 1212 w1=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row
@@ -1333,5 +1379,6 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1333 w2=(int)data[idx];idx++; 1379 w2=(int)data[idx];idx++;
1334 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2; 1380 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;
1335 }else 1381 }
1382 else
1336 { 1383 {
1337 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2; 1384 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;
diff --git a/noncore/apps/opie-sheet/Excel.h b/noncore/apps/opie-sheet/Excel.h
index 0a581cf..51ccf5c 100644
--- a/noncore/apps/opie-sheet/Excel.h
+++ b/noncore/apps/opie-sheet/Excel.h
@@ -1,3 +1,36 @@
1/*
2 =. This file is part of the Opie Project
3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 .>+-=
5 _;:, .> :=|. This program is free software; you can
6.> <`_, > . <= redistribute it and/or modify it under
7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29/* QT */
30#include <qstring.h>
31#include <qarray.h>
32#include <qlist.h>
1 33
34/* STD */
2#include <stdio.h> 35#include <stdio.h>
3#include <stdlib.h> 36#include <stdlib.h>
@@ -6,7 +39,4 @@
6#include <sys/types.h> 39#include <sys/types.h>
7#include <strings.h> 40#include <strings.h>
8#include <qstring.h>
9#include <qarray.h>
10#include <qlist.h>
11 41
12#define DATEFORMAT 0x1 42#define DATEFORMAT 0x1
@@ -115,5 +145,6 @@ public:
115}; 145};
116 146
117struct mulrk { 147struct mulrk
148{
118 int row; 149 int row;
119 int first; 150 int first;
@@ -125,7 +156,4 @@ struct mulrk {
125}; 156};
126 157
127
128
129
130class ExcelBook 158class ExcelBook
131{ 159{
@@ -197,9 +225,4 @@ void HandleFormula(ExcelSheet* sheet, ExcelBREC* record);
197QString GetFormula(int row, int col, ExcelSheet* sheet, char* data, int sz); 225QString GetFormula(int row, int col, ExcelSheet* sheet, char* data, int sz);
198QString FindCellName(int row, int col); 226QString FindCellName(int row, int col);
199
200
201
202
203
204}; 227};
205 228
diff --git a/noncore/apps/opie-sheet/cellformat.cpp b/noncore/apps/opie-sheet/cellformat.cpp
index 342ebe9..602d20d 100644
--- a/noncore/apps/opie-sheet/cellformat.cpp
+++ b/noncore/apps/opie-sheet/cellformat.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -15,4 +34,5 @@
15#include "cellformat.h" 34#include "cellformat.h"
16 35
36/* QT */
17#include <qlistbox.h> 37#include <qlistbox.h>
18#include <qlabel.h> 38#include <qlabel.h>
@@ -150,6 +170,5 @@ CellFormat::CellFormat(QWidget *parent)
150 170
151CellFormat::~CellFormat() 171CellFormat::~CellFormat()
152{ 172{}
153}
154 173
155int CellFormat::findColorIndex(const QColor &color) 174int CellFormat::findColorIndex(const QColor &color)
@@ -530,6 +549,5 @@ BorderEditor::BorderEditor(QWidget *parent)
530 549
531BorderEditor::~BorderEditor() 550BorderEditor::~BorderEditor()
532{ 551{}
533}
534 552
535void BorderEditor::drawContents(QPainter *p) 553void BorderEditor::drawContents(QPainter *p)
diff --git a/noncore/apps/opie-sheet/cellformat.h b/noncore/apps/opie-sheet/cellformat.h
index b569b7f..e07af9c 100644
--- a/noncore/apps/opie-sheet/cellformat.h
+++ b/noncore/apps/opie-sheet/cellformat.h
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -16,5 +35,10 @@
16#define CELLFORMAT_H 35#define CELLFORMAT_H
17 36
37#include "sheet.h"
38
39/* OPIE */
18#include <qpe/fontdatabase.h> 40#include <qpe/fontdatabase.h>
41
42/* QT */
19#include <qdialog.h> 43#include <qdialog.h>
20#include <qtabwidget.h> 44#include <qtabwidget.h>
@@ -24,6 +48,4 @@
24#include <qpushbutton.h> 48#include <qpushbutton.h>
25 49
26#include "sheet.h"
27
28class BorderEditor: public QFrame 50class BorderEditor: public QFrame
29{ 51{
diff --git a/noncore/apps/opie-sheet/finddlg.cpp b/noncore/apps/opie-sheet/finddlg.cpp
index e4c6ec8..c724159 100644
--- a/noncore/apps/opie-sheet/finddlg.cpp
+++ b/noncore/apps/opie-sheet/finddlg.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -13,7 +32,9 @@
13 */ 32 */
14 33
34#include "finddlg.h"
35
36/* QT */
15#include <qlabel.h> 37#include <qlabel.h>
16#include <qradiobutton.h> 38#include <qradiobutton.h>
17#include "finddlg.h"
18 39
19FindDialog::FindDialog(QWidget *parent) 40FindDialog::FindDialog(QWidget *parent)
@@ -65,6 +86,5 @@ FindDialog::FindDialog(QWidget *parent)
65 86
66FindDialog::~FindDialog() 87FindDialog::~FindDialog()
67{ 88{}
68}
69 89
70void FindDialog::typeChanged(int id) 90void FindDialog::typeChanged(int id)
diff --git a/noncore/apps/opie-sheet/finddlg.h b/noncore/apps/opie-sheet/finddlg.h
index 1af2da5..b456f21 100644
--- a/noncore/apps/opie-sheet/finddlg.h
+++ b/noncore/apps/opie-sheet/finddlg.h
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -16,4 +35,7 @@
16#define FINDDLG_H 35#define FINDDLG_H
17 36
37#include "sheet.h"
38
39/* QT */
18#include <qdialog.h> 40#include <qdialog.h>
19#include <qtabwidget.h> 41#include <qtabwidget.h>
@@ -23,5 +45,4 @@
23#include <qpushbutton.h> 45#include <qpushbutton.h>
24#include <qvbuttongroup.h> 46#include <qvbuttongroup.h>
25#include "sheet.h"
26 47
27class FindDialog: public QDialog 48class FindDialog: public QDialog
diff --git a/noncore/apps/opie-sheet/main.cpp b/noncore/apps/opie-sheet/main.cpp
index 861473e..bf35908 100644
--- a/noncore/apps/opie-sheet/main.cpp
+++ b/noncore/apps/opie-sheet/main.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp
index 061748e..bb85a24 100644
--- a/noncore/apps/opie-sheet/mainwindow.cpp
+++ b/noncore/apps/opie-sheet/mainwindow.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -15,10 +34,13 @@
15#include "mainwindow.h" 34#include "mainwindow.h"
16 35
36/* OPIE */
17#include <qpe/resource.h> 37#include <qpe/resource.h>
18#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
19 39
40/* QT */
20#include <qmessagebox.h> 41#include <qmessagebox.h>
21#include <qradiobutton.h> 42#include <qradiobutton.h>
22 43
44/* STD */
23#include "cellformat.h" 45#include "cellformat.h"
24#include "numberdlg.h" 46#include "numberdlg.h"
@@ -39,5 +61,5 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
39 // construct objects 61 // construct objects
40 currentDoc=0; 62 currentDoc=0;
41 fileSelector=new FileSelector("application/sheet-qt", this, QString::null); 63 fileSelector=new FileSelector("application/opie-sheet", this, QString::null);
42 ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE); 64 ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE);
43 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide())); 65 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide()));
@@ -47,5 +69,4 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
47 connect(ExcelSelector,SIGNAL(closeMe()), this, SLOT(ExcelSelectorHide())); 69 connect(ExcelSelector,SIGNAL(closeMe()), this, SLOT(ExcelSelectorHide()));
48 70
49
50 listSheets.setAutoDelete(TRUE); 71 listSheets.setAutoDelete(TRUE);
51 72
@@ -91,5 +112,5 @@ void MainWindow::documentSave(DocLnk *lnkDoc)
91 } 112 }
92 113
93 lnkDoc->setType("application/sheet-qt"); 114 lnkDoc->setType("application/opie-sheet");
94 if (!fm.saveFile(*lnkDoc, streamBuffer)) 115 if (!fm.saveFile(*lnkDoc, streamBuffer))
95 { 116 {
diff --git a/noncore/apps/opie-sheet/mainwindow.h b/noncore/apps/opie-sheet/mainwindow.h
index eacbe36..642b7ae 100644
--- a/noncore/apps/opie-sheet/mainwindow.h
+++ b/noncore/apps/opie-sheet/mainwindow.h
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -16,6 +35,12 @@
16#define MAINWINDOW_H 35#define MAINWINDOW_H
17 36
37#include "Excel.h"
38#include "sheet.h"
39
40/* OPIE */
18#include <qpe/applnk.h> 41#include <qpe/applnk.h>
19#include <qpe/fileselector.h> 42#include <qpe/fileselector.h>
43
44/* QT */
20#include <qmenubar.h> 45#include <qmenubar.h>
21#include <qtoolbar.h> 46#include <qtoolbar.h>
@@ -26,6 +51,4 @@
26#include <qcombobox.h> 51#include <qcombobox.h>
27#include <qtoolbutton.h> 52#include <qtoolbutton.h>
28#include "Excel.h"
29#include "sheet.h"
30 53
31typedef struct typeSheet 54typedef struct typeSheet
diff --git a/noncore/apps/opie-sheet/numberdlg.cpp b/noncore/apps/opie-sheet/numberdlg.cpp
index 90fbaa2..43574e9 100644
--- a/noncore/apps/opie-sheet/numberdlg.cpp
+++ b/noncore/apps/opie-sheet/numberdlg.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -29,6 +48,5 @@ NumberDialog::NumberDialog(QWidget *parent)
29 48
30NumberDialog::~NumberDialog() 49NumberDialog::~NumberDialog()
31{ 50{}
32}
33 51
34int NumberDialog::exec(const QString &caption, const QString &text, 52int NumberDialog::exec(const QString &caption, const QString &text,
diff --git a/noncore/apps/opie-sheet/numberdlg.h b/noncore/apps/opie-sheet/numberdlg.h
index 81e3326..497c076 100644
--- a/noncore/apps/opie-sheet/numberdlg.h
+++ b/noncore/apps/opie-sheet/numberdlg.h
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -16,4 +35,5 @@
16#define NUMBERDLG_H 35#define NUMBERDLG_H
17 36
37/* QT */
18#include <qdialog.h> 38#include <qdialog.h>
19#include <qlabel.h> 39#include <qlabel.h>
diff --git a/noncore/apps/opie-sheet/opie-sheet.pro b/noncore/apps/opie-sheet/opie-sheet.pro
index ced4daf..d0beb93 100644
--- a/noncore/apps/opie-sheet/opie-sheet.pro
+++ b/noncore/apps/opie-sheet/opie-sheet.pro
@@ -1,5 +1,20 @@
1CONFIG = qt warn_on quick-app 1CONFIG = qt warn_on quick-app
2HEADERS = mainwindow.h sheet.h cellformat.h finddlg.h numberdlg.h sortdlg.h textdlg.h Excel.h 2HEADERS = mainwindow.h \
3SOURCES = main.cpp mainwindow.cpp sheet.cpp cellformat.cpp finddlg.cpp numberdlg.cpp sortdlg.cpp textdlg.cpp Excel.cpp 3 sheet.h \
4 cellformat.h \
5 finddlg.h \
6 numberdlg.h \
7 sortdlg.h \
8 textdlg.h \
9 Excel.h
10SOURCES = main.cpp \
11 mainwindow.cpp \
12 sheet.cpp \
13 cellformat.cpp \
14 finddlg.cpp \
15 numberdlg.cpp \
16 sortdlg.cpp \
17 textdlg.cpp \
18 Excel.cpp
4INCLUDEPATH += $(OPIEDIR)/include 19INCLUDEPATH += $(OPIEDIR)/include
5DEPENDPATH += $(OPIEDIR)/include 20DEPENDPATH += $(OPIEDIR)/include
diff --git a/noncore/apps/opie-sheet/sheet.cpp b/noncore/apps/opie-sheet/sheet.cpp
index 88847da..477c982 100644
--- a/noncore/apps/opie-sheet/sheet.cpp
+++ b/noncore/apps/opie-sheet/sheet.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -15,5 +34,8 @@
15#include "sheet.h" 34#include "sheet.h"
16 35
36/* QT */
17#include <qmessagebox.h> 37#include <qmessagebox.h>
38
39/* STD */
18#include <math.h> 40#include <math.h>
19#include <stdlib.h> 41#include <stdlib.h>
@@ -49,6 +71,5 @@ Sheet::Sheet(int numRows, int numCols, QWidget *parent)
49 71
50Sheet::~Sheet() 72Sheet::~Sheet()
51{ 73{}
52}
53 74
54typeCellData *Sheet::findCellData(int row, int col) 75typeCellData *Sheet::findCellData(int row, int col)
@@ -68,5 +89,6 @@ void Sheet::slotCellSelected(int row, int col)
68 { 89 {
69 emit currentDataChanged(cellData->data); 90 emit currentDataChanged(cellData->data);
70 }else 91 }
92 else
71 emit currentDataChanged(""); 93 emit currentDataChanged("");
72} 94}
@@ -229,5 +251,6 @@ double Sheet::BesselI0(double x)
229 y*=y; 251 y*=y;
230 ans=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492 +y*(0.2659732+y*(0.360768e-1+y*0.45813e-2))))); 252 ans=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492 +y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
231 }else 253 }
254 else
232 { 255 {
233 y=3.75/ax; 256 y=3.75/ax;
@@ -246,5 +269,6 @@ double Sheet::BesselI1(double x)
246 y*=y; 269 y*=y;
247 ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934 +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3)))))); 270 ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934 +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3))))));
248 } else 271 }
272 else
249 { 273 {
250 y=3.75/ax; 274 y=3.75/ax;
@@ -293,5 +317,6 @@ double Sheet::BesselK0(double x)
293 y=x*x/4.0; 317 y=x*x/4.0;
294 ans=(-log(x/2.0)*BesselI0(x))+(-0.57721566+y*(0.42278420 +y*(0.23069756+y*(0.3488590e-1+y*(0.262698e-2 +y*(0.10750e-3+y*0.74e-5)))))); 318 ans=(-log(x/2.0)*BesselI0(x))+(-0.57721566+y*(0.42278420 +y*(0.23069756+y*(0.3488590e-1+y*(0.262698e-2 +y*(0.10750e-3+y*0.74e-5))))));
295 } else 319 }
320 else
296 { 321 {
297 y=2.0/x; 322 y=2.0/x;
@@ -308,5 +333,6 @@ double Sheet::BesselK1(double x)
308 y=x*x/4.0; 333 y=x*x/4.0;
309 ans=(log(x/2.0)*BesselI1(x))+(1.0/x)*(1.0+y*(0.15443144 +y*(-0.67278579+y*(-0.18156897+y*(-0.1919402e-1 +y*(-0.110404e-2+y*(-0.4686e-4))))))); 334 ans=(log(x/2.0)*BesselI1(x))+(1.0/x)*(1.0+y*(0.15443144 +y*(-0.67278579+y*(-0.18156897+y*(-0.1919402e-1 +y*(-0.110404e-2+y*(-0.4686e-4)))))));
310 } else 335 }
336 else
311 { 337 {
312 y=2.0/x; 338 y=2.0/x;
@@ -343,5 +369,6 @@ double Sheet::BesselJ0(double x)
343 ans2=57568490411.0+y*(1029532985.0+y*(9494680.718 +y*(59272.64853+y*(267.8532712+y*1.0)))); 369 ans2=57568490411.0+y*(1029532985.0+y*(9494680.718 +y*(59272.64853+y*(267.8532712+y*1.0))));
344 ans=ans1/ans2; 370 ans=ans1/ans2;
345 } else 371 }
372 else
346 { 373 {
347 z=8.0/ax; 374 z=8.0/ax;
@@ -365,5 +392,6 @@ double Sheet::BesselY0(double x)
365 ans2=40076544269.0+y*(745249964.8+y*(7189466.438 +y*(47447.26470+y*(226.1030244+y*1.0)))); 392 ans2=40076544269.0+y*(745249964.8+y*(7189466.438 +y*(47447.26470+y*(226.1030244+y*1.0))));
366 ans=(ans1/ans2)+0.636619772*BesselJ0(x)*log(x); 393 ans=(ans1/ans2)+0.636619772*BesselJ0(x)*log(x);
367 } else 394 }
395 else
368 { 396 {
369 z=8.0/x; 397 z=8.0/x;
@@ -387,5 +415,6 @@ double Sheet::BesselJ1(double x)
387 ans2=144725228442.0+y*(2300535178.0+y*(18583304.74 +y*(99447.43394+y*(376.9991397+y*1.0)))); 415 ans2=144725228442.0+y*(2300535178.0+y*(18583304.74 +y*(99447.43394+y*(376.9991397+y*1.0))));
388 ans=ans1/ans2; 416 ans=ans1/ans2;
389 } else 417 }
418 else
390 { 419 {
391 z=8.0/ax; y=z*z; xx=ax-2.356194491; 420 z=8.0/ax; y=z*z; xx=ax-2.356194491;
@@ -408,5 +437,6 @@ double Sheet::BesselY1(double x)
408 ans2=0.2499580570e14+y*(0.4244419664e12 +y*(0.3733650367e10+y*(0.2245904002e8 +y*(0.1020426050e6+y*(0.3549632885e3+y))))); 437 ans2=0.2499580570e14+y*(0.4244419664e12 +y*(0.3733650367e10+y*(0.2245904002e8 +y*(0.1020426050e6+y*(0.3549632885e3+y)))));
409 ans=(ans1/ans2)+0.636619772*(BesselJ1(x)*log(x)-1.0/x); 438 ans=(ans1/ans2)+0.636619772*(BesselJ1(x)*log(x)-1.0/x);
410 } else 439 }
440 else
411 { 441 {
412 z=8.0/x; 442 z=8.0/x;
@@ -459,5 +489,6 @@ double Sheet::BesselJ(int n, double x)
459 } 489 }
460 ans=bj; 490 ans=bj;
461 } else 491 }
492 else
462 { 493 {
463 tox=2.0/ax; 494 tox=2.0/ax;
@@ -519,5 +550,6 @@ double Sheet::GammaP(double a, double x)
519 GammaSeries(&gamser,a,x,&gln); 550 GammaSeries(&gamser,a,x,&gln);
520 return gamser; 551 return gamser;
521 }else 552 }
553 else
522 { 554 {
523 GammaContinuedFraction(&gammcf,a,x,&gln); 555 GammaContinuedFraction(&gammcf,a,x,&gln);
@@ -545,5 +577,6 @@ void Sheet::GammaSeries(double *gamser, double a, double x, double *gln)
545 *gamser=0.0; 577 *gamser=0.0;
546 return; 578 return;
547 } else 579 }
580 else
548 { 581 {
549 ap=a; 582 ap=a;
@@ -559,5 +592,6 @@ void Sheet::GammaSeries(double *gamser, double a, double x, double *gln)
559 return; 592 return;
560 } 593 }
561 } return; 594 }
595 return;
562 return; 596 return;
563 } 597 }
@@ -663,5 +697,6 @@ double Sheet::functionSum(const QString &param1, const QString &param2)
663 } 697 }
664 return result; 698 return result;
665 }else 699 }
700 else
666 { 701 {
667 double d1=0,d2=0; 702 double d1=0,d2=0;
@@ -790,5 +825,6 @@ double Sheet::functionSumSQ(const QString &param1, const QString &param2)
790 } 825 }
791 return result; 826 return result;
792 }else 827 }
828 else
793 { 829 {
794 double d1=0,d2=0; 830 double d1=0,d2=0;
@@ -820,5 +856,6 @@ double Sheet::functionMin(const QString &param1, const QString &param2)
820 } 856 }
821 return min; 857 return min;
822 }else 858 }
859 else
823 { 860 {
824 double d1=0,d2=0; 861 double d1=0,d2=0;
@@ -848,5 +885,6 @@ double Sheet::functionMax(const QString &param1, const QString &param2)
848 }; 885 };
849 return max; 886 return max;
850 }else 887 }
888 else
851 { 889 {
852 double d1=0,d2=0; 890 double d1=0,d2=0;
@@ -878,5 +916,6 @@ double Sheet::functionCount(const QString &param1, const QString &param2)
878 }; 916 };
879 return divider; 917 return divider;
880 }else 918 }
919 else
881 { 920 {
882 double d1=0,d2=0;int ii=0; 921 double d1=0,d2=0;int ii=0;
@@ -993,10 +1032,12 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
993 { 1032 {
994 if(text(row,col).length()==0) val1=1; else val1=0; 1033 if(text(row,col).length()==0) val1=1; else val1=0;
995 }else 1034 }
1035 else
996 { 1036 {
997 if(findRowColumn(calculateVariable(getParameter(parameters, 0)), &row,&col, FALSE)) 1037 if(findRowColumn(calculateVariable(getParameter(parameters, 0)), &row,&col, FALSE))
998 { 1038 {
999 if(text(row,col).length()==0) val1=1; else val1=0; 1039 if(text(row,col).length()==0) val1=1; else val1=0;
1000 }else 1040 }
1041 else
1001 { 1042 {
1002 val1=0; 1043 val1=0;
@@ -1013,5 +1054,6 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1013 val1=text(row,col).toDouble(&ok); 1054 val1=text(row,col).toDouble(&ok);
1014 if(ok) val1=1; else val1=0; 1055 if(ok) val1=1; else val1=0;
1015 }else 1056 }
1057 else
1016 { 1058 {
1017 if(findRowColumn(calculateVariable(getParameter(parameters, 0, TRUE, function)), &row,&col, FALSE)) 1059 if(findRowColumn(calculateVariable(getParameter(parameters, 0, TRUE, function)), &row,&col, FALSE))
@@ -1019,5 +1061,6 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1019 val1=text(row,col).toDouble(&ok); 1061 val1=text(row,col).toDouble(&ok);
1020 if(ok) val1=1; else val1=0; 1062 if(ok) val1=1; else val1=0;
1021 }else 1063 }
1064 else
1022 { 1065 {
1023 val1=0; 1066 val1=0;
@@ -1390,5 +1433,6 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1390 s1=calculateVariable(getParameter(parameters, 1, TRUE, function)); 1433 s1=calculateVariable(getParameter(parameters, 1, TRUE, function));
1391 return QString(s1); 1434 return QString(s1);
1392 }else 1435 }
1436 else
1393 { 1437 {
1394 s1=calculateVariable(getParameter(parameters, 2, TRUE, function)); 1438 s1=calculateVariable(getParameter(parameters, 2, TRUE, function));
@@ -1553,5 +1597,6 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1553 { 1597 {
1554 return QString::number(GammaQ(floor(val1)+1, val2)); 1598 return QString::number(GammaQ(floor(val1)+1, val2));
1555 }else 1599 }
1600 else
1556 { 1601 {
1557 return QString::number(exp(-val2)*pow(val2,val1)/exp(GammaLn(val1+1.0))); 1602 return QString::number(exp(-val2)*pow(val2,val1)/exp(GammaLn(val1+1.0)));
@@ -1567,5 +1612,6 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1567 { 1612 {
1568 return QString::number(GammaP(val2/2.0,val1*val1/2.0)); 1613 return QString::number(GammaP(val2/2.0,val1*val1/2.0));
1569 } else 1614 }
1615 else
1570 { 1616 {
1571 return QString::number( 1617 return QString::number(
@@ -1583,5 +1629,6 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1583 { 1629 {
1584 return QString::number(GammaP(val2/2.0,val1/2.0)); 1630 return QString::number(GammaP(val2/2.0,val1/2.0));
1585 } else 1631 }
1632 else
1586 { 1633 {
1587 return QString::number( 1634 return QString::number(
@@ -2386,5 +2433,6 @@ void Expression::GetNext()
2386 }//while 2433 }//while
2387 }//else if 2434 }//else if
2388};//end function 2435}
2436;//end function
2389 2437
2390 2438
diff --git a/noncore/apps/opie-sheet/sheet.h b/noncore/apps/opie-sheet/sheet.h
index f705cd0..92c8061 100644
--- a/noncore/apps/opie-sheet/sheet.h
+++ b/noncore/apps/opie-sheet/sheet.h
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -16,4 +35,5 @@
16#define SHEET_H 35#define SHEET_H
17 36
37/* QT */
18#include <qtable.h> 38#include <qtable.h>
19#include <qstack.h> 39#include <qstack.h>
diff --git a/noncore/apps/opie-sheet/sortdlg.cpp b/noncore/apps/opie-sheet/sortdlg.cpp
index c2cdec8..47d666f 100644
--- a/noncore/apps/opie-sheet/sortdlg.cpp
+++ b/noncore/apps/opie-sheet/sortdlg.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -13,8 +32,10 @@
13 */ 32 */
14 33
34#include "sortdlg.h"
35
36/* QT */
15#include <qlabel.h> 37#include <qlabel.h>
16#include <qradiobutton.h> 38#include <qradiobutton.h>
17#include <qmessagebox.h> 39#include <qmessagebox.h>
18#include "sortdlg.h"
19 40
20SortDialog::SortDialog(QWidget *parent) 41SortDialog::SortDialog(QWidget *parent)
@@ -56,6 +77,5 @@ SortDialog::SortDialog(QWidget *parent)
56 77
57SortDialog::~SortDialog() 78SortDialog::~SortDialog()
58{ 79{}
59}
60 80
61QComboBox *SortDialog::createFieldCombo(const QString &caption, int y) 81QComboBox *SortDialog::createFieldCombo(const QString &caption, int y)
diff --git a/noncore/apps/opie-sheet/sortdlg.h b/noncore/apps/opie-sheet/sortdlg.h
index b3699a9..5a1025e 100644
--- a/noncore/apps/opie-sheet/sortdlg.h
+++ b/noncore/apps/opie-sheet/sortdlg.h
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -16,4 +35,7 @@
16#define SORTDLG_H 35#define SORTDLG_H
17 36
37#include "sheet.h"
38
39/* QT */
18#include <qdialog.h> 40#include <qdialog.h>
19#include <qtabwidget.h> 41#include <qtabwidget.h>
@@ -23,5 +45,4 @@
23#include <qpushbutton.h> 45#include <qpushbutton.h>
24#include <qvbuttongroup.h> 46#include <qvbuttongroup.h>
25#include "sheet.h"
26 47
27class SortDialog: public QDialog 48class SortDialog: public QDialog
diff --git a/noncore/apps/opie-sheet/textdlg.cpp b/noncore/apps/opie-sheet/textdlg.cpp
index 34cec29..020b9ae 100644
--- a/noncore/apps/opie-sheet/textdlg.cpp
+++ b/noncore/apps/opie-sheet/textdlg.cpp
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -29,6 +48,5 @@ TextDialog::TextDialog(QWidget *parent)
29 48
30TextDialog::~TextDialog() 49TextDialog::~TextDialog()
31{ 50{}
32}
33 51
34int TextDialog::exec(const QString &caption, const QString &text, 52int TextDialog::exec(const QString &caption, const QString &text,
diff --git a/noncore/apps/opie-sheet/textdlg.h b/noncore/apps/opie-sheet/textdlg.h
index 78ef580..d54da16 100644
--- a/noncore/apps/opie-sheet/textdlg.h
+++ b/noncore/apps/opie-sheet/textdlg.h
@@ -1,10 +1,29 @@
1/*************************************************************************** 1/*
2 * * 2 =. This file is part of the Opie Project
3 * This program is free software; you can redistribute it and/or modify * 3 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
4 * it under the terms of the GNU General Public License as published by * 4 .>+-=
5 * the Free Software Foundation; either version 2 of the License, or * 5 _;:, .> :=|. This program is free software; you can
6 * (at your option) any later version. * 6.> <`_, > . <= redistribute it and/or modify it under
7 * * 7:`=1 )Y*s>-.-- : the terms of the GNU General Public
8 ***************************************************************************/ 8.="- .-=="i, .._ License as published by the Free Software
9 - . .-<_> .<> Foundation; either version 2 of the License,
10 ._= =} : or (at your option) any later version.
11 .%`+i> _;_.
12 .i_,=:_. -<s. This program is distributed in the hope that
13 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
14 : .. .:, . . . without even the implied warranty of
15 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
16 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.= = ; Library General Public License for more
18++= -. .` .: details.
19 : = ...= . :.=-
20 -. .:....=;==+<; You should have received a copy of the GNU
21 -_. . . )=. = Library General Public License along with
22 -- :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
9 28
10/* 29/*
@@ -16,4 +35,5 @@
16#define TEXTDLG_H 35#define TEXTDLG_H
17 36
37/* QT */
18#include <qdialog.h> 38#include <qdialog.h>
19#include <qlabel.h> 39#include <qlabel.h>