summaryrefslogtreecommitdiff
Side-by-side diff
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,13 +1,41 @@
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+#include "Excel.h"
+/* STD */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <sys/types.h>
#include <strings.h>
-#include "Excel.h"
static xfrecord formatter[] = {
{ 0xe , DATEFORMAT, "%m/%d/%y"},
{ 0xf , DATEFORMAT, "%d-%b-%y"},
@@ -62,9 +90,10 @@ int ExcelBook::Integer4Byte(int b1,int b2,int b3,int b4)
int val = i2 << 16 | i1;
return val;
};
-int ExcelBook::Integer2ByteFile(FILE *f) {
+int ExcelBook::Integer2ByteFile(FILE *f)
+{
int i1, i2;
i1 = fgetc(f);
i2 = fgetc(f);
return Integer2Byte(i1,i2);
@@ -101,9 +130,10 @@ double ExcelBook::Double4Byte(int b1, int b2, int b3, int b4)
{
value /= 100.0;
};
return value;
- }else
+ }
+ else
{
union { double d; unsigned long int b[2]; } dbl_byte;
unsigned long int valbits = (rk & 0xfffffffc);
@@ -131,12 +161,15 @@ void ExcelBook::DetectEndian(void)
int end;
long i = 0x44332211;
unsigned char* a = (unsigned char*) &i;
end = (*a != 0x11);
- if (end == 1) {
+ if (end == 1)
+ {
endian = BIG_ENDIAN;
printf("BIGENDIAN!\r\n");
- } else {
+ }
+ else
+ {
endian = LITTLE_ENDIAN;
printf("LITTLEENDIAN!\r\n");
}
};
@@ -147,14 +180,17 @@ double ExcelBook::Double8Byte(int b1, int b2, int b3, int b4, int b5, int b6, in
double d;
unsigned char *ieee;
ieee = (unsigned char *)&d;
for (i = 0; i < 8; i++) ieee[i] = 0;
- if (endian == BIG_ENDIAN) {
+ if (endian == BIG_ENDIAN)
+ {
ieee[0] = ((int)b8) & 0xff;ieee[1] = ((int)b7) & 0xff;
ieee[2] = ((int)b6) & 0xff;ieee[3] = ((int)b5) & 0xff;
ieee[4] = ((int)b4) & 0xff;ieee[5] = ((int)b3) & 0xff;
ieee[6] = ((int)b2) & 0xff;ieee[7] = ((int)b1) & 0xff;
- } else {
+ }
+ else
+ {
ieee[0] = ((int)b1) & 0xff;ieee[1] = ((int)b2) & 0xff;
ieee[2] = ((int)b3) & 0xff;ieee[3] = ((int)b4) & 0xff;
ieee[4] = ((int)b5) & 0xff;ieee[5] = ((int)b6) & 0xff;
ieee[6] = ((int)b7) & 0xff;ieee[7] = ((int)b8) & 0xff;
@@ -392,9 +428,10 @@ int ExcelBook::SheetHandleRecord(ExcelSheet* sheet, ExcelBREC* record)
if (record->length == 10)
{
sheet->rows = Integer2Byte(data[2], data[3]);
sheet->cols = Integer2Byte(data[6], data[7]);
- } else
+ }
+ else
{
sheet->rows = Integer4Byte(data[4], data[5], data[6], data[7]);
sheet->cols = Integer2Byte(data[10], data[11]);
}
@@ -601,9 +638,10 @@ void ExcelBook::HandleBoundSheet(ExcelBREC* rec)
if(data[7]==0)
{
//ascii
name=GetASCII(data,pos,length);
- }else
+ }
+ else
{
name=GetUnicode(data,pos,length);
};
Names.resize(Names.count()+1);
@@ -807,22 +845,25 @@ QString* ExcelBook::CellDataString(ExcelSheet* sh, int row, int col)
tmptr = gmtime(&date);
if (dateformat)
{
strftime(str,1024,dateformat.ascii(),tmptr);
- } else
+ }
+ else
{
strftime(str,1024,format.ascii(),tmptr);
};
- } else
+ }
+ else
if (XFRecords[c->xfindex]->type == NUMBERFORMAT)
{
format = XFRecords[c->xfindex]->format;
//sprintf(str,format.ascii(),c->valued);
// the real format is ignored...
// because there is more work to be done in the field
precision = CellGetPrecision(c->valued);
sprintf(str,"%.*f",precision,c->valued);
- }else
+ }
+ else
{
precision = CellGetPrecision(c->valued);
sprintf(str,"%.*f",precision,c->valued);
};
@@ -1001,13 +1042,15 @@ void ExcelBook::HandleFormula(ExcelSheet* sheet, ExcelBREC* record)
col = Integer2Byte(data[2], data[3]);
if (data[6] == 0 && data[12] == -1 && data[13] == -1)
{
// string
- } else
+ }
+ else
if (data[6] == 1 && data[12] == -1 && data[13] == -1)
{
// boolean
- } else
+ }
+ else
if ( data[6] == 2 && data[12] == -1 && data[13] == -1)
{
// error
}
@@ -1122,9 +1165,10 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
idx += fareastsize;
};
s1=QString("""")+s1+QString("""");
operands.prepend(new QString(s1));
- }else
+ }
+ else
{
w1=data[idx];idx++;
s1=GetASCII(data,idx,w1);
s1=QString("""")+s1+QString("""");
@@ -1141,9 +1185,10 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row1
w2=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row2
w3=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col1
w4=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col2
- }else
+ }
+ else
{
w1=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row1
w2=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row2
w3=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col1
@@ -1160,9 +1205,10 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
if(Version==8)
{
w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//row
w2=Integer2Byte(data[idx],data[idx+1]) & 0x00FF;idx=idx+2;//col
- }else
+ }
+ else
{
w1=Integer2Byte(data[idx],data[idx+1]) & 0x3FFF;idx=idx+2;//row
w2=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;//col
};
@@ -1331,9 +1377,10 @@ QString ExcelBook::GetFormula(int row, int col, ExcelSheet* sheet, char* data, i
if(token==0x22||token==0x42||token==0x62)
{
w2=(int)data[idx];idx++;
w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;
- }else
+ }
+ else
{
w1=Integer2Byte(data[idx],data[idx+1]);idx=idx+2;
};
switch(w1)
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,14 +1,44 @@
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
+
+/* QT */
+#include <qstring.h>
+#include <qarray.h>
+#include <qlist.h>
+/* STD */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <sys/types.h>
#include <strings.h>
-#include <qstring.h>
-#include <qarray.h>
-#include <qlist.h>
#define DATEFORMAT 0x1
#define NUMBERFORMAT 0x2
@@ -113,9 +143,10 @@ public:
void Set(int row, int col, ExcelCell* cell);
};
-struct mulrk {
+struct mulrk
+{
int row;
int first;
int last;
int numrks;
@@ -123,11 +154,8 @@ struct mulrk {
QArray<double> rkdbls;
QArray<int> xfindices;
};
-
-
-
class ExcelBook
{
public:
FILE *File;
@@ -195,11 +223,6 @@ void HandleXF(ExcelBREC* rec);
void HandleRK(ExcelSheet* sheet, ExcelBREC* record);
void HandleFormula(ExcelSheet* sheet, ExcelBREC* record);
QString GetFormula(int row, int col, ExcelSheet* sheet, char* data, int sz);
QString FindCellName(int row, int col);
-
-
-
-
-
};
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,20 +1,40 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
*/
#include "cellformat.h"
+/* QT */
#include <qlistbox.h>
#include <qlabel.h>
#define COMBO_WIDTHS 155
@@ -148,10 +168,9 @@ CellFormat::CellFormat(QWidget *parent)
setCaption(tr("Format Cells"));
}
CellFormat::~CellFormat()
-{
-}
+{}
int CellFormat::findColorIndex(const QColor &color)
{
for (int i=0; i<COLOR_COUNT; ++i)
@@ -528,10 +547,9 @@ BorderEditor::BorderEditor(QWidget *parent)
setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
}
BorderEditor::~BorderEditor()
-{
-}
+{}
void BorderEditor::drawContents(QPainter *p)
{
QFrame::drawContents(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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -14,18 +33,21 @@
#ifndef CELLFORMAT_H
#define CELLFORMAT_H
+#include "sheet.h"
+
+/* OPIE */
#include <qpe/fontdatabase.h>
+
+/* QT */
#include <qdialog.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
-#include "sheet.h"
-
class BorderEditor: public QFrame
{
Q_OBJECT
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,21 +1,42 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
*/
+#include "finddlg.h"
+
+/* QT */
#include <qlabel.h>
#include <qradiobutton.h>
-#include "finddlg.h"
FindDialog::FindDialog(QWidget *parent)
:QDialog(parent, 0, TRUE)
{
@@ -63,10 +84,9 @@ FindDialog::FindDialog(QWidget *parent)
setCaption(tr("Find & Replace"));
}
FindDialog::~FindDialog()
-{
-}
+{}
void FindDialog::typeChanged(int id)
{
editReplace->setEnabled(id>0);
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -14,16 +33,18 @@
#ifndef FINDDLG_H
#define FINDDLG_H
+#include "sheet.h"
+
+/* QT */
#include <qdialog.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qvbuttongroup.h>
-#include "sheet.h"
class FindDialog: public QDialog
{
Q_OBJECT
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
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,26 +1,48 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
*/
#include "mainwindow.h"
+/* OPIE */
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
+/* QT */
#include <qmessagebox.h>
#include <qradiobutton.h>
+/* STD */
#include "cellformat.h"
#include "numberdlg.h"
#include "textdlg.h"
#include "sortdlg.h"
@@ -37,17 +59,16 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
documentModified=FALSE;
// construct objects
currentDoc=0;
- fileSelector=new FileSelector("application/sheet-qt", this, QString::null);
+ fileSelector=new FileSelector("application/opie-sheet", this, QString::null);
ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE);
connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide()));
connect(fileSelector, SIGNAL(newSelected(const DocLnk&)), this, SLOT(selectorFileNew(const DocLnk&)));
connect(fileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(selectorFileOpen(const DocLnk&)));
connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk&)),this,SLOT(slotImportExcel(const DocLnk&)));
connect(ExcelSelector,SIGNAL(closeMe()), this, SLOT(ExcelSelectorHide()));
-
listSheets.setAutoDelete(TRUE);
initActions();
initMenu();
@@ -89,9 +110,9 @@ void MainWindow::documentSave(DocLnk *lnkDoc)
for (typeCellData *tempCell=tempSheet->data.first(); tempCell; tempCell=tempSheet->data.next())
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;
}
- lnkDoc->setType("application/sheet-qt");
+ lnkDoc->setType("application/opie-sheet");
if (!fm.saveFile(*lnkDoc, streamBuffer))
{
QMessageBox::critical(this, tr("Error"), tr("File cannot be saved!"));
return;
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -14,20 +33,24 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
+#include "Excel.h"
+#include "sheet.h"
+
+/* OPIE */
#include <qpe/applnk.h>
#include <qpe/fileselector.h>
+
+/* QT */
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qmainwindow.h>
#include <qaction.h>
#include <qlineedit.h>
#include <qbutton.h>
#include <qcombobox.h>
#include <qtoolbutton.h>
-#include "Excel.h"
-#include "sheet.h"
typedef struct typeSheet
{
QString name;
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -27,10 +46,9 @@ NumberDialog::NumberDialog(QWidget *parent)
resize(200, 45);
}
NumberDialog::~NumberDialog()
-{
-}
+{}
int NumberDialog::exec(const QString &caption, const QString &text,
int value, int min, int max, int step)
{
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -14,8 +33,9 @@
#ifndef NUMBERDLG_H
#define NUMBERDLG_H
+/* QT */
#include <qdialog.h>
#include <qlabel.h>
#include <qspinbox.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,7 +1,22 @@
CONFIG = qt warn_on quick-app
-HEADERS = mainwindow.h sheet.h cellformat.h finddlg.h numberdlg.h sortdlg.h textdlg.h Excel.h
-SOURCES = main.cpp mainwindow.cpp sheet.cpp cellformat.cpp finddlg.cpp numberdlg.cpp sortdlg.cpp textdlg.cpp Excel.cpp
+HEADERS = mainwindow.h \
+ sheet.h \
+ cellformat.h \
+ finddlg.h \
+ numberdlg.h \
+ sortdlg.h \
+ textdlg.h \
+ Excel.h
+SOURCES = main.cpp \
+ mainwindow.cpp \
+ sheet.cpp \
+ cellformat.cpp \
+ finddlg.cpp \
+ numberdlg.cpp \
+ sortdlg.cpp \
+ textdlg.cpp \
+ Excel.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopiecore2
TARGET = opie-sheet
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,21 +1,43 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
*/
#include "sheet.h"
+/* QT */
#include <qmessagebox.h>
+
+/* STD */
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
@@ -47,10 +69,9 @@ Sheet::Sheet(int numRows, int numCols, QWidget *parent)
connect(this, SIGNAL(valueChanged(int,int)), this, SLOT(slotCellChanged(int,int)));
}
Sheet::~Sheet()
-{
-}
+{}
typeCellData *Sheet::findCellData(int row, int col)
{
typeCellData *tempCellData;
@@ -66,9 +87,10 @@ void Sheet::slotCellSelected(int row, int col)
typeCellData *cellData=findCellData(row, col);
if (cellData)
{
emit currentDataChanged(cellData->data);
- }else
+ }
+ else
emit currentDataChanged("");
}
typeCellData *Sheet::createCellData(int row, int col)
@@ -227,9 +249,10 @@ double Sheet::BesselI0(double x)
{
y=x/3.75;
y*=y;
ans=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492 +y*(0.2659732+y*(0.360768e-1+y*0.45813e-2)))));
- }else
+ }
+ else
{
y=3.75/ax;
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))))))));
}
@@ -244,9 +267,10 @@ double Sheet::BesselI1(double x)
{
y=x/3.75;
y*=y;
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))))));
- } else
+ }
+ else
{
y=3.75/ax;
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))));
ans *= (exp(ax)/sqrt(ax));
@@ -291,9 +315,10 @@ double Sheet::BesselK0(double x)
if (x <= 2.0)
{
y=x*x/4.0;
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))))));
- } else
+ }
+ else
{
y=2.0/x;
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))))));
}
@@ -306,9 +331,10 @@ double Sheet::BesselK1(double x)
if (x <= 2.0)
{
y=x*x/4.0;
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)))))));
- } else
+ }
+ else
{
y=2.0/x;
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)))))));
}
@@ -341,9 +367,10 @@ double Sheet::BesselJ0(double x)
y=x*x;
ans1=57568490574.0+y*(-13362590354.0+y*(651619640.7 +y*(-11214424.18+y*(77392.33017+y*(-184.9052456)))));
ans2=57568490411.0+y*(1029532985.0+y*(9494680.718 +y*(59272.64853+y*(267.8532712+y*1.0))));
ans=ans1/ans2;
- } else
+ }
+ else
{
z=8.0/ax;
y=z*z;
xx=ax-0.785398164;
@@ -363,9 +390,10 @@ double Sheet::BesselY0(double x)
y=x*x;
ans1 = -2957821389.0+y*(7062834065.0+y*(-512359803.6 +y*(10879881.29+y*(-86327.92757+y*228.4622733))));
ans2=40076544269.0+y*(745249964.8+y*(7189466.438 +y*(47447.26470+y*(226.1030244+y*1.0))));
ans=(ans1/ans2)+0.636619772*BesselJ0(x)*log(x);
- } else
+ }
+ else
{
z=8.0/x;
y=z*z;
xx=x-0.785398164;
@@ -385,9 +413,10 @@ double Sheet::BesselJ1(double x)
y=x*x;
ans1=x*(72362614232.0+y*(-7895059235.0+y*(242396853.1 +y*(-2972611.439+y*(15704.48260+y*(-30.16036606))))));
ans2=144725228442.0+y*(2300535178.0+y*(18583304.74 +y*(99447.43394+y*(376.9991397+y*1.0))));
ans=ans1/ans2;
- } else
+ }
+ else
{
z=8.0/ax; y=z*z; xx=ax-2.356194491;
ans1=1.0+y*(0.183105e-2+y*(-0.3516396496e-4 +y*(0.2457520174e-5+y*(-0.240337019e-6))));
ans2=0.04687499995+y*(-0.2002690873e-3 +y*(0.8449199096e-5+y*(-0.88228987e-6 +y*0.105787412e-6)));
@@ -406,9 +435,10 @@ double Sheet::BesselY1(double x)
y=x*x;
ans1=x*(-0.4900604943e13+y*(0.1275274390e13 +y*(-0.5153438139e11+y*(0.7349264551e9 +y*(-0.4237922726e7+y*0.8511937935e4)))));
ans2=0.2499580570e14+y*(0.4244419664e12 +y*(0.3733650367e10+y*(0.2245904002e8 +y*(0.1020426050e6+y*(0.3549632885e3+y)))));
ans=(ans1/ans2)+0.636619772*(BesselJ1(x)*log(x)-1.0/x);
- } else
+ }
+ else
{
z=8.0/x;
y=z*z;
xx=x-2.356194491;
@@ -457,9 +487,10 @@ double Sheet::BesselJ(int n, double x)
bjm=bj;
bj=bjp;
}
ans=bj;
- } else
+ }
+ else
{
tox=2.0/ax;
m=2*((n+(int) sqrt(ACC*n))/2);
jsum=0;
@@ -517,9 +548,10 @@ double Sheet::GammaP(double a, double x)
if (x < (a+1.0))
{
GammaSeries(&gamser,a,x,&gln);
return gamser;
- }else
+ }
+ else
{
GammaContinuedFraction(&gammcf,a,x,&gln);
return 1.0-gammcf;
}
@@ -543,9 +575,10 @@ void Sheet::GammaSeries(double *gamser, double a, double x, double *gln)
{
if (x < 0.0) return;//error
*gamser=0.0;
return;
- } else
+ }
+ else
{
ap=a;
del=sum=1.0/a;
for (n=1;n<=ITMAX;n++)
@@ -557,9 +590,10 @@ void Sheet::GammaSeries(double *gamser, double a, double x, double *gln)
{
*gamser=sum*exp(-x+a*log(x)-(*gln));
return;
}
- } return;
+ }
+ return;
return;
}
};
@@ -661,9 +695,10 @@ double Sheet::functionSum(const QString &param1, const QString &param2)
tempResult=text(row, col).toDouble(&ok);
if (ok) result+=tempResult;
}
return result;
- }else
+ }
+ else
{
double d1=0,d2=0;
d1=calculateVariable(param1).toDouble(&ok);
d2=calculateVariable(param2).toDouble(&ok);
@@ -788,9 +823,10 @@ double Sheet::functionSumSQ(const QString &param1, const QString &param2)
tempResult=text(row, col).toDouble(&ok);
if (ok) result+=tempResult*tempResult;
}
return result;
- }else
+ }
+ else
{
double d1=0,d2=0;
d1=calculateVariable(param1).toDouble(&ok);
d2=calculateVariable(param2).toDouble(&ok);
@@ -818,9 +854,10 @@ double Sheet::functionMin(const QString &param1, const QString &param2)
init=TRUE;
}
}
return min;
- }else
+ }
+ else
{
double d1=0,d2=0;
d1=calculateVariable(param1).toDouble(&ok);
d2=calculateVariable(param2).toDouble(&ok);
@@ -846,9 +883,10 @@ double Sheet::functionMax(const QString &param1, const QString &param2)
init=TRUE;
}
};
return max;
- }else
+ }
+ else
{
double d1=0,d2=0;
d1=calculateVariable(param1).toDouble(&ok);
d2=calculateVariable(param2).toDouble(&ok);
@@ -876,9 +914,10 @@ double Sheet::functionCount(const QString &param1, const QString &param2)
text(row, col).toDouble(&ok);
if (ok) ++divider;
};
return divider;
- }else
+ }
+ else
{
double d1=0,d2=0;int ii=0;
d1=calculateVariable(param1).toDouble(&ok);
if (ok) ii++;
@@ -991,14 +1030,16 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
{
if(findRowColumn(getParameter(parameters, 0), &row, &col, FALSE))
{
if(text(row,col).length()==0) val1=1; else val1=0;
- }else
+ }
+ else
{
if(findRowColumn(calculateVariable(getParameter(parameters, 0)), &row,&col, FALSE))
{
if(text(row,col).length()==0) val1=1; else val1=0;
- }else
+ }
+ else
{
val1=0;
};
};
@@ -1011,15 +1052,17 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
if(findRowColumn(getParameter(parameters, 0, TRUE, function), &row, &col, FALSE))
{
val1=text(row,col).toDouble(&ok);
if(ok) val1=1; else val1=0;
- }else
+ }
+ else
{
if(findRowColumn(calculateVariable(getParameter(parameters, 0, TRUE, function)), &row,&col, FALSE))
{
val1=text(row,col).toDouble(&ok);
if(ok) val1=1; else val1=0;
- }else
+ }
+ else
{
val1=0;
};
};
@@ -1388,9 +1431,10 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
if(val1==1.0)
{
s1=calculateVariable(getParameter(parameters, 1, TRUE, function));
return QString(s1);
- }else
+ }
+ else
{
s1=calculateVariable(getParameter(parameters, 2, TRUE, function));
return QString(s1);
};
@@ -1551,9 +1595,10 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok);
if(vali==1)
{
return QString::number(GammaQ(floor(val1)+1, val2));
- }else
+ }
+ else
{
return QString::number(exp(-val2)*pow(val2,val1)/exp(GammaLn(val1+1.0)));
};
};
@@ -1565,9 +1610,10 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok);
if(vali==1)
{
return QString::number(GammaP(val2/2.0,val1*val1/2.0));
- } else
+ }
+ else
{
return QString::number(
pow(val1,val2-1.0)*exp(-val1*val1/2)/ ( pow(2,val2/2.0-1.0)*exp(GammaLn(val2/2.0)))
);
@@ -1581,9 +1627,10 @@ QString Sheet::calculateFunction(const QString &func, const QString &parameters,
vali=calculateVariable(getParameter(parameters, 2, TRUE, function)).toInt(&ok);
if(vali==1)
{
return QString::number(GammaP(val2/2.0,val1/2.0));
- } else
+ }
+ else
{
return QString::number(
pow(val1,val2/2.0-1.0)/(exp(val1/2.0)*pow(sqrt(2.0),val2)*exp(GammaLn(val2/2.0)))
);
@@ -2384,9 +2431,10 @@ void Expression::GetNext()
break;
}
}//while
}//else if
-};//end function
+}
+;//end function
void Expression::First()
{
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -14,8 +33,9 @@
#ifndef SHEET_H
#define SHEET_H
+/* QT */
#include <qtable.h>
#include <qstack.h>
typedef struct typeCellBorders
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,22 +1,43 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
*/
+#include "sortdlg.h"
+
+/* QT */
#include <qlabel.h>
#include <qradiobutton.h>
#include <qmessagebox.h>
-#include "sortdlg.h"
SortDialog::SortDialog(QWidget *parent)
:QDialog(parent, 0, TRUE)
{
@@ -54,10 +75,9 @@ SortDialog::SortDialog(QWidget *parent)
setCaption(tr("Sort"));
}
SortDialog::~SortDialog()
-{
-}
+{}
QComboBox *SortDialog::createFieldCombo(const QString &caption, int y)
{
QLabel *label=new QLabel(caption, 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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -14,16 +33,18 @@
#ifndef SORTDLG_H
#define SORTDLG_H
+#include "sheet.h"
+
+/* QT */
#include <qdialog.h>
#include <qtabwidget.h>
#include <qlayout.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qvbuttongroup.h>
-#include "sheet.h"
class SortDialog: public QDialog
{
Q_OBJECT
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -27,10 +46,9 @@ TextDialog::TextDialog(QWidget *parent)
resize(200, 45);
}
TextDialog::~TextDialog()
-{
-}
+{}
int TextDialog::exec(const QString &caption, const QString &text,
const QString &value)
{
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,12 +1,31 @@
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
+/*
+ =. This file is part of the Opie Project
+ .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
+ .>+-=
+ _;:, .> :=|. This program is free software; you can
+.> <`_, > . <= redistribute it and/or modify it under
+:`=1 )Y*s>-.-- : the terms of the GNU General Public
+.="- .-=="i, .._ License as published by the Free Software
+ - . .-<_> .<> Foundation; either version 2 of the License,
+ ._= =} : or (at your option) any later version.
+ .%`+i> _;_.
+ .i_,=:_. -<s. This program is distributed in the hope that
+ + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
+ : .. .:, . . . without even the implied warranty of
+ =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
+ _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.= = ; Library General Public License for more
+++= -. .` .: details.
+ : = ...= . :.=-
+ -. .:....=;==+<; You should have received a copy of the GNU
+ -_. . . )=. = Library General Public License along with
+ -- :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+*/
/*
* Opie Sheet (formerly Sheet/Qt)
* by Serdar Ozler <sozler@sitebest.com>
@@ -14,8 +33,9 @@
#ifndef TEXTDLG_H
#define TEXTDLG_H
+/* QT */
#include <qdialog.h>
#include <qlabel.h>
#include <qlineedit.h>