-rw-r--r-- | noncore/apps/opie-sheet/cellformat.cpp | 47 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/finddlg.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/numberdlg.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/sheet.cpp | 14 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/sortdlg.cpp | 5 | ||||
-rw-r--r-- | noncore/apps/opie-sheet/textdlg.cpp | 5 |
7 files changed, 55 insertions, 25 deletions
diff --git a/noncore/apps/opie-sheet/cellformat.cpp b/noncore/apps/opie-sheet/cellformat.cpp index 597502c..342ebe9 100644 --- a/noncore/apps/opie-sheet/cellformat.cpp +++ b/noncore/apps/opie-sheet/cellformat.cpp @@ -22,20 +22,41 @@ #define COLOR_COUNT 17 #define STYLE_COUNT 14 #define HALIGN_COUNT 3 #define VALIGN_COUNT 3 -QColor qtColors[COLOR_COUNT]={Qt::black, Qt::white, Qt::darkGray, Qt::gray, Qt::lightGray, Qt::red, Qt::green, Qt::blue, Qt::cyan, Qt::magenta, Qt::yellow, Qt::darkRed, Qt::darkGreen, Qt::darkBlue, Qt::darkCyan, Qt::darkMagenta, Qt::darkYellow}; -Qt::BrushStyle brushStyles[STYLE_COUNT]={Qt::SolidPattern, Qt::Dense1Pattern, Qt::Dense2Pattern, Qt::Dense3Pattern, Qt::Dense4Pattern, Qt::Dense5Pattern, Qt::Dense6Pattern, Qt::Dense7Pattern, Qt::HorPattern, Qt::VerPattern, Qt::CrossPattern, Qt::BDiagPattern, Qt::FDiagPattern, Qt::DiagCrossPattern}; +QColor qtColors[COLOR_COUNT]={Qt::black,Qt::white, Qt::darkGray, + Qt::gray, Qt::lightGray, Qt::red, + Qt::green, Qt::blue, Qt::cyan, + Qt::magenta, Qt::yellow, + Qt::darkRed, Qt::darkGreen, + Qt::darkBlue, Qt::darkCyan, + Qt::darkMagenta, Qt::darkYellow}; + +Qt::BrushStyle brushStyles[STYLE_COUNT]={Qt::SolidPattern, + Qt::Dense1Pattern, Qt::Dense2Pattern, + Qt::Dense3Pattern, Qt::Dense4Pattern, + Qt::Dense5Pattern, Qt::Dense6Pattern, + Qt::Dense7Pattern, Qt::HorPattern, + Qt::VerPattern, Qt::CrossPattern, + Qt::BDiagPattern, Qt::FDiagPattern, + Qt::DiagCrossPattern}; + QString namesHAlign[HALIGN_COUNT]={"Left", "Right", "Center"}; QString namesVAlign[VALIGN_COUNT]={"Top", "Bottom", "Center"}; -Qt::AlignmentFlags flagsHAlign[HALIGN_COUNT]={Qt::AlignLeft, Qt::AlignRight, Qt::AlignHCenter}; -Qt::AlignmentFlags flagsVAlign[VALIGN_COUNT]={Qt::AlignTop, Qt::AlignBottom, Qt::AlignVCenter}; -CellFormat::CellFormat(QWidget *parent=0) +Qt::AlignmentFlags flagsHAlign[HALIGN_COUNT]={Qt::AlignLeft, + Qt::AlignRight, + Qt::AlignHCenter}; + +Qt::AlignmentFlags flagsVAlign[VALIGN_COUNT]={Qt::AlignTop, + Qt::AlignBottom, + Qt::AlignVCenter}; + +CellFormat::CellFormat(QWidget *parent) :QDialog(parent, 0, TRUE) { // Main widget tabs=new QTabWidget(this); widgetBorders=new QWidget(tabs); widgetBackground=new QWidget(tabs); @@ -49,20 +70,24 @@ CellFormat::CellFormat(QWidget *parent=0) fontDB.loadRenderers(); changedFont=changedAlign=changedBrush=FALSE; // Borders tab borderEditor=new BorderEditor(widgetBorders); borderEditor->setGeometry(10, 10, 215, 145); - connect(borderEditor, SIGNAL(clicked(BorderEditor::BorderArea)), this, SLOT(borderClicked(BorderEditor::BorderArea))); + connect(borderEditor, SIGNAL(clicked(BorderEditor::BorderArea)), + this, SLOT(borderClicked(BorderEditor::BorderArea))); comboBordersWidth=createCombo(COMBO_WIDTH, widgetBorders, tr("&Width:"), 165); comboBordersColor=createCombo(COMBO_COLOR, widgetBorders, tr("&Color:"), 165+(COMBO_HEIGHTS+10)); buttonBordersDefaults=new QPushButton(tr("&Default Borders"), widgetBorders); - buttonBordersDefaults->setGeometry(115, 165+2*(COMBO_HEIGHTS+10), 110, COMBO_HEIGHTS); - connect(buttonBordersDefaults, SIGNAL(clicked()), this, SLOT(slotBordersDefaults())); + buttonBordersDefaults->setGeometry(115, 165+2*(COMBO_HEIGHTS+10), + 110, COMBO_HEIGHTS); + + connect(buttonBordersDefaults, SIGNAL(clicked()), + this, SLOT(slotBordersDefaults())); // Background tab frameBackground=new QFrame(widgetBackground); frameBackground->setGeometry(10, 10, 215, 145); frameBackground->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); @@ -289,13 +314,14 @@ int CellFormat::findComboItemIndex(QComboBox *combo, const QString &item) for (int i=0; i<combo->count(); ++i) if (combo->text(i)==item) return i; return 0; } -QComboBox *CellFormat::createCombo(comboType type, QWidget *parent, const QString &caption, int y) +QComboBox *CellFormat::createCombo(comboType type, QWidget *parent, + const QString &caption, int y) { QComboBox *combo=new QComboBox(FALSE, parent); combo->setGeometry(70, y, COMBO_WIDTHS, COMBO_HEIGHTS); combo->setSizeLimit(5); switch (type) @@ -304,12 +330,13 @@ QComboBox *CellFormat::createCombo(comboType type, QWidget *parent, const QStrin case COMBO_STYLE: createStyleCombo(combo); break; case COMBO_FONT: createFontCombo(combo); break; case COMBO_SIZE: createSizeCombo(combo); break; case COMBO_COLOR: createColorCombo(combo); break; case COMBO_HALIGN: createHAlignCombo(combo); break; case COMBO_VALIGN: createVAlignCombo(combo); break; + default: break; } QLabel *label=new QLabel(combo, caption, parent); label->setGeometry(10, y, 50, COMBO_HEIGHTS); return combo; @@ -492,13 +519,13 @@ int CellFormat::exec(Sheet *s) } // // Border Editor // -BorderEditor::BorderEditor(QWidget *parent=0) +BorderEditor::BorderEditor(QWidget *parent) :QFrame(parent) { setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); } BorderEditor::~BorderEditor() diff --git a/noncore/apps/opie-sheet/finddlg.cpp b/noncore/apps/opie-sheet/finddlg.cpp index d1237ca..e4c6ec8 100644 --- a/noncore/apps/opie-sheet/finddlg.cpp +++ b/noncore/apps/opie-sheet/finddlg.cpp @@ -13,13 +13,13 @@ */ #include <qlabel.h> #include <qradiobutton.h> #include "finddlg.h" -FindDialog::FindDialog(QWidget *parent=0) +FindDialog::FindDialog(QWidget *parent) :QDialog(parent, 0, TRUE) { // Main widget tabs=new QTabWidget(this); widgetFind=new QWidget(tabs); widgetOptions=new QWidget(tabs); diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp index 09ee68b..2f07bae 100644 --- a/noncore/apps/opie-sheet/mainwindow.cpp +++ b/noncore/apps/opie-sheet/mainwindow.cpp @@ -163,13 +163,13 @@ void MainWindow::documentOpen(const DocLnk &lnkDoc) sheet->setName(newSheet->name); sheet->setSheetData(&newSheet->data); } } } -int MainWindow::saveCurrentFile(bool ask=TRUE) +int MainWindow::saveCurrentFile(bool ask) { if (ask) { int result=QMessageBox::information(this, tr("Save File"), tr("Do you want to save the current file?"), QMessageBox::Yes, QMessageBox::No, QMessageBox::Cancel); if (result!=QMessageBox::Yes) return result; } diff --git a/noncore/apps/opie-sheet/numberdlg.cpp b/noncore/apps/opie-sheet/numberdlg.cpp index e8de639..90fbaa2 100644 --- a/noncore/apps/opie-sheet/numberdlg.cpp +++ b/noncore/apps/opie-sheet/numberdlg.cpp @@ -11,13 +11,13 @@ * Opie Sheet (formerly Sheet/Qt) * by Serdar Ozler <sozler@sitebest.com> */ #include "numberdlg.h" -NumberDialog::NumberDialog(QWidget *parent=0) +NumberDialog::NumberDialog(QWidget *parent) :QDialog(parent, 0, TRUE) { edit=new QSpinBox(this); edit->setGeometry(120, 10, 70, 25); label=new QLabel(this); @@ -28,13 +28,14 @@ NumberDialog::NumberDialog(QWidget *parent=0) } NumberDialog::~NumberDialog() { } -int NumberDialog::exec(const QString &caption, const QString &text, int value=1, int min=1, int max=99, int step=1) +int NumberDialog::exec(const QString &caption, const QString &text, + int value, int min, int max, int step) { setCaption(caption); label->setText(text); edit->setValue(value); edit->setMinValue(min); edit->setMaxValue(max); diff --git a/noncore/apps/opie-sheet/sheet.cpp b/noncore/apps/opie-sheet/sheet.cpp index 1d7ec6f..2279191 100644 --- a/noncore/apps/opie-sheet/sheet.cpp +++ b/noncore/apps/opie-sheet/sheet.cpp @@ -104,13 +104,13 @@ void Sheet::swapCells(int row1, int col1, int row2, int col2) setText(cellData1->row, cellData1->col, dataParser(cellData1->data)); setText(cellData2->row, cellData2->col, dataParser(cellData2->data)); emit sheetModified(); } } -QString Sheet::getParameter(const QString ¶meters, int paramNo, bool giveError=FALSE, const QString funcName="") +QString Sheet::getParameter(const QString ¶meters, int paramNo, bool giveError, const QString funcName) { QString params(parameters); int position; for (int i=0; i<paramNo; ++i) { position=params.find(','); @@ -142,13 +142,13 @@ bool Sheet::findRange(const QString &variable1, const QString &variable2, int *r *col1=*col2; *col2=col; } return TRUE; } -bool Sheet::findRowColumn(const QString &variable, int *row, int *col, bool giveError=FALSE) +bool Sheet::findRowColumn(const QString &variable, int *row, int *col, bool giveError) { int position=variable.find(QRegExp("\\d")); if (position<1) { if (giveError) QMessageBox::critical(this, tr("Error"), tr("Invalid variable: '"+variable+'\'')); return FALSE; @@ -449,13 +449,13 @@ QString Sheet::getData() typeCellData *cellData=findCellData(currentRow(), currentColumn()); if (cellData) return cellData->data; return ""; } -void Sheet::lockClicks(bool lock=TRUE) +void Sheet::lockClicks(bool lock) { clicksLocked=lock; } void Sheet::paintCell(QPainter *p, int row, int col, const QRect & cr, bool selected) { @@ -733,13 +733,13 @@ void Sheet::editCopy() void Sheet::editCut() { editCopy(); editClear(); } -void Sheet::editPaste(bool onlyContents=FALSE) +void Sheet::editPaste(bool onlyContents) { int row1=currentRow(), col1=currentColumn(); typeCellData *cellData, *tempCellData; for (tempCellData=clipboardData.first(); tempCellData; tempCellData=clipboardData.next()) { @@ -758,13 +758,13 @@ void Sheet::editPaste(bool onlyContents=FALSE) setText(cellData->row, cellData->col, dataParser(cellData->data)); emit sheetModified(); } } } -void Sheet::insertRows(int no=1, bool allColumns=TRUE) +void Sheet::insertRows(int no, bool allColumns) { setNumRows(numRows()+no); typeCellData *tempCellData; int row=currentRow(), col=currentColumn(); @@ -780,13 +780,13 @@ void Sheet::insertRows(int no=1, bool allColumns=TRUE) updateCell(tempCellData->row-no, tempCellData->col); setText(tempCellData->row, tempCellData->col, dataParser(tempCellData->data)); } emit sheetModified(); } -void Sheet::insertColumns(int no=1, bool allRows=TRUE) +void Sheet::insertColumns(int no, bool allRows) { int noCols=numCols(); int newCols=noCols+no; setNumCols(newCols); for (int i=noCols; i<newCols; ++i) horizontalHeader()->setLabel(i, getHeaderString(i+1), DEFAULT_COL_WIDTH); @@ -806,13 +806,13 @@ void Sheet::insertColumns(int no=1, bool allRows=TRUE) updateCell(tempCellData->row, tempCellData->col-no); setText(tempCellData->row, tempCellData->col, dataParser(tempCellData->data)); } emit sheetModified(); } -void Sheet::dataFindReplace(const QString &findStr, const QString &replaceStr, bool matchCase=TRUE, bool allCells=TRUE, bool entireCell=FALSE, bool replace=FALSE, bool replaceAll=FALSE) +void Sheet::dataFindReplace(const QString &findStr, const QString &replaceStr, bool matchCase, bool allCells, bool entireCell, bool replace, bool replaceAll) { typeCellData *tempCellData; int row1, col1, row2, col2; getSelection(&row1, &col1, &row2, &col2); bool found=FALSE; diff --git a/noncore/apps/opie-sheet/sortdlg.cpp b/noncore/apps/opie-sheet/sortdlg.cpp index c60be0d..c2cdec8 100644 --- a/noncore/apps/opie-sheet/sortdlg.cpp +++ b/noncore/apps/opie-sheet/sortdlg.cpp @@ -14,13 +14,13 @@ #include <qlabel.h> #include <qradiobutton.h> #include <qmessagebox.h> #include "sortdlg.h" -SortDialog::SortDialog(QWidget *parent=0) +SortDialog::SortDialog(QWidget *parent) :QDialog(parent, 0, TRUE) { // Main widget tabs=new QTabWidget(this); widgetSort=new QWidget(tabs); widgetOptions=new QWidget(tabs); @@ -175,13 +175,14 @@ int SortDialog::exec(Sheet *s) } return QDialog::Accepted; } return QDialog::Rejected; } -int SortDialog::compareItems(QTableItem *item1, QTableItem *item2, int descending=0, bool caseSensitive=TRUE) +int SortDialog::compareItems(QTableItem *item1, QTableItem *item2, + int descending, bool caseSensitive) { int result=0; if (item1) { if (item2) result=(caseSensitive ? item1->text().compare(item2->text()) : item1->text().upper().compare(item2->text().upper())); else result=-1; diff --git a/noncore/apps/opie-sheet/textdlg.cpp b/noncore/apps/opie-sheet/textdlg.cpp index 0810eb2..34cec29 100644 --- a/noncore/apps/opie-sheet/textdlg.cpp +++ b/noncore/apps/opie-sheet/textdlg.cpp @@ -11,13 +11,13 @@ * Opie Sheet (formerly Sheet/Qt) * by Serdar Ozler <sozler@sitebest.com> */ #include "textdlg.h" -TextDialog::TextDialog(QWidget *parent=0) +TextDialog::TextDialog(QWidget *parent) :QDialog(parent, 0, TRUE) { edit=new QLineEdit(this); edit->setGeometry(90, 10, 100, 25); label=new QLabel(this); @@ -28,13 +28,14 @@ TextDialog::TextDialog(QWidget *parent=0) } TextDialog::~TextDialog() { } -int TextDialog::exec(const QString &caption, const QString &text, const QString &value="") +int TextDialog::exec(const QString &caption, const QString &text, + const QString &value) { setCaption(caption); label->setText(text); edit->setText(value); return QDialog::exec(); |