summaryrefslogtreecommitdiffstats
path: root/quanta/components/tableeditor/tableeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/components/tableeditor/tableeditor.cpp')
-rw-r--r--quanta/components/tableeditor/tableeditor.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/quanta/components/tableeditor/tableeditor.cpp b/quanta/components/tableeditor/tableeditor.cpp
index bb581859..e9475242 100644
--- a/quanta/components/tableeditor/tableeditor.cpp
+++ b/quanta/components/tableeditor/tableeditor.cpp
@@ -48,8 +48,8 @@
int newNum;
-TableEditor::TableEditor(TQWidget* parent, const char* name)
- : TableEditorS(parent, name)
+TableEditor::TableEditor(TQWidget* tqparent, const char* name)
+ : TableEditorS(tqparent, name)
{
m_popup = new KPopupMenu();
m_cellEditId = m_popup->insertItem(i18n("&Edit Cell Properties"), this ,TQT_SLOT(slotEditCell()));
@@ -152,7 +152,7 @@ void TableEditor::slotContextMenuRequested( int row, int col, const TQPoint & po
TQTableSelection selection = m_dataTable->selection(m_dataTable->currentSelection());
TQRect rect(TQPoint(selection.topRow(), selection.leftCol()) ,
TQPoint(selection.bottomRow(), selection.rightCol()));
- if (rect.isValid() && (rect.width() > 1 || rect.height() > 1) && rect.contains(m_row, m_col)) {
+ if (rect.isValid() && (rect.width() > 1 || rect.height() > 1) && rect.tqcontains(m_row, m_col)) {
m_popup->setItemVisible(m_mergeCellsId, true);
m_popup->setItemVisible(m_mergeSeparatorId, true);
}
@@ -204,7 +204,7 @@ void TableEditor::slotEditRow()
void TableEditor::slotEditCol()
{
- KMessageBox::information(this, i18n("Edit col: %1").arg(m_col + 1));
+ KMessageBox::information(this, i18n("Edit col: %1").tqarg(m_col + 1));
TagDialog dlg(QuantaCommon::tagFromDTD(m_dtd,"col"));
dlg.exec();
}
@@ -411,7 +411,7 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
m_colSpin->setValue(col);
TableNode tableN = mergeMatrix[nRow - 1][col];
Node *n = tableN.node;
- setCellText(m_dataTable, nRow - 1, col, i18n("Merged with (%1, %2).").arg(tableN.mergedRow + 1).arg(tableN.mergedCol + 1));
+ setCellText(m_dataTable, nRow - 1, col, i18n("Merged with (%1, %2).").tqarg(tableN.mergedRow + 1).tqarg(tableN.mergedCol + 1));
m_dataTable->item(nRow-1, col)->setEnabled(false);
tableNode.node = new Node(0L);
tableNode.node->tag = new Tag(*(n->tag));
@@ -451,7 +451,7 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
m_colSpin->setValue(col);
TableNode tableN = mergeMatrix[nRow - 1][col];
Node *n = tableN.node;
- setCellText(m_dataTable, nRow - 1, col, i18n("Merged with (%1, %2).").arg(tableN.mergedRow + 1).arg(tableN.mergedCol + 1));
+ setCellText(m_dataTable, nRow - 1, col, i18n("Merged with (%1, %2).").tqarg(tableN.mergedRow + 1).tqarg(tableN.mergedCol + 1));
m_dataTable->item(nRow-1, col)->setEnabled(false);
tableNode.node = new Node(0L);
tableNode.node->tag = new Tag(*(n->tag));
@@ -496,7 +496,7 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
m_colSpin->setValue(nCol);
for (int i = 0; i < colValue - 1; i++)
{
- setCellText(m_dataTable, nRow - 1, lastCol + i, i18n("Merged with (%1, %2).").arg(nRow).arg(lastCol));
+ setCellText(m_dataTable, nRow - 1, lastCol + i, i18n("Merged with (%1, %2).").tqarg(nRow).tqarg(lastCol));
m_dataTable->item(nRow-1, lastCol + i)->setEnabled(false);
tableNode.node = new Node(0L);
tableNode.node->tag = new Tag(*(n->tag));
@@ -713,11 +713,11 @@ TQString TableEditor::indent( int n )
TQString TableEditor::cellValue( int row, int col )
{
if (!m_dataTable)
- return TQString::null;
+ return TQString();
TQString str;
Node *node = (*m_tableTags)[row][col].node;
if (!node)
- return TQString::null;
+ return TQString();
str = node->tag->toString();
str += m_dataTable->text(row, col);
str += "</" + QuantaCommon::tagCase(node->tag->name) + ">";
@@ -758,7 +758,7 @@ TQString TableEditor::tableToString()
TQString TableEditor::tagContent(Node *node)
{
if (!node)
- return TQString::null;
+ return TQString();
TQString content;
int bl, bc, el, ec;
node->tag->endPos(bl, bc);
@@ -775,7 +775,7 @@ TQString TableEditor::tagContent(Node *node)
n->tag->beginPos(el, ec);
ec--;
} else {
- return TQString::null;
+ return TQString();
}
}
content = m_write->text(bl, bc, el, ec);
@@ -919,12 +919,12 @@ void TableEditor::slotRemoveRow()
if ((*it3).merged)
{
TableNode *mainTableNode = &((*m_tableTags)[(*it3).mergedRow][(*it3).mergedCol]);
- if (mainTableNode->node && !updatedMainNodes.contains(mainTableNode))
+ if (mainTableNode->node && !updatedMainNodes.tqcontains(mainTableNode))
{
int rowspan = mainTableNode->node->tag->attributeValue("rowspan", true).toInt();
rowspan--;
if (rowspan > 1)
- mainTableNode->node->tag->editAttribute("rowspan", TQString("%1").arg(rowspan));
+ mainTableNode->node->tag->editAttribute("rowspan", TQString("%1").tqarg(rowspan));
else
mainTableNode->node->tag->deleteAttribute("rowspan");
updatedMainNodes.append(mainTableNode);
@@ -970,12 +970,12 @@ void TableEditor::slotRemoveCol()
if ((*it2).merged)
{
TableNode *mainTableNode = &((*m_tableTags)[(*it2).mergedRow][(*it2).mergedCol]);
- if (mainTableNode->node && !updatedMainNodes.contains(mainTableNode))
+ if (mainTableNode->node && !updatedMainNodes.tqcontains(mainTableNode))
{
int colspan = mainTableNode->node->tag->attributeValue("colspan", true).toInt();
colspan--;
if (colspan > 1)
- mainTableNode->node->tag->editAttribute("colspan", TQString("%1").arg(colspan));
+ mainTableNode->node->tag->editAttribute("colspan", TQString("%1").tqarg(colspan));
else
mainTableNode->node->tag->deleteAttribute("colspan");
updatedMainNodes.append(mainTableNode);
@@ -1054,13 +1054,13 @@ void TableEditor::slotMergeCells()
rCol = selection.rightCol();
TableNode *mainTableNode = &((*m_tableTags)[tRow][lCol]);
if (rCol - lCol > 0)
- mainTableNode->node->tag->editAttribute("colspan", TQString("%1").arg(rCol - lCol + 1));
+ mainTableNode->node->tag->editAttribute("colspan", TQString("%1").tqarg(rCol - lCol + 1));
if (bRow - tRow > 0)
- mainTableNode->node->tag->editAttribute("rowspan", TQString("%1").arg(bRow - tRow + 1));
+ mainTableNode->node->tag->editAttribute("rowspan", TQString("%1").tqarg(bRow - tRow + 1));
for (int i = 0; i < bRow - tRow + 1; i++)
for (int j = 0; j < rCol - lCol + 1; j++) {
if (i != 0 || j != 0) {
- setCellText(m_dataTable, tRow + i, lCol + j, i18n("Merged with (%1, %2).").arg(tRow + 1).arg(lCol + 1));
+ setCellText(m_dataTable, tRow + i, lCol + j, i18n("Merged with (%1, %2).").tqarg(tRow + 1).tqarg(lCol + 1));
m_dataTable->item(tRow + i, lCol + j)->setEnabled(false);
TableNode *tableNode = &((*m_tableTags)[tRow + i][lCol + j]);
Node::deleteNode(tableNode->node);
@@ -1163,7 +1163,7 @@ void TableEditor::slotEditChildTable()
table = *it;
if (table.row == m_row && table.col == m_col) {
TQString cellData = m_dataTable->text(table.row, table.col);
- int pos = cellData.find(table.nestedData);
+ int pos = cellData.tqfind(table.nestedData);
if (pos == -1) {
KMessageBox::error(this, i18n("Cannot edit the child table; you probably modified the cell containing the table manually."), i18n("Cannot Read Table"));
error = true;
@@ -1182,9 +1182,9 @@ void TableEditor::slotEditChildTable()
baseNode = localParser->parse(w);
tempDocCreated = true;
//try to find the child table position
- int pos2 = tableData.find(cellData);
+ int pos2 = tableData.tqfind(cellData);
if (pos2 != -1)
- pos2 = tableData.find(table.nestedData, pos2);
+ pos2 = tableData.tqfind(table.nestedData, pos2);
else {
KMessageBox::error(this, i18n("Cannot edit the child table; you probably modified the cell containing the table manually."), i18n("Cannot Read Table"));
error = true;
@@ -1192,8 +1192,8 @@ void TableEditor::slotEditChildTable()
break;
}
tableData = tableData.left(pos2);
- table.bLine = tableData.contains('\n');
- pos2 = tableData.findRev('\n');
+ table.bLine = tableData.tqcontains('\n');
+ pos2 = tableData.tqfindRev('\n');
if (pos2 != -1) {
table.bCol = tableData.length() - pos2;
} else {
@@ -1214,7 +1214,7 @@ void TableEditor::slotEditChildTable()
if (editor.exec()) {
int length = table.nestedData.length();
(*it).nestedData = editor.readModifiedTable();
- cellData.replace(pos, length, (*it).nestedData);
+ cellData.tqreplace(pos, length, (*it).nestedData);
setCellText(m_dataTable, table.row, table.col, cellData);
}
//cleanup on success
@@ -1271,27 +1271,27 @@ void TableEditor::configureCell(int row, int col, Node * node)
return;
// Header (TH) or standard cell?
item->setHeader(node->tag->name.lower() == "th");
- // Horizontal alignment
- Qt::AlignmentFlags flags;
+ //Qt::Horizontal tqalignment
+ TQt::AlignmentFlags flags;
TQString align = node->tag->attributeValue("align", true);
if (align == "right")
- flags = Qt::AlignRight;
+ flags = TQt::AlignRight;
else if (align == "center")
- flags = Qt::AlignHCenter;
+ flags = TQt::AlignHCenter;
else if (align == "justify")
- flags = Qt::AlignJustify;
+ flags = TQt::AlignJustify;
else if (align.isEmpty() && item->header())
- flags = Qt::AlignHCenter; // TH is centered by default
+ flags = TQt::AlignHCenter; // TH is centered by default
else
- flags = Qt::AlignLeft;
- item->setAlignment(flags);
- // Vertical alignment
+ flags = TQt::AlignLeft;
+ item->tqsetAlignment(flags);
+ //Qt::Vertical tqalignment
TQString valign = node->tag->attributeValue("valign", true);
if (valign == "top")
- flags = Qt::AlignTop;
+ flags = TQt::AlignTop;
else if (valign == "bottom")
- flags = Qt::AlignBottom;
- else flags = Qt::AlignVCenter;
+ flags = TQt::AlignBottom;
+ else flags = TQt::AlignVCenter;
item->setVAlignment(flags);
}