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,15 +1,43 @@
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>
5#include <math.h> 34#include <math.h>
6#include <time.h> 35#include <time.h>
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[] = {
12{ 0xe , DATEFORMAT, "%m/%d/%y"}, 40{ 0xe , DATEFORMAT, "%m/%d/%y"},
13{ 0xf , DATEFORMAT, "%d-%b-%y"}, 41{ 0xf , DATEFORMAT, "%d-%b-%y"},
14{ 0x10, DATEFORMAT, "%d-%b"}, 42{ 0x10, DATEFORMAT, "%d-%b"},
15{ 0x11, DATEFORMAT, "%b-%y"}, 43{ 0x11, DATEFORMAT, "%b-%y"},
@@ -60,13 +88,14 @@ int ExcelBook::Integer4Byte(int b1,int b2,int b3,int b4)
60 int i1 = Integer2Byte(b1, b2); 88 int i1 = Integer2Byte(b1, b2);
61 int i2 = Integer2Byte(b3, b4); 89 int i2 = Integer2Byte(b3, b4);
62 int val = i2 << 16 | i1; 90 int val = i2 << 16 | i1;
63 return val; 91 return val;
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);
69 i2 = fgetc(f); 98 i2 = fgetc(f);
70 return Integer2Byte(i1,i2); 99 return Integer2Byte(i1,i2);
71}; 100};
72 101
@@ -99,13 +128,14 @@ double ExcelBook::Double4Byte(int b1, int b2, int b3, int b4)
99 printf("Double4Byte: VALUEINT=%f\r\n",value); 128 printf("Double4Byte: VALUEINT=%f\r\n",value);
100 if ( (rk & 0x01) != 0) 129 if ( (rk & 0x01) != 0)
101 { 130 {
102 value /= 100.0; 131 value /= 100.0;
103 }; 132 };
104 return value; 133 return value;
105 }else 134 }
135 else
106 { 136 {
107 137
108 union { double d; unsigned long int b[2]; } dbl_byte; 138 union { double d; unsigned long int b[2]; } dbl_byte;
109 unsigned long int valbits = (rk & 0xfffffffc); 139 unsigned long int valbits = (rk & 0xfffffffc);
110 #if defined(__arm__) && !defined(__vfp__) 140 #if defined(__arm__) && !defined(__vfp__)
111 dbl_byte.b[0]=valbits; 141 dbl_byte.b[0]=valbits;
@@ -129,34 +159,40 @@ double ExcelBook::Double4Byte(int b1, int b2, int b3, int b4)
129void ExcelBook::DetectEndian(void) 159void ExcelBook::DetectEndian(void)
130{ 160{
131 int end; 161 int end;
132 long i = 0x44332211; 162 long i = 0x44332211;
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");
141 } 174 }
142}; 175};
143 176
144double ExcelBook::Double8Byte(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8) 177double ExcelBook::Double8Byte(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8)
145{ 178{
146 int i; 179 int i;
147 double d; 180 double d;
148 unsigned char *ieee; 181 unsigned char *ieee;
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;
159 ieee[4] = ((int)b5) & 0xff;ieee[5] = ((int)b6) & 0xff; 195 ieee[4] = ((int)b5) & 0xff;ieee[5] = ((int)b6) & 0xff;
160 ieee[6] = ((int)b7) & 0xff;ieee[7] = ((int)b8) & 0xff; 196 ieee[6] = ((int)b7) & 0xff;ieee[7] = ((int)b8) & 0xff;
161 } 197 }
162 return d; 198 return d;
@@ -390,13 +426,14 @@ int ExcelBook::SheetHandleRecord(ExcelSheet* sheet, ExcelBREC* record)
390 case XL_DIMENSION: 426 case XL_DIMENSION:
391 data = GetDataOfBREC(record); 427 data = GetDataOfBREC(record);
392 if (record->length == 10) 428 if (record->length == 10)
393 { 429 {
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]);
399 sheet->cols = Integer2Byte(data[10], data[11]); 436 sheet->cols = Integer2Byte(data[10], data[11]);
400 } 437 }
401 sheet->InitCells(); 438 sheet->InitCells();
402 break; 439 break;
@@ -599,13 +636,14 @@ void ExcelBook::HandleBoundSheet(ExcelBREC* rec)
599 visibility = data[5]; 636 visibility = data[5];
600 length = data[6]; 637 length = data[6];
601 if(data[7]==0) 638 if(data[7]==0)
602 { 639 {
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);
608 }; 646 };
609 Names.resize(Names.count()+1); 647 Names.resize(Names.count()+1);
610 Names[Names.count()-1]=new QString(name); 648 Names[Names.count()-1]=new QString(name);
611}; 649};
@@ -805,26 +843,29 @@ QString* ExcelBook::CellDataString(ExcelSheet* sh, int row, int col)
805 format = XFRecords[c->xfindex]->format; 843 format = XFRecords[c->xfindex]->format;
806 date = (time_t) ((c->valued - utcOffsetDays) * sInADay); 844 date = (time_t) ((c->valued - utcOffsetDays) * sInADay);
807 tmptr = gmtime(&date); 845 tmptr = gmtime(&date);
808 if (dateformat) 846 if (dateformat)
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 {
818 format = XFRecords[c->xfindex]->format; 858 format = XFRecords[c->xfindex]->format;
819 //sprintf(str,format.ascii(),c->valued); 859 //sprintf(str,format.ascii(),c->valued);
820 // the real format is ignored... 860 // the real format is ignored...
821 // because there is more work to be done in the field 861 // because there is more work to be done in the field
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);
827 sprintf(str,"%.*f",precision,c->valued); 868 sprintf(str,"%.*f",precision,c->valued);
828 }; 869 };
829 break; 870 break;
830 case CELL_DATE: 871 case CELL_DATE:
@@ -999,17 +1040,19 @@ void ExcelBook::HandleFormula(ExcelSheet* sheet, ExcelBREC* record)
999 data = GetDataOfBREC(record); 1040 data = GetDataOfBREC(record);
1000 row = Integer2Byte(data[0], data[1]); 1041 row = Integer2Byte(data[0], data[1]);
1001 col = Integer2Byte(data[2], data[3]); 1042 col = Integer2Byte(data[2], data[3]);
1002 if (data[6] == 0 && data[12] == -1 && data[13] == -1) 1043 if (data[6] == 0 && data[12] == -1 && data[13] == -1)
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 {
1012 // error 1055 // error
1013 } 1056 }
1014 else 1057 else
1015 { 1058 {
@@ -1120,13 +1163,14 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1120 if (fareaststring) 1163 if (fareaststring)
1121 { 1164 {
1122 idx += fareastsize; 1165 idx += fareastsize;
1123 }; 1166 };
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++;
1129 s1=GetASCII(data,idx,w1); 1173 s1=GetASCII(data,idx,w1);
1130 s1=QString("""")+s1+QString(""""); 1174 s1=QString("""")+s1+QString("""");
1131 idx=idx+w1; 1175 idx=idx+w1;
1132 operands.prepend(new QString(s1)); 1176 operands.prepend(new QString(s1));
@@ -1139,13 +1183,14 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1139 if(Version==8) 1183 if(Version==8)
1140 { 1184 {
1141 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row1 1185 w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row1
1142 w2=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row2 1186 w2=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row2
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
1148 w2=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row2 1193 w2=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row2
1149 w3=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col1 1194 w3=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col1
1150 w4=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col2 1195 w4=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col2
1151 }; 1196 };
@@ -1158,13 +1203,14 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1158 case 0x44: 1203 case 0x44:
1159 case 0x64://ptgRef 1204 case 0x64://ptgRef
1160 if(Version==8) 1205 if(Version==8)
1161 { 1206 {
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
1167 w2=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col 1213 w2=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col
1168 }; 1214 };
1169 s1=FindCellName(w1,w2); 1215 s1=FindCellName(w1,w2);
1170 printf("token:ptgRef,ref=%s\r\n",s1.ascii()); 1216 printf("token:ptgRef,ref=%s\r\n",s1.ascii());
@@ -1329,13 +1375,14 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
1329 case 0x61://ptgFunction 1375 case 0x61://ptgFunction
1330 printf("token:ptgFunction\r\n"); 1376 printf("token:ptgFunction\r\n");
1331 if(token==0x22||token==0x42||token==0x62) 1377 if(token==0x22||token==0x42||token==0x62)
1332 { 1378 {
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;
1338 }; 1385 };
1339 switch(w1) 1386 switch(w1)
1340 { 1387 {
1341 case 0xf://SIN 1388 case 0xf://SIN
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,16 +1,46 @@
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>
4#include <math.h> 37#include <math.h>
5#include <time.h> 38#include <time.h>
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
13#define NUMBERFORMAT 0x2 43#define NUMBERFORMAT 0x2
14 44
15#define BIFF8 0x600 45#define BIFF8 0x600
16#define BIFF7 0x500 46#define BIFF7 0x500
@@ -111,25 +141,23 @@ public:
111 bool InitCells(void); // true if ok 141 bool InitCells(void); // true if ok
112 ExcelCell* Get(int row, int col); 142 ExcelCell* Get(int row, int col);
113 void Set(int row, int col, ExcelCell* cell); 143 void Set(int row, int col, ExcelCell* cell);
114 144
115}; 145};
116 146
117struct mulrk { 147struct mulrk
148{
118 int row; 149 int row;
119 int first; 150 int first;
120 int last; 151 int last;
121 int numrks; 152 int numrks;
122 QArray<int> rknumbers; 153 QArray<int> rknumbers;
123 QArray<double> rkdbls; 154 QArray<double> rkdbls;
124 QArray<int> xfindices; 155 QArray<int> xfindices;
125}; 156};
126 157
127
128
129
130class ExcelBook 158class ExcelBook
131{ 159{
132public: 160public:
133FILE *File; 161FILE *File;
134int Position; 162int Position;
135//int stringcount; 163//int stringcount;
@@ -193,13 +221,8 @@ void HandleNumber(ExcelSheet* sheet, ExcelBREC* record);
193void HandleFormat(ExcelBREC* rec); 221void HandleFormat(ExcelBREC* rec);
194void HandleXF(ExcelBREC* rec); 222void HandleXF(ExcelBREC* rec);
195void HandleRK(ExcelSheet* sheet, ExcelBREC* record); 223void HandleRK(ExcelSheet* sheet, ExcelBREC* record);
196void HandleFormula(ExcelSheet* sheet, ExcelBREC* record); 224void 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,22 +1,42 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
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>
19 39
20#define COMBO_WIDTHS 155 40#define COMBO_WIDTHS 155
21#define COMBO_HEIGHTS 21 41#define COMBO_HEIGHTS 21
22 42
@@ -146,14 +166,13 @@ CellFormat::CellFormat(QWidget *parent)
146 box->addWidget(tabs); 166 box->addWidget(tabs);
147 167
148 setCaption(tr("Format Cells")); 168 setCaption(tr("Format Cells"));
149} 169}
150 170
151CellFormat::~CellFormat() 171CellFormat::~CellFormat()
152{ 172{}
153}
154 173
155int CellFormat::findColorIndex(const QColor &color) 174int CellFormat::findColorIndex(const QColor &color)
156{ 175{
157 for (int i=0; i<COLOR_COUNT; ++i) 176 for (int i=0; i<COLOR_COUNT; ++i)
158 if (qtColors[i]==color) 177 if (qtColors[i]==color)
159 return i; 178 return i;
@@ -526,14 +545,13 @@ BorderEditor::BorderEditor(QWidget *parent)
526 :QFrame(parent) 545 :QFrame(parent)
527{ 546{
528 setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); 547 setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
529} 548}
530 549
531BorderEditor::~BorderEditor() 550BorderEditor::~BorderEditor()
532{ 551{}
533}
534 552
535void BorderEditor::drawContents(QPainter *p) 553void BorderEditor::drawContents(QPainter *p)
536{ 554{
537 QFrame::drawContents(p); 555 QFrame::drawContents(p);
538 556
539 int x=contentsRect().x(), y=contentsRect().y(), width=contentsRect().width()/3, height=contentsRect().height()/3; 557 int x=contentsRect().x(), y=contentsRect().y(), width=contentsRect().width()/3, height=contentsRect().height()/3;
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,33 +1,55 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef CELLFORMAT_H 34#ifndef CELLFORMAT_H
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>
21#include <qlayout.h> 45#include <qlayout.h>
22#include <qcombobox.h> 46#include <qcombobox.h>
23#include <qcheckbox.h> 47#include <qcheckbox.h>
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{
30 Q_OBJECT 52 Q_OBJECT
31 53
32 // QT objects 54 // QT objects
33 QPen penTop, penBottom, penLeft, penRight, penHorz, penVert; 55 QPen penTop, penBottom, penLeft, penRight, penHorz, penVert;
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,23 +1,44 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
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)
20 :QDialog(parent, 0, TRUE) 41 :QDialog(parent, 0, TRUE)
21{ 42{
22 // Main widget 43 // Main widget
23 tabs=new QTabWidget(this); 44 tabs=new QTabWidget(this);
@@ -61,14 +82,13 @@ FindDialog::FindDialog(QWidget *parent)
61 box->addWidget(tabs); 82 box->addWidget(tabs);
62 83
63 setCaption(tr("Find & Replace")); 84 setCaption(tr("Find & Replace"));
64} 85}
65 86
66FindDialog::~FindDialog() 87FindDialog::~FindDialog()
67{ 88{}
68}
69 89
70void FindDialog::typeChanged(int id) 90void FindDialog::typeChanged(int id)
71{ 91{
72 editReplace->setEnabled(id>0); 92 editReplace->setEnabled(id>0);
73} 93}
74 94
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,31 +1,52 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef FINDDLG_H 34#ifndef FINDDLG_H
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>
20#include <qlayout.h> 42#include <qlayout.h>
21#include <qlineedit.h> 43#include <qlineedit.h>
22#include <qcheckbox.h> 44#include <qcheckbox.h>
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
28{ 49{
29 Q_OBJECT 50 Q_OBJECT
30 51
31 // QT objects 52 // QT objects
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,14 +1,33 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
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,28 +1,50 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
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"
25#include "textdlg.h" 47#include "textdlg.h"
26#include "sortdlg.h" 48#include "sortdlg.h"
27#include "finddlg.h" 49#include "finddlg.h"
28 50
@@ -35,21 +57,20 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
35{ 57{
36 // initialize variables 58 // initialize variables
37 documentModified=FALSE; 59 documentModified=FALSE;
38 60
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()));
44 connect(fileSelector, SIGNAL(newSelected(const DocLnk&)), this, SLOT(selectorFileNew(const DocLnk&))); 66 connect(fileSelector, SIGNAL(newSelected(const DocLnk&)), this, SLOT(selectorFileNew(const DocLnk&)));
45 connect(fileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(selectorFileOpen(const DocLnk&))); 67 connect(fileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(selectorFileOpen(const DocLnk&)));
46 connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk&)),this,SLOT(slotImportExcel(const DocLnk&))); 68 connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk&)),this,SLOT(slotImportExcel(const DocLnk&)));
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
52 initActions(); 73 initActions();
53 initMenu(); 74 initMenu();
54 initEditToolbar(); 75 initEditToolbar();
55 initFunctionsToolbar(); 76 initFunctionsToolbar();
@@ -87,13 +108,13 @@ void MainWindow::documentSave(DocLnk *lnkDoc)
87 { 108 {
88 stream << tempSheet->name << (Q_UINT32)tempSheet->data.count(); 109 stream << tempSheet->name << (Q_UINT32)tempSheet->data.count();
89 for (typeCellData *tempCell=tempSheet->data.first(); tempCell; tempCell=tempSheet->data.next()) 110 for (typeCellData *tempCell=tempSheet->data.first(); tempCell; tempCell=tempSheet->data.next())
90 stream << (Q_UINT32)tempCell->col << (Q_UINT32)tempCell->row << tempCell->borders.right << tempCell->borders.bottom << tempCell->background << (Q_UINT32)tempCell->alignment << tempCell->fontColor << tempCell->font << tempCell->data; 111 stream << (Q_UINT32)tempCell->col << (Q_UINT32)tempCell->row << tempCell->borders.right << tempCell->borders.bottom << tempCell->background << (Q_UINT32)tempCell->alignment << tempCell->fontColor << tempCell->font << tempCell->data;
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 {
96 QMessageBox::critical(this, tr("Error"), tr("File cannot be saved!")); 117 QMessageBox::critical(this, tr("Error"), tr("File cannot be saved!"));
97 return; 118 return;
98 } 119 }
99 documentModified=FALSE; 120 documentModified=FALSE;
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,35 +1,58 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef MAINWINDOW_H 34#ifndef MAINWINDOW_H
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>
22#include <qmainwindow.h> 47#include <qmainwindow.h>
23#include <qaction.h> 48#include <qaction.h>
24#include <qlineedit.h> 49#include <qlineedit.h>
25#include <qbutton.h> 50#include <qbutton.h>
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
32{ 55{
33 QString name; 56 QString name;
34 QList<typeCellData> data; 57 QList<typeCellData> data;
35}; 58};
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,14 +1,33 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
@@ -25,14 +44,13 @@ NumberDialog::NumberDialog(QWidget *parent)
25 label->setBuddy(edit); 44 label->setBuddy(edit);
26 45
27 resize(200, 45); 46 resize(200, 45);
28} 47}
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,
35 int value, int min, int max, int step) 53 int value, int min, int max, int step)
36{ 54{
37 setCaption(caption); 55 setCaption(caption);
38 label->setText(text); 56 label->setText(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,23 +1,43 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef NUMBERDLG_H 34#ifndef NUMBERDLG_H
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>
20#include <qspinbox.h> 40#include <qspinbox.h>
21 41
22class NumberDialog: public QDialog 42class NumberDialog: public QDialog
23{ 43{
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,9 +1,24 @@
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
6LIBS += -lqpe -lopiecore2 21LIBS += -lqpe -lopiecore2
7TARGET = opie-sheet 22TARGET = opie-sheet
8 23
9include ( $(OPIEDIR)/include.pro ) 24include ( $(OPIEDIR)/include.pro )
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,23 +1,45 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
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>
20#include <stdio.h> 42#include <stdio.h>
21#include <time.h> 43#include <time.h>
22 44
23#define DEFAULT_COL_WIDTH 50 45#define DEFAULT_COL_WIDTH 50
@@ -45,14 +67,13 @@ Sheet::Sheet(int numRows, int numCols, QWidget *parent)
45 67
46 connect(this, SIGNAL(currentChanged(int,int)), this, SLOT(slotCellSelected(int,int))); 68 connect(this, SIGNAL(currentChanged(int,int)), this, SLOT(slotCellSelected(int,int)));
47 connect(this, SIGNAL(valueChanged(int,int)), this, SLOT(slotCellChanged(int,int))); 69 connect(this, SIGNAL(valueChanged(int,int)), this, SLOT(slotCellChanged(int,int)));
48} 70}
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)
55{ 76{
56 typeCellData *tempCellData; 77 typeCellData *tempCellData;
57 for (tempCellData=sheetData.first(); tempCellData; tempCellData=sheetData.next()) 78 for (tempCellData=sheetData.first(); tempCellData; tempCellData=sheetData.next())
58 { 79 {
@@ -64,13 +85,14 @@ typeCellData *Sheet::findCellData(int row, int col)
64void Sheet::slotCellSelected(int row, int col) 85void Sheet::slotCellSelected(int row, int col)
65{ 86{
66 typeCellData *cellData=findCellData(row, col); 87 typeCellData *cellData=findCellData(row, col);
67 if (cellData) 88 if (cellData)
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}
73 95
74typeCellData *Sheet::createCellData(int row, int col) 96typeCellData *Sheet::createCellData(int row, int col)
75{ 97{
76 if (row<0 || col<0) return NULL; 98 if (row<0 || col<0) return NULL;
@@ -225,13 +247,14 @@ double Sheet::BesselI0(double x)
225 double y; 247 double y;
226 if ((ax=fabs(x)) < 3.75) 248 if ((ax=fabs(x)) < 3.75)
227 { 249 {
228 y=x/3.75; 250 y=x/3.75;
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;
234 ans=(exp(ax)/sqrt(ax))*(0.39894228+y*(0.1328592e-1 +y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2 +y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1 +y*0.392377e-2)))))))); 257 ans=(exp(ax)/sqrt(ax))*(0.39894228+y*(0.1328592e-1 +y*(0.225319e-2+y*(-0.157565e-2+y*(0.916281e-2 +y*(-0.2057706e-1+y*(0.2635537e-1+y*(-0.1647633e-1 +y*0.392377e-2))))))));
235 } 258 }
236 return ans; 259 return ans;
237}; 260};
@@ -242,13 +265,14 @@ double Sheet::BesselI1(double x)
242 double y; 265 double y;
243 if ((ax=fabs(x)) < 3.75) 266 if ((ax=fabs(x)) < 3.75)
244 { 267 {
245 y=x/3.75; 268 y=x/3.75;
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;
251 ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1 -y*0.420059e-2)); ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2 +y*(0.163801e-2+y*(-0.1031555e-1+y*ans)))); 275 ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1 -y*0.420059e-2)); ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2 +y*(0.163801e-2+y*(-0.1031555e-1+y*ans))));
252 ans *= (exp(ax)/sqrt(ax)); 276 ans *= (exp(ax)/sqrt(ax));
253 } 277 }
254 return x < 0.0 ? -ans : ans; 278 return x < 0.0 ? -ans : ans;
@@ -289,13 +313,14 @@ double Sheet::BesselK0(double x)
289{ 313{
290 double y,ans; 314 double y,ans;
291 if (x <= 2.0) 315 if (x <= 2.0)
292 { 316 {
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;
298 ans=(exp(-x)/sqrt(x))*(1.25331414+y*(-0.7832358e-1 +y*(0.2189568e-1+y*(-0.1062446e-1+y*(0.587872e-2 +y*(-0.251540e-2+y*0.53208e-3)))))); 323 ans=(exp(-x)/sqrt(x))*(1.25331414+y*(-0.7832358e-1 +y*(0.2189568e-1+y*(-0.1062446e-1+y*(0.587872e-2 +y*(-0.251540e-2+y*0.53208e-3))))));
299 } 324 }
300return ans; 325return ans;
301}; 326};
@@ -304,13 +329,14 @@ double Sheet::BesselK1(double x)
304{ 329{
305 double y,ans; 330 double y,ans;
306 if (x <= 2.0) 331 if (x <= 2.0)
307 { 332 {
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;
313 ans=(exp(-x)/sqrt(x))*(1.25331414+y*(0.23498619 +y*(-0.3655620e-1+y*(0.1504268e-1+y*(-0.780353e-2 +y*(0.325614e-2+y*(-0.68245e-3))))))); 339 ans=(exp(-x)/sqrt(x))*(1.25331414+y*(0.23498619 +y*(-0.3655620e-1+y*(0.1504268e-1+y*(-0.780353e-2 +y*(0.325614e-2+y*(-0.68245e-3)))))));
314 } 340 }
315 return ans; 341 return ans;
316}; 342};
@@ -339,13 +365,14 @@ double Sheet::BesselJ0(double x)
339 if ((ax=fabs(x)) < 8.0) 365 if ((ax=fabs(x)) < 8.0)
340 { 366 {
341 y=x*x; 367 y=x*x;
342 ans1=57568490574.0+y*(-13362590354.0+y*(651619640.7 +y*(-11214424.18+y*(77392.33017+y*(-184.9052456))))); 368 ans1=57568490574.0+y*(-13362590354.0+y*(651619640.7 +y*(-11214424.18+y*(77392.33017+y*(-184.9052456)))));
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;
348 y=z*z; 375 y=z*z;
349 xx=ax-0.785398164; 376 xx=ax-0.785398164;
350 ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4 +y*(-0.2073370639e-5+y*0.2093887211e-6))); 377 ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4 +y*(-0.2073370639e-5+y*0.2093887211e-6)));
351 ans2 = -0.1562499995e-1+y*(0.1430488765e-3 +y*(-0.6911147651e-5+y*(0.7621095161e-6 -y*0.934935152e-7))); 378 ans2 = -0.1562499995e-1+y*(0.1430488765e-3 +y*(-0.6911147651e-5+y*(0.7621095161e-6 -y*0.934935152e-7)));
@@ -361,13 +388,14 @@ double Sheet::BesselY0(double x)
361 if (x < 8.0) 388 if (x < 8.0)
362 { 389 {
363 y=x*x; 390 y=x*x;
364 ans1 = -2957821389.0+y*(7062834065.0+y*(-512359803.6 +y*(10879881.29+y*(-86327.92757+y*228.4622733)))); 391 ans1 = -2957821389.0+y*(7062834065.0+y*(-512359803.6 +y*(10879881.29+y*(-86327.92757+y*228.4622733))));
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;
370 y=z*z; 398 y=z*z;
371 xx=x-0.785398164; 399 xx=x-0.785398164;
372 ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4 +y*(-0.2073370639e-5+y*0.2093887211e-6))); 400 ans1=1.0+y*(-0.1098628627e-2+y*(0.2734510407e-4 +y*(-0.2073370639e-5+y*0.2093887211e-6)));
373 ans2 = -0.1562499995e-1+y*(0.1430488765e-3 +y*(-0.6911147651e-5+y*(0.7621095161e-6 +y*(-0.934945152e-7)))); 401 ans2 = -0.1562499995e-1+y*(0.1430488765e-3 +y*(-0.6911147651e-5+y*(0.7621095161e-6 +y*(-0.934945152e-7))));
@@ -383,13 +411,14 @@ double Sheet::BesselJ1(double x)
383 if ((ax=fabs(x)) < 8.0) 411 if ((ax=fabs(x)) < 8.0)
384 { 412 {
385 y=x*x; 413 y=x*x;
386 ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1 +y*(-2972611.439+y*(15704.48260+y*(-30.16036606)))))); 414 ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1 +y*(-2972611.439+y*(15704.48260+y*(-30.16036606))))));
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;
392 ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4 +y*(0.2457520174e-5+y*(-0.240337019e-6)))); 421 ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4 +y*(0.2457520174e-5+y*(-0.240337019e-6))));
393 ans2=0.04687499995+y*(-0.2002690873e-3 +y*(0.8449199096e-5+y*(-0.88228987e-6 +y*0.105787412e-6))); 422 ans2=0.04687499995+y*(-0.2002690873e-3 +y*(0.8449199096e-5+y*(-0.88228987e-6 +y*0.105787412e-6)));
394 ans=sqrt(0.636619772/ax)*(cos(xx)*ans1-z*sin(xx)*ans2); 423 ans=sqrt(0.636619772/ax)*(cos(xx)*ans1-z*sin(xx)*ans2);
395 if (x < 0.0) ans = -ans; 424 if (x < 0.0) ans = -ans;
@@ -404,13 +433,14 @@ double Sheet::BesselY1(double x)
404 if (x < 8.0) 433 if (x < 8.0)
405 { 434 {
406 y=x*x; 435 y=x*x;
407 ans1=x*(-0.4900604943e13+y*(0.1275274390e13 +y*(-0.5153438139e11+y*(0.7349264551e9 +y*(-0.4237922726e7+y*0.8511937935e4))))); 436 ans1=x*(-0.4900604943e13+y*(0.1275274390e13 +y*(-0.5153438139e11+y*(0.7349264551e9 +y*(-0.4237922726e7+y*0.8511937935e4)))));
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;
413 y=z*z; 443 y=z*z;
414 xx=x-2.356194491; 444 xx=x-2.356194491;
415 ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4 +y*(0.2457520174e-5+y*(-0.240337019e-6)))); 445 ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4 +y*(0.2457520174e-5+y*(-0.240337019e-6))));
416 ans2=0.04687499995+y*(-0.2002690873e-3 +y*(0.8449199096e-5+y*(-0.88228987e-6 +y*0.105787412e-6))); 446 ans2=0.04687499995+y*(-0.2002690873e-3 +y*(0.8449199096e-5+y*(-0.88228987e-6 +y*0.105787412e-6)));
@@ -455,13 +485,14 @@ double Sheet::BesselJ(int n, double x)
455 { 485 {
456 bjp=j*tox*bj-bjm; 486 bjp=j*tox*bj-bjm;
457 bjm=bj; 487 bjm=bj;
458 bj=bjp; 488 bj=bjp;
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;
464 m=2*((n+(int) sqrt(ACC*n))/2); 495 m=2*((n+(int) sqrt(ACC*n))/2);
465 jsum=0; 496 jsum=0;
466 bjp=ans=sum=0.0; 497 bjp=ans=sum=0.0;
467 bj=1.0; 498 bj=1.0;
@@ -515,13 +546,14 @@ double Sheet::GammaP(double a, double x)
515 double gamser,gammcf,gln; 546 double gamser,gammcf,gln;
516 if (x < 0.0 || a <= 0.0) return 0.0;//error 547 if (x < 0.0 || a <= 0.0) return 0.0;//error
517 if (x < (a+1.0)) 548 if (x < (a+1.0))
518 { 549 {
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);
524 return 1.0-gammcf; 556 return 1.0-gammcf;
525 } 557 }
526}; 558};
527 559
@@ -541,13 +573,14 @@ void Sheet::GammaSeries(double *gamser, double a, double x, double *gln)
541 *gln=GammaLn(a); 573 *gln=GammaLn(a);
542 if (x <= 0.0) 574 if (x <= 0.0)
543 { 575 {
544 if (x < 0.0) return;//error 576 if (x < 0.0) return;//error
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;
550 del=sum=1.0/a; 583 del=sum=1.0/a;
551 for (n=1;n<=ITMAX;n++) 584 for (n=1;n<=ITMAX;n++)
552 { 585 {
553 ++ap; 586 ++ap;
@@ -555,13 +588,14 @@ void Sheet::GammaSeries(double *gamser, double a, double x, double *gln)
555 sum += del; 588 sum += del;
556 if (fabs(del) < fabs(sum)*EPS) 589 if (fabs(del) < fabs(sum)*EPS)
557 { 590 {
558 *gamser=sum*exp(-x+a*log(x)-(*gln)); 591 *gamser=sum*exp(-x+a*log(x)-(*gln));
559 return; 592 return;
560 } 593 }
561 } return; 594 }
595 return;
562 return; 596 return;
563 } 597 }
564}; 598};
565 599
566 600
567void Sheet::GammaContinuedFraction(double *gammcf, double a, double x, double *gln) 601void Sheet::GammaContinuedFraction(double *gammcf, double a, double x, double *gln)
@@ -659,13 +693,14 @@ double Sheet::functionSum(const QString &param1, const QString &param2)
659 for (col=col1; col<=col2; ++col) 693 for (col=col1; col<=col2; ++col)
660 { 694 {
661 tempResult=text(row, col).toDouble(&ok); 695 tempResult=text(row, col).toDouble(&ok);
662 if (ok) result+=tempResult; 696 if (ok) result+=tempResult;
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;
668 d1=calculateVariable(param1).toDouble(&ok); 703 d1=calculateVariable(param1).toDouble(&ok);
669 d2=calculateVariable(param2).toDouble(&ok); 704 d2=calculateVariable(param2).toDouble(&ok);
670 return(d1+d2); 705 return(d1+d2);
671 }; 706 };
@@ -786,13 +821,14 @@ double Sheet::functionSumSQ(const QString &param1, const QString &param2)
786 for (col=col1; col<=col2; ++col) 821 for (col=col1; col<=col2; ++col)
787 { 822 {
788 tempResult=text(row, col).toDouble(&ok); 823 tempResult=text(row, col).toDouble(&ok);
789 if (ok) result+=tempResult*tempResult; 824 if (ok) result+=tempResult*tempResult;
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;
795 d1=calculateVariable(param1).toDouble(&ok); 831 d1=calculateVariable(param1).toDouble(&ok);
796 d2=calculateVariable(param2).toDouble(&ok); 832 d2=calculateVariable(param2).toDouble(&ok);
797 return(d1*d1+d2*d2); 833 return(d1*d1+d2*d2);
798 }; 834 };
@@ -816,13 +852,14 @@ double Sheet::functionMin(const QString &param1, const QString &param2)
816 { 852 {
817 min=tempMin; 853 min=tempMin;
818 init=TRUE; 854 init=TRUE;
819 } 855 }
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;
825 d1=calculateVariable(param1).toDouble(&ok); 862 d1=calculateVariable(param1).toDouble(&ok);
826 d2=calculateVariable(param2).toDouble(&ok); 863 d2=calculateVariable(param2).toDouble(&ok);
827 if(d1<d2) return(d1); else return(d2); 864 if(d1<d2) return(d1); else return(d2);
828 }; 865 };
@@ -844,13 +881,14 @@ double Sheet::functionMax(const QString &param1, const QString &param2)
844 { 881 {
845 max=tempMax; 882 max=tempMax;
846 init=TRUE; 883 init=TRUE;
847 } 884 }
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;
853 d1=calculateVariable(param1).toDouble(&ok); 891 d1=calculateVariable(param1).toDouble(&ok);
854 d2=calculateVariable(param2).toDouble(&ok); 892 d2=calculateVariable(param2).toDouble(&ok);
855 if(d1>d2) return(d1); else return(d2); 893 if(d1>d2) return(d1); else return(d2);
856 }; 894 };
@@ -874,13 +912,14 @@ double Sheet::functionCount(const QString &param1, const QString &param2)
874 for (col=col1; col<=col2; ++col) 912 for (col=col1; col<=col2; ++col)
875 { 913 {
876 text(row, col).toDouble(&ok); 914 text(row, col).toDouble(&ok);
877 if (ok) ++divider; 915 if (ok) ++divider;
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;
883 d1=calculateVariable(param1).toDouble(&ok); 922 d1=calculateVariable(param1).toDouble(&ok);
884 if (ok) ii++; 923 if (ok) ii++;
885 d2=calculateVariable(param2).toDouble(&ok); 924 d2=calculateVariable(param2).toDouble(&ok);
886 if (ok) ii++; 925 if (ok) ii++;
@@ -989,18 +1028,20 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
989 //LOGICAL / INFO 1028 //LOGICAL / INFO
990 if (function=="ISBLANK") 1029 if (function=="ISBLANK")
991 { 1030 {
992 if(findRowColumn(getParameter(parameters, 0), &row, &col, FALSE)) 1031 if(findRowColumn(getParameter(parameters, 0), &row, &col, FALSE))
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;
1003 }; 1044 };
1004 }; 1045 };
1005 return QString::number(val1); 1046 return QString::number(val1);
1006 }; 1047 };
@@ -1009,19 +1050,21 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1009 if (function=="ISNUMBER") 1050 if (function=="ISNUMBER")
1010 { 1051 {
1011 if(findRowColumn(getParameter(parameters, 0, TRUE, function), &row, &col, FALSE)) 1052 if(findRowColumn(getParameter(parameters, 0, TRUE, function), &row, &col, FALSE))
1012 { 1053 {
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))
1018 { 1060 {
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;
1024 }; 1067 };
1025 }; 1068 };
1026 return QString::number(val1); 1069 return QString::number(val1);
1027 }; 1070 };
@@ -1386,13 +1429,14 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1386 //returns param4 if true(param1)/ param5 if false(param1) 1429 //returns param4 if true(param1)/ param5 if false(param1)
1387 val1=getParameter(parameters, 0, TRUE, function).toDouble(&ok); 1430 val1=getParameter(parameters, 0, TRUE, function).toDouble(&ok);
1388 if(val1==1.0) 1431 if(val1==1.0)
1389 { 1432 {
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));
1395 return QString(s1); 1439 return QString(s1);
1396 }; 1440 };
1397 }; 1441 };
1398 if (function=="SUM") 1442 if (function=="SUM")
@@ -1549,13 +1593,14 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1549 val1=calculateVariable(getParameter(parameters, 0, TRUE, function)).toDouble(&ok); 1593 val1=calculateVariable(getParameter(parameters, 0, TRUE, function)).toDouble(&ok);
1550 val2=calculateVariable(getParameter(parameters, 1, TRUE, function)).toDouble(&ok); 1594 val2=calculateVariable(getParameter(parameters, 1, TRUE, function)).toDouble(&ok);
1551 vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok); 1595 vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok);
1552 if(vali==1) 1596 if(vali==1)
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)));
1558 }; 1603 };
1559 }; 1604 };
1560 if(function=="CHIDIST") 1605 if(function=="CHIDIST")
1561 { 1606 {
@@ -1563,13 +1608,14 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1563 val1=calculateVariable(getParameter(parameters, 0, TRUE, function)).toDouble(&ok); 1608 val1=calculateVariable(getParameter(parameters, 0, TRUE, function)).toDouble(&ok);
1564 val2=calculateVariable(getParameter(parameters, 1, TRUE, function)).toDouble(&ok); 1609 val2=calculateVariable(getParameter(parameters, 1, TRUE, function)).toDouble(&ok);
1565 vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok); 1610 vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok);
1566 if(vali==1) 1611 if(vali==1)
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(
1572 pow(val1,val2-1.0)*exp(-val1*val1/2)/ ( pow(2,val2/2.0-1.0)*exp(GammaLn(val2/2.0))) 1618 pow(val1,val2-1.0)*exp(-val1*val1/2)/ ( pow(2,val2/2.0-1.0)*exp(GammaLn(val2/2.0)))
1573 ); 1619 );
1574 }; 1620 };
1575 }; 1621 };
@@ -1579,13 +1625,14 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
1579 val1=calculateVariable(getParameter(parameters, 0, TRUE, function)).toDouble(&ok); 1625 val1=calculateVariable(getParameter(parameters, 0, TRUE, function)).toDouble(&ok);
1580 val2=calculateVariable(getParameter(parameters, 1, TRUE, function)).toDouble(&ok); 1626 val2=calculateVariable(getParameter(parameters, 1, TRUE, function)).toDouble(&ok);
1581 vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok); 1627 vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok);
1582 if(vali==1) 1628 if(vali==1)
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(
1588 pow(val1,val2/2.0-1.0)/(exp(val1/2.0)*pow(sqrt(2.0),val2)*exp(GammaLn(val2/2.0))) 1635 pow(val1,val2/2.0-1.0)/(exp(val1/2.0)*pow(sqrt(2.0),val2)*exp(GammaLn(val2/2.0)))
1589 ); 1636 );
1590 }; 1637 };
1591 }; 1638 };
@@ -2382,13 +2429,14 @@ void Expression::GetNext()
2382 else 2429 else
2383 { 2430 {
2384 break; 2431 break;
2385 } 2432 }
2386 }//while 2433 }//while
2387 }//else if 2434 }//else if
2388};//end function 2435}
2436;//end function
2389 2437
2390 2438
2391void Expression::First() 2439void Expression::First()
2392{ 2440{
2393 GetNext(); 2441 GetNext();
2394 if (!(chunk=="") && !ErrorFound) Third(); 2442 if (!(chunk=="") && !ErrorFound) Third();
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,23 +1,43 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef SHEET_H 34#ifndef SHEET_H
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>
20 40
21typedef struct typeCellBorders 41typedef struct typeCellBorders
22{ 42{
23 QPen right, bottom; 43 QPen right, bottom;
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,24 +1,45 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
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)
21 :QDialog(parent, 0, TRUE) 42 :QDialog(parent, 0, TRUE)
22{ 43{
23 // Main widget 44 // Main widget
24 tabs=new QTabWidget(this); 45 tabs=new QTabWidget(this);
@@ -52,14 +73,13 @@ SortDialog::SortDialog(QWidget *parent)
52 box->addWidget(tabs); 73 box->addWidget(tabs);
53 74
54 setCaption(tr("Sort")); 75 setCaption(tr("Sort"));
55} 76}
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)
62{ 82{
63 QLabel *label=new QLabel(caption, widgetSort); 83 QLabel *label=new QLabel(caption, widgetSort);
64 label->setGeometry(10, y+5, 215, 20); 84 label->setGeometry(10, y+5, 215, 20);
65 QComboBox *combo=new QComboBox(FALSE, widgetSort); 85 QComboBox *combo=new QComboBox(FALSE, widgetSort);
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,31 +1,52 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef SORTDLG_H 34#ifndef SORTDLG_H
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>
20#include <qlayout.h> 42#include <qlayout.h>
21#include <qcombobox.h> 43#include <qcombobox.h>
22#include <qcheckbox.h> 44#include <qcheckbox.h>
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
28{ 49{
29 Q_OBJECT 50 Q_OBJECT
30 51
31 // QT objects 52 // QT objects
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,14 +1,33 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
@@ -25,14 +44,13 @@ TextDialog::TextDialog(QWidget *parent)
25 label->setBuddy(edit); 44 label->setBuddy(edit);
26 45
27 resize(200, 45); 46 resize(200, 45);
28} 47}
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,
35 const QString &value) 53 const QString &value)
36{ 54{
37 setCaption(caption); 55 setCaption(caption);
38 label->setText(text); 56 label->setText(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,23 +1,43 @@
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/*
11 * Opie Sheet (formerly Sheet/Qt) 30 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 31 * by Serdar Ozler <sozler@sitebest.com>
13 */ 32 */
14 33
15#ifndef TEXTDLG_H 34#ifndef TEXTDLG_H
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>
20#include <qlineedit.h> 40#include <qlineedit.h>
21 41
22class TextDialog: public QDialog 42class TextDialog: public QDialog
23{ 43{