summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-sheet/mainwindow.cpp
authorhayzel <hayzel>2004-01-07 08:08:29 (UTC)
committer hayzel <hayzel>2004-01-07 08:08:29 (UTC)
commit08bc72c34cae85e5cc6541c9daaeba121597c961 (patch) (side-by-side diff)
treedf5b263a84099ffdf8e0b86fda9a9fe61b90d30e /noncore/apps/opie-sheet/mainwindow.cpp
parent656e80e7b35c4aefd49ffe7756d895f4e7370de1 (diff)
downloadopie-08bc72c34cae85e5cc6541c9daaeba121597c961.zip
opie-08bc72c34cae85e5cc6541c9daaeba121597c961.tar.gz
opie-08bc72c34cae85e5cc6541c9daaeba121597c961.tar.bz2
January 7, 2004
* Release by hayzel (koppermind@panafonet.gr) This version has many valuable changes, though It may have some annoying bugs. Please if you are interested in opie-sheet try it hard, so I can fix some of them. Also If you want some other functions that must be here and are missing feel free to ask them. (no financial functions please. :) I really hate them ) -Fixed a bug with non closed parenthesis editing&recalculation infinite loop. -Added support for functions that can parse parameters not ONLY as numbers but also as strings. -Added many functions that cover many computational topics rendering opie-sheet a computational tool-spreadsheet at last. (total 90 functions!) -Maintained compatibility with the opie-fileformat. -New icons. -Found that the DataParser was not a real RPN compiler of the expressions. In fact it was returning faulty results in calculations, in both binary or unary operations. A1-A2-A3 was parsed as A1-(A2-A3). A1 was parsed as A1. -Added new class "Expression" a general Parser for spreadsheet-expression. Imported from an old C# project of mine. -Now can also parse <>=!%&^|"" in expressions. -Added experimental Excel File format import!. The opie-sheet can import any excel file in BIFF7/BIFF8 format. These formats are used in Excel XP,2000,95. The Excel Importer class is in a good coding level.. BUT it is not complete. Only strings,numbers,formulas are imported. Not formatting rules. Not all the functions are converted in the functions of opie-sheet. Infact FEW functions are converted. -Fixed a bug with Sheet Recalculation. Added ReCalc() function. Opie-sheet was calculating wrong the values of expression in opening/importing. if a value needed was not loaded yet in the time of calculation. Solved with ReCalc() each time the active sheet is changing. *known issues: -if someone enters directly text as parameter to a string function the text renders as uppercase due to the calculation engine that uppercases all the parsing sentence. -randbetween return only integer part random... if both limit numbers are integers. -skew and kurt function give different results compared to kspread-oofice equivalents. -unstable parser Excel Class -string vars and string functions are not correctly handled by excel importer. -unicode strings are converted FINE in QString unicode format, but cannot be rendered fine if a suitable unicode font is not setuped as the default string. So the string is junked in the opie-sheet and may crash the parser. *TODOs: -surelly a much full-stable excel importer. -Cell Manipulation of many Data is really slow.... must change the QList data type. To a structure more efficient. -maybe some more functions. -maybe some kind of charts drawing? -maybe kspread or ooffice files import/export.
Diffstat (limited to 'noncore/apps/opie-sheet/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-sheet/mainwindow.cpp238
1 files changed, 212 insertions, 26 deletions
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp
index 78b3073..a725e31 100644
--- a/noncore/apps/opie-sheet/mainwindow.cpp
+++ b/noncore/apps/opie-sheet/mainwindow.cpp
@@ -38,8 +38,9 @@
#include "func-func.xpm"
#include "func-equal.xpm"
#include "cell-select.xpm"
+#include "excel16.xpm"
-#define DEFAULT_NUM_ROWS 199
+#define DEFAULT_NUM_ROWS 300
#define DEFAULT_NUM_COLS (26*3)
#define DEFAULT_NUM_SHEETS 3
@@ -52,9 +53,13 @@ MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
// construct objects
currentDoc=0;
fileSelector=new FileSelector("application/sheet-qt", 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);
@@ -217,7 +222,7 @@ void MainWindow::selectorFileOpen(const DocLnk &lnkDoc)
if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return;
if (currentDoc) delete currentDoc;
- currentDoc = new DocLnk(lnkDoc);
+ currentDoc = new DocLnk();
listSheets.clear();
comboSheets->clear();
@@ -250,6 +255,21 @@ void MainWindow::slotFileOpen()
selectorShow();
}
+void MainWindow::slotImportExcelOpen()
+{
+ sheet->hide();
+ setCentralWidget(ExcelSelector);
+ ExcelSelector->show();
+ ExcelSelector->reread();
+}
+
+void MainWindow::ExcelSelectorHide()
+{
+ ExcelSelector->hide();
+ setCentralWidget(sheet);
+ sheet->show();
+}
+
void MainWindow::slotFileSave()
{
saveCurrentFile(FALSE);
@@ -270,8 +290,11 @@ void MainWindow::initActions()
connect(fileSave, SIGNAL(activated()), this, SLOT(slotFileSave()));
fileSaveAs=new QAction(tr("Save File As"), Resource::loadPixmap( "save" ), tr("Save &As"), 0, this);
connect(fileSaveAs, SIGNAL(activated()), this, SLOT(slotFileSaveAs()));
+
//fileQuit=new QAction(tr("Quit"), tr("&Quit"), 0, this);
//connect(fileQuit, SIGNAL(activated()), this, SLOT(close()));
+ fileExcelImport=new QAction(tr("Import Excel file"),QPixmap(excel16_xpm),tr("Import E&xcel file"),0,this);
+ connect(fileExcelImport, SIGNAL(activated()), this, SLOT(slotImportExcelOpen()));
// helpGeneral=new QAction(tr("General Help"), QPixmap(help_general_xpm), tr("&General"), 0, this);
//connect(helpGeneral, SIGNAL(activated()), this, SLOT(slotHelpGeneral()));
@@ -370,6 +393,8 @@ void MainWindow::initMenu()
fileSaveAs->addTo(menuFile);
// menuFile->insertSeparator();
// fileQuit->addTo(menuFile);
+ menuFile->insertSeparator();
+ fileExcelImport->addTo(menuFile);
menu->insertItem(tr("&File"), menuFile);
menuEdit=new QPopupMenu;
@@ -428,31 +453,127 @@ void MainWindow::initMenu()
funcMinus->addTo(submenuFuncStd);
funcCross->addTo(submenuFuncStd);
funcDivide->addTo(submenuFuncStd);
- submenuFunc->insertItem(tr("&Standard"), submenuFuncStd);
-
- submenuFuncMath=new QPopupMenu;
- addFlyAction(tr("Summation"), tr("&Summation"), "SUM(", submenuFuncMath);
- addFlyAction(tr("Absolute Value"), tr("&Absolute"), "ABS(", submenuFuncMath);
- submenuFuncMath->insertSeparator();
- addFlyAction(tr("Sine"), tr("Si&ne"), "SIN(", submenuFuncMath);
- addFlyAction(tr("Arc Sine"), tr("A&rc Sine"), "ASIN(", submenuFuncMath);
- addFlyAction(tr("Cosine"), tr("&Cosine"), "COS(", submenuFuncMath);
- addFlyAction(tr("ArcCosine"), tr("Arc Cos&ine"), "COS(", submenuFuncMath);
- addFlyAction(tr("Tangent"), tr("&Tangent"), "TAN(", submenuFuncMath);
- addFlyAction(tr("Arc Tangent"), tr("Arc Tan&gent"), "ATAN(", submenuFuncMath);
- addFlyAction(tr("Arc Tangent of Coordinates"), tr("C&oor. Arc Tangent"), "ATAN2(", submenuFuncMath);
- submenuFuncMath->insertSeparator();
- addFlyAction(tr("Exponential"), tr("&Exponential"), "EXP(", submenuFuncMath);
- addFlyAction(tr("Logarithm"), tr("&Logarithm"), "LOG(", submenuFuncMath);
- addFlyAction(tr("Power"), tr("&Power"), "POW(", submenuFuncMath);
- submenuFunc->insertItem(tr("&Mathematical"), submenuFuncMath);
+ submenuFunc->insertItem(tr("&Simple"), submenuFuncStd);
+
+
+
+ submenuFuncStandard=new QPopupMenu;
+ addFlyAction(tr("ABS(x)"), tr("ABS(x)"), "ABS(", submenuFuncStandard);
+ addFlyAction(tr("CEILING(x,acc)"), tr("CEILING(x,acc)"), "CEILING(", submenuFuncStandard);
+ addFlyAction(tr("FACT(x)"), tr("FACT(x)"), "FACT(", submenuFuncStandard);
+ addFlyAction(tr("FLOOR(x,acc)"), tr("FLOOR(x,acc)"), "FLOOR(", submenuFuncStandard);
+ addFlyAction(tr("INT(x)"), tr("INT(x)"), "INT(", submenuFuncStandard);
+ addFlyAction(tr("MOD(x,y)"), tr("MOD(x,y)"), "MOD(", submenuFuncStandard);
+ addFlyAction(tr("ROUND(x,digits)"), tr("ROUND(x,digits)"), "ROUND(", submenuFuncStandard);
+ addFlyAction(tr("SIGN(x)"), tr("SIGN(x)"), "SIGN(", submenuFuncStandard);
+ submenuFuncStandard->insertSeparator();
+ addFlyAction(tr("EXP(x)"), tr("EXP(x)"), "EXP(", submenuFuncStandard);
+ addFlyAction(tr("LN(x)"), tr("LN(x)"), "LN(", submenuFuncStandard);
+ addFlyAction(tr("LOG(x,b)"), tr("LOG(x,b)"), "LOG(", submenuFuncStandard);
+ addFlyAction(tr("LOG10(x)"), tr("LOG10(x)"), "LOG10(", submenuFuncStandard);
+ addFlyAction(tr("POWER(x,y)"), tr("POWER(x,y)"), "POWER(", submenuFuncStandard);
+ addFlyAction(tr("SQRT(x)"), tr("SQRT(x)"), "SQRT(", submenuFuncStandard);
+ submenuFuncStandard->insertSeparator();
+ addFlyAction(tr("DEGREES(x)"), tr("DEGREES(x)"), "DEGREES(", submenuFuncStandard);
+ addFlyAction(tr("RADIANS(x)"), tr("RADIANS(x)"), "RADIANS(", submenuFuncStandard);
+ addFlyAction(tr("PI()"), tr("PI()"), "PI()", submenuFuncStandard);
+ addFlyAction(tr("RAND()"), tr("RAND()"), "RAND(", submenuFuncStandard);
+ addFlyAction(tr("RANDBETWEEN(a,b)"), tr("RANDBETWEEN(a,b)"), "RANDBETWEEN(", submenuFuncStandard);
+ submenuFunc->insertItem(tr("S&tandard"), submenuFuncStandard);
+
+ submenuFuncLogic=new QPopupMenu;
+ addFlyAction(tr("AND(x1,x2)"), tr("AND(x1,x2)"), "AND(", submenuFuncLogic);
+ addFlyAction(tr("NOT(x)"), tr("NOT(x)"), "NOT(", submenuFuncLogic);
+ addFlyAction(tr("OR(x1,x2)"), tr("OR(x1,x2)"), "OR(", submenuFuncLogic);
+ submenuFuncLogic->insertSeparator();
+ addFlyAction(tr("IF(compare,val1,val2)"), tr("IF(compare,val1,val2)"), "IF(", submenuFuncLogic);
+ addFlyAction(tr("INDEX(range,index)"),tr("INDEX(range,index)"), "INDEX(", submenuFuncLogic);
+ addFlyAction(tr("ISBLANK(x)"), tr("ISBLANK(x)"), "ISBLANK(", submenuFuncLogic);
+ addFlyAction(tr("ISNUMBER(x)"), tr("ISNUMBER(x)"), "ISNUMBER(", submenuFuncLogic);
+ addFlyAction(tr("EVEN(x)"), tr("EVEN(x)"), "EVEN(", submenuFuncLogic);
+ addFlyAction(tr("ISEVEN(x)"), tr("ISEVEN(x)"), "ISEVEN(", submenuFuncLogic);
+ addFlyAction(tr("ODD(x)"), tr("ODD(x)"), "ODD(", submenuFuncLogic);
+ addFlyAction(tr("ISODD(x)"), tr("ISODD(x)"), "ISODD(", submenuFuncLogic);
+ submenuFunc->insertItem(tr("Logical-&Information"), submenuFuncLogic);
+
+ submenuFuncTrig=new QPopupMenu;
+ addFlyAction(tr("SIN(x)"), tr("SIN(x)"), "SIN(", submenuFuncTrig);
+ addFlyAction(tr("COS(x)"), tr("COS(x)"), "COS(", submenuFuncTrig);
+ addFlyAction(tr("TAN(x)"), tr("TAN(x)"), "TAN(", submenuFuncTrig);
+ addFlyAction(tr("ASIN(x)"), tr("ASIN(x)"), "ASIN(", submenuFuncTrig);
+ addFlyAction(tr("ACOS(x)"), tr("ACOS(x)"), "ACOS(", submenuFuncTrig);
+ addFlyAction(tr("ATAN(x)"), tr("ATAN(x)"), "ATAN(", submenuFuncTrig);
+ addFlyAction(tr("ATAN2(x,y)"), tr("ATAN2(x,y)"), "ATAN2(", submenuFuncTrig);
+ submenuFuncTrig->insertSeparator();
+ addFlyAction(tr("SINH(x)"), tr("SINH(x)"), "SINH(", submenuFuncTrig);
+ addFlyAction(tr("COSH(x)"), tr("COSH(x)"), "COSH(", submenuFuncTrig);
+ addFlyAction(tr("TANH(x)"), tr("TANH(x)"), "TANH(", submenuFuncTrig);
+ addFlyAction(tr("ACOSH(x)"), tr("ACOSH(x)"), "ACOSH(", submenuFuncTrig);
+ addFlyAction(tr("ASINH(x)"), tr("ASINH(x)"), "ASINH(", submenuFuncTrig);
+ addFlyAction(tr("ATANH(x)"), tr("ATANH(x)"), "ATANH(", submenuFuncTrig);
+ submenuFunc->insertItem(tr("&Trigonometric"), submenuFuncTrig);
+
+ submenuFuncString=new QPopupMenu;
+ addFlyAction(tr("LEN(s)"), tr("LEN(s)"), "LEN(",submenuFuncString);
+ addFlyAction(tr("LEFT(s,num)"), tr("LEFT(s,num)"), "LEFT(",submenuFuncString);
+ addFlyAction(tr("RIGHT(s,num)"), tr("RIGHT(s,num)"), "RIGHT(",submenuFuncString);
+ addFlyAction(tr("MID(s,pos,len)"), tr("MID(s,pos,len)"), "MID(",submenuFuncString);
+ submenuFuncString->insertSeparator();
+ addFlyAction(tr("CONCATENATE(s1,s2..)"), tr("CONCATENATE(s1,s2..)"), "CONCATENATE(",submenuFuncString);
+ addFlyAction(tr("EXACT(s1,s2)"), tr("EXACT(s1,s2)"), "EXACT(",submenuFuncString);
+ addFlyAction(tr("FIND(what,where,pos)"),
+ tr("FIND(what,where,pos)"), "FIND(",submenuFuncString);
+ addFlyAction(tr("REPLACE(s,pos,len,ns)"), tr("REPLACE(s,pos,len,ns)"), "REPLACE(",submenuFuncString);
+ addFlyAction(tr("REPT(s,n)"), tr("REPT(s,n)"), "REPT(",submenuFuncString);
+ submenuFuncString->insertSeparator();
+ addFlyAction(tr("UPPER(s)"), tr("UPPER(s)"), "UPPER(",submenuFuncString);
+ addFlyAction(tr("LOWER(s)"), tr("LOWER(s)"), "LOWER(",submenuFuncString);
+ submenuFunc->insertItem(tr("&Strings"), submenuFuncString);
submenuFuncStat=new QPopupMenu;
- addFlyAction(tr("Average"), tr("&Average"), "AVG(", submenuFuncStat);
- addFlyAction(tr("Maximum"), tr("Ma&ximum"), "MAX(", submenuFuncStat);
- addFlyAction(tr("Minimum"), tr("&Minimum"), "MIN(", submenuFuncStat);
- addFlyAction(tr("Count"), tr("&Count"), "COUNT(", submenuFuncStat);
- submenuFunc->insertItem(tr("&Statistical"), submenuFuncStat);
+ addFlyAction(tr("AVERAGE(range)"), tr("AVERAGE(range)"), "AVERAGE(",submenuFuncStat);
+ addFlyAction(tr("COUNT(range)"), tr("COUNT(range)"), "COUNT(",submenuFuncStat);
+ addFlyAction(tr("COUNTIF(range,eqls)"), tr("COUNTIF(range,eqls)"), "COUNTIF(",submenuFuncStat);
+ addFlyAction(tr("MAX(range)"), tr("MAX(range)"), "MAX(",submenuFuncStat);
+ addFlyAction(tr("MIN(range)"), tr("MIN(range)"), "MIN(",submenuFuncStat);
+ addFlyAction(tr("SUM(range)"), tr("SUM(range)"), "SUM(",submenuFuncStat);
+ addFlyAction(tr("SUMSQ(range)"), tr("SUMSQ(range)"), "SUMSQ(",submenuFuncStat);
+ submenuFuncStat->insertSeparator();
+ addFlyAction(tr("AVERAGE(range)"), tr("AVERAGE(range)"), "AVERAGE(",submenuFuncStat);
+ addFlyAction(tr("VAR(range)"), tr("VAR(range)"), "VAR(",submenuFuncStat);
+ addFlyAction(tr("VARP(range)"), tr("VARP(range)"), "VARP(",submenuFuncStat);
+ addFlyAction(tr("STDEV(range)"), tr("STDEV(range)"), "STDEV(",submenuFuncStat);
+ addFlyAction(tr("STDEVP(range)"), tr("STDEVP(range)"), "STDEVP(",submenuFuncStat);
+ addFlyAction(tr("SKEW(range)"), tr("SKEW(range)"), "SKEW(",submenuFuncStat);
+ addFlyAction(tr("KURT(range)"), tr("KURT(range)"), "KURT(",submenuFuncStat);
+ submenuFunc->insertItem(tr("Sta&tistical"), submenuFuncStat);
+
+ submenuFuncScientific=new QPopupMenu;
+ addFlyAction(tr("BESSELI(x,n)"), tr("BESSELI(x,n)"), "BESSELI(",submenuFuncScientific);
+ addFlyAction(tr("BESSELJ(x,n)"), tr("BESSELJ(x,n)"), "BESSELJ(",submenuFuncScientific);
+ addFlyAction(tr("BESSELK(x,n)"), tr("BESSELK(x,n)"), "BESSELK(",submenuFuncScientific);
+ addFlyAction(tr("BESSELY(x,n)"), tr("BESSELY(x,n)"), "BESSELY(",submenuFuncScientific);
+ submenuFuncScientific->insertSeparator();
+ addFlyAction(tr("BETAI(x,a,b)"), tr("BETAI(x,a,b)"), "BETAI(",submenuFuncScientific);
+ addFlyAction(tr("ERF(a,b)"), tr("ERF(a,b)"), "ERF(",submenuFuncScientific);
+ addFlyAction(tr("ERFC(a,b)"), tr("ERFC(a,b)"), "ERFC(",submenuFuncScientific);
+ addFlyAction(tr("GAMMALN(x)"), tr("GAMMALN(x)"), "GAMMALN(",submenuFuncScientific);
+ addFlyAction(tr("GAMMAP(x,a)"), tr("GAMMAP(x,a)"), "GAMMAP(",submenuFuncScientific);
+ addFlyAction(tr("GAMMAQ(x,a)"), tr("GAMMAQ(x,a)"), "GAMMAQ(",submenuFuncScientific);
+ submenuFunc->insertItem(tr("Scienti&fic"), submenuFuncScientific);
+
+ submenuFuncDistr=new QPopupMenu;
+ addFlyAction(tr("BETADIST(z,a,b,Q?)"), tr("BETADIST(z,a,b,Q?)"), "BETADIST(",submenuFuncDistr);
+ addFlyAction(tr("CHI2DIST(x,n,Q?)"), tr("CHI2DIST(x,n,Q?)"), "CHI2DIST(",submenuFuncDistr);
+ addFlyAction(tr("CHIDIST(x,n,Q?)"), tr("CHIDIST(x,n,Q?)"), "CHIDIST(",submenuFuncDistr);
+ addFlyAction(tr("FDIST(z,deg1,deg2,Q?)"), tr("FDIST(z,deg1,deg2,Q?)"), "FDIST(",submenuFuncDistr);
+ addFlyAction(tr("GAMMADIST(x,a,b,Q?)"), tr("GAMMADIST(x,a,b,Q?)"), "GAMMADIST(",submenuFuncDistr);
+ addFlyAction(tr("NORMALDIST(x,m,s,Q?)"), tr("NORMALDIST(x,m,s,Q?)"), "NORMALDIST(",submenuFuncDistr);
+ addFlyAction(tr("PHI(x,Q?)"), tr("PHI(x,Q?)"), "PHI(",submenuFuncDistr);
+ addFlyAction(tr("POISSON(x,n,Q?)"), tr("POISSON(x,n,Q?)"), "POISSON(",submenuFuncDistr);
+ submenuFunc->insertItem(tr("&Distributions"), submenuFuncDistr);
+
+
menuInsert->insertSeparator();
insertCells->addTo(menuInsert);
@@ -597,7 +718,7 @@ void MainWindow::slotCellClicked(const QString &cell)
typeSheet *MainWindow::createNewSheet()
{
typeSheet *newSheet=new typeSheet;
- int currentNo=1, tempNo;
+ int currentNo=1, tempNo=0;
bool ok;
for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next())
@@ -625,6 +746,7 @@ void MainWindow::slotSheetChanged(const QString &name)
sheet->copySheetData(&findSheet(sheet->getName())->data);
sheet->setName(name);
sheet->setSheetData(&findSheet(name)->data);
+ sheet->ReCalc();
}
void MainWindow::addFlyAction(const QString &text, const QString &menuText, const QString &tip, QWidget *w)
@@ -745,6 +867,70 @@ void MainWindow::slotFileSaveAs()
documentSave(currentDoc);
}
+void MainWindow::slotImportExcel(const DocLnk &lnkDoc)
+{
+ ExcelBook file1;
+ file1.ParseBook((char *)lnkDoc.file().ascii());
+ int NumOfSheets=file1.Sheets.count();
+ printf("OpieSheet::NumberOfSheets:%d\r\n",NumOfSheets);
+ if (documentModified && saveCurrentFile()==QMessageBox::Cancel) return;
+ if (currentDoc) delete currentDoc;
+ currentDoc = new DocLnk();
+ listSheets.clear();
+ comboSheets->clear();
+ int w1,r,c;
+ ExcelSheet* sh1;
+ typeSheet* newSheet;
+ QString* str;
+ typeCellData* newCell;
+ for(w1=1;w1<=NumOfSheets;w1++)
+ {
+ sh1=file1.Sheets[w1-1];
+ printf("OpieSheet:newSheet:%x,r=%d,c=%d\r\n",sh1,sh1->rows,sh1->cols);
+ newSheet=new typeSheet;
+ newSheet->data.setAutoDelete(TRUE);
+ newSheet->name=sh1->name;
+ printf("OpieSheet:Sheetname:%s\r\n",sh1->name.ascii());
+ comboSheets->insertItem(newSheet->name);
+ for(r=1; r <= sh1->rows; r++)
+ {
+ for(c=1;c <= sh1->cols; c++)
+ {
+ str=file1.CellDataString(sh1,r-1,c-1);
+ if(str!=NULL && r<DEFAULT_NUM_ROWS && c<DEFAULT_NUM_COLS)
+ {
+ newCell=new typeCellData;
+ newCell->row=r-1;
+ newCell->col=c-1;
+ if(str!=NULL) newCell->data=QString(*str); else newCell->data=QString("");
+ newCell->background=QBrush(Qt::white, Qt::SolidPattern);
+ newCell->alignment=(Qt::AlignmentFlags)(Qt::AlignLeft | Qt::AlignTop);
+ newCell->fontColor=Qt::black;
+ newCell->font=font();
+ newCell->borders.right=QPen(Qt::gray, 1, Qt::SolidLine);
+ newCell->borders.bottom=QPen(Qt::gray, 1, Qt::SolidLine);
+ newSheet->data.append(newCell);
+ //there is no format parsing at the moment or style parsing
+ //printf("OpieSheetNumber:row=%d,col=%d,val=%s\r\n",r,c,str->latin1());
+ };
+ };
+ };
+ listSheets.append(newSheet);
+ if (w1==1)//if i==0 link sheet1 with sheetview
+ {
+ sheet->setName(newSheet->name);
+ sheet->setSheetData(&newSheet->data);
+ sheet->ReCalc();
+ };
+
+ };
+ file1.CloseFile();
+ printf("Excel FILE read OK\r\n");
+ documentModified=TRUE;
+
+
+}
+
void MainWindow::slotSheetRename()
{
TextDialog dialogText(this);