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.cpp230
1 files changed, 115 insertions, 115 deletions
diff --git a/quanta/components/tableeditor/tableeditor.cpp b/quanta/components/tableeditor/tableeditor.cpp
index 970828a2..bb581859 100644
--- a/quanta/components/tableeditor/tableeditor.cpp
+++ b/quanta/components/tableeditor/tableeditor.cpp
@@ -25,16 +25,16 @@
#include <ktexteditor/editinterface.h>
//qt includes
-#include <qcheckbox.h>
-#include <qiconset.h>
-#include <qlineedit.h>
-#include <qobject.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qspinbox.h>
-#include <qstring.h>
-#include <qtabwidget.h>
-#include <qvaluevector.h>
+#include <tqcheckbox.h>
+#include <tqiconset.h>
+#include <tqlineedit.h>
+#include <tqobject.h>
+#include <tqpoint.h>
+#include <tqrect.h>
+#include <tqspinbox.h>
+#include <tqstring.h>
+#include <tqtabwidget.h>
+#include <tqvaluevector.h>
//own includes
#include "tagdialog.h"
@@ -48,25 +48,25 @@
int newNum;
-TableEditor::TableEditor(QWidget* parent, const char* name)
+TableEditor::TableEditor(TQWidget* parent, const char* name)
: TableEditorS(parent, name)
{
m_popup = new KPopupMenu();
- m_cellEditId = m_popup->insertItem(i18n("&Edit Cell Properties"), this ,SLOT(slotEditCell()));
- m_rowEditId = m_popup->insertItem(i18n("Edit &Row Properties"), this ,SLOT(slotEditRow()));
- // m_colEditId = m_popup->insertItem(i18n("Edit &Column Properties"), this ,SLOT(slotEditCol()));
+ m_cellEditId = m_popup->insertItem(i18n("&Edit Cell Properties"), this ,TQT_SLOT(slotEditCell()));
+ m_rowEditId = m_popup->insertItem(i18n("Edit &Row Properties"), this ,TQT_SLOT(slotEditRow()));
+ // m_colEditId = m_popup->insertItem(i18n("Edit &Column Properties"), this ,TQT_SLOT(slotEditCol()));
m_mergeSeparatorId = m_popup->insertSeparator();
- m_mergeCellsId = m_popup->insertItem(i18n("Merge Cells"), this, SLOT(slotMergeCells()));
- m_unmergeCellsId = m_popup->insertItem(i18n("Break Merging"), this, SLOT(slotUnmergeCells()));
+ m_mergeCellsId = m_popup->insertItem(i18n("Merge Cells"), this, TQT_SLOT(slotMergeCells()));
+ m_unmergeCellsId = m_popup->insertItem(i18n("Break Merging"), this, TQT_SLOT(slotUnmergeCells()));
m_popup->insertSeparator();
- m_popup->insertItem(i18n("&Insert Row"), this, SLOT(slotInsertRow()));
- m_popup->insertItem(i18n("Insert Co&lumn"), this, SLOT(slotInsertCol()));
- m_popup->insertItem(i18n("Remove Row"), this, SLOT(slotRemoveRow()));
- m_popup->insertItem(i18n("Remove Column"), this, SLOT(slotRemoveCol()));
+ m_popup->insertItem(i18n("&Insert Row"), this, TQT_SLOT(slotInsertRow()));
+ m_popup->insertItem(i18n("Insert Co&lumn"), this, TQT_SLOT(slotInsertCol()));
+ m_popup->insertItem(i18n("Remove Row"), this, TQT_SLOT(slotRemoveRow()));
+ m_popup->insertItem(i18n("Remove Column"), this, TQT_SLOT(slotRemoveCol()));
m_popup->insertSeparator();
- m_popup->insertItem(i18n("Edit &Table Properties"), this, SLOT(slotEditTable()));
- m_editChildId = m_popup->insertItem(i18n("Edit Child Table"), this, SLOT(slotEditChildTable()));
+ m_popup->insertItem(i18n("Edit &Table Properties"), this, TQT_SLOT(slotEditTable()));
+ m_editChildId = m_popup->insertItem(i18n("Edit Child Table"), this, TQT_SLOT(slotEditChildTable()));
buttonOk->setIconSet(SmallIconSet("button_ok"));
buttonCancel->setIconSet(SmallIconSet("button_cancel"));
@@ -79,38 +79,38 @@ TableEditor::TableEditor(QWidget* parent, const char* name)
m_table = 0L;
m_dtd = 0L;
m_write = 0L;
- m_tableDataTags = new QValueList<QValueList<TableNode> >;
- m_tableHeaderTags = new QValueList<QValueList<TableNode> >;
- m_tableFooterTags = new QValueList<QValueList<TableNode> >;
+ m_tableDataTags = new TQValueList<TQValueList<TableNode> >;
+ m_tableHeaderTags = new TQValueList<TQValueList<TableNode> >;
+ m_tableFooterTags = new TQValueList<TQValueList<TableNode> >;
m_tableTags = 0L;
- m_tableDataRows = new QValueList<TableNode>;
- m_tableHeaderRows = new QValueList<TableNode>;
- m_tableFooterRows = new QValueList<TableNode>;
+ m_tableDataRows = new TQValueList<TableNode>;
+ m_tableHeaderRows = new TQValueList<TableNode>;
+ m_tableFooterRows = new TQValueList<TableNode>;
m_tableRows = 0L;
m_createNodes = true;
newNum += 7;
- connect(headerColSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int)));
- connect(headerRowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int)));
- connect(rowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int)));
- connect(colSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int)));
- connect(footerRowSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveRow(int)));
- connect(footerColSpinBox, SIGNAL(valueChanged(int)), SLOT(slotAddRemoveCol(int)));
- connect(tableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)),
- SLOT(slotContextMenuRequested(int,int,const QPoint&)));
- connect(pushButton7, SIGNAL(clicked()), SLOT(slotEditTable()));
- connect(pushButton7_2, SIGNAL(clicked()), SLOT(slotEditTableBody()));
- connect(pushButton7_3, SIGNAL(clicked()), SLOT(slotEditTableHeader()));
- connect(pushButton7_4, SIGNAL(clicked()), SLOT(slotEditTableFooter()));
- connect(headerTableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)),
- SLOT(slotContextMenuRequested(int,int,const QPoint&)));
- connect(footerTableData, SIGNAL(contextMenuRequested(int,int,const QPoint&)),
- SLOT(slotContextMenuRequested(int,int,const QPoint&)));
- connect(tabWidget, SIGNAL(currentChanged(QWidget*)), SLOT(slotTabChanged(QWidget*)));
- connect(buttonHelp, SIGNAL(clicked()), SLOT(slotHelpInvoked()));
- connect(tableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int)));
- connect(headerTableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int)));
- connect(footerTableData, SIGNAL(valueChanged(int,int)), SLOT(slotEditCellText(int,int)));
+ connect(headerColSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotAddRemoveCol(int)));
+ connect(headerRowSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotAddRemoveRow(int)));
+ connect(rowSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotAddRemoveRow(int)));
+ connect(colSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotAddRemoveCol(int)));
+ connect(footerRowSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotAddRemoveRow(int)));
+ connect(footerColSpinBox, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(slotAddRemoveCol(int)));
+ connect(tableData, TQT_SIGNAL(contextMenuRequested(int,int,const TQPoint&)),
+ TQT_SLOT(slotContextMenuRequested(int,int,const TQPoint&)));
+ connect(pushButton7, TQT_SIGNAL(clicked()), TQT_SLOT(slotEditTable()));
+ connect(pushButton7_2, TQT_SIGNAL(clicked()), TQT_SLOT(slotEditTableBody()));
+ connect(pushButton7_3, TQT_SIGNAL(clicked()), TQT_SLOT(slotEditTableHeader()));
+ connect(pushButton7_4, TQT_SIGNAL(clicked()), TQT_SLOT(slotEditTableFooter()));
+ connect(headerTableData, TQT_SIGNAL(contextMenuRequested(int,int,const TQPoint&)),
+ TQT_SLOT(slotContextMenuRequested(int,int,const TQPoint&)));
+ connect(footerTableData, TQT_SIGNAL(contextMenuRequested(int,int,const TQPoint&)),
+ TQT_SLOT(slotContextMenuRequested(int,int,const TQPoint&)));
+ connect(tabWidget, TQT_SIGNAL(currentChanged(TQWidget*)), TQT_SLOT(slotTabChanged(TQWidget*)));
+ connect(buttonHelp, TQT_SIGNAL(clicked()), TQT_SLOT(slotHelpInvoked()));
+ connect(tableData, TQT_SIGNAL(valueChanged(int,int)), TQT_SLOT(slotEditCellText(int,int)));
+ connect(headerTableData, TQT_SIGNAL(valueChanged(int,int)), TQT_SLOT(slotEditCellText(int,int)));
+ connect(footerTableData, TQT_SIGNAL(valueChanged(int,int)), TQT_SLOT(slotEditCellText(int,int)));
}
TableEditor::~TableEditor()
@@ -130,7 +130,7 @@ TableEditor::~TableEditor()
kdDebug(24000) << "Undeleted new: " << newNum << endl;
}
-void TableEditor::slotContextMenuRequested( int row, int col, const QPoint & pos )
+void TableEditor::slotContextMenuRequested( int row, int col, const TQPoint & pos )
{
m_row = row;
m_col = col;
@@ -149,9 +149,9 @@ void TableEditor::slotContextMenuRequested( int row, int col, const QPoint & pos
m_popup->setItemVisible(m_unmergeCellsId, true);
m_popup->setItemVisible(m_mergeSeparatorId, true);
}
- QTableSelection selection = m_dataTable->selection(m_dataTable->currentSelection());
- QRect rect(QPoint(selection.topRow(), selection.leftCol()) ,
- QPoint(selection.bottomRow(), selection.rightCol()));
+ 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)) {
m_popup->setItemVisible(m_mergeCellsId, true);
m_popup->setItemVisible(m_mergeSeparatorId, true);
@@ -257,8 +257,8 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
m_rowSpin = 0L;
m_colSpin = 0L;
m_dataTable = 0L;
- QValueList<TableNode> tableRowTags;
- QValueVector< QValueVector<TableNode> > mergeMatrix;
+ TQValueList<TableNode> tableRowTags;
+ TQValueVector< TQValueVector<TableNode> > mergeMatrix;
mergeMatrix.resize(pInitialTableSize);
for (uint i = 0; i < pInitialTableSize; i++)
mergeMatrix[i].resize(pInitialTableSize);
@@ -266,7 +266,7 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
Node *n = node;
while (n != lastNode->nextSibling())
{
- QString tagName = n->tag->name.lower();
+ TQString tagName = n->tag->name.lower();
if (tagName == "table")
{
if (m_table && m_dataTable && nRow > 0 && nCol > 0) //nested table!
@@ -283,7 +283,7 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
table.node = n;
table.nestedData = m_write->text(table.bLine, table.bCol, table.eLine, table.eCol);
m_nestedTables.append(table);
- m_dataTable->item(nRow -1, nCol -1)->setPixmap(QIconSet(UserIcon("quick_table")).pixmap());
+ m_dataTable->item(nRow -1, nCol -1)->setPixmap(TQIconSet(UserIcon("quick_table")).pixmap());
m_dataTable->updateCell(nRow - 1, nCol - 1);
}
n = n->next;
@@ -482,7 +482,7 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
tableNode.merged = false;
tableRowTags.append(tableNode);
}
- QString colspanValue = n->tag->attributeValue("colspan", true);
+ TQString colspanValue = n->tag->attributeValue("colspan", true);
int colValue = 1;
int lastCol = nCol;
if (!colspanValue.isEmpty())
@@ -510,7 +510,7 @@ bool TableEditor::setTableArea( int bLine, int bCol, int eLine, int eCol, Parser
} else
colValue = 1;
}
- QString rowspanValue = n->tag->attributeValue("rowspan", true);
+ TQString rowspanValue = n->tag->attributeValue("rowspan", true);
if (!rowspanValue.isEmpty())
{
bool ok;
@@ -602,7 +602,7 @@ void TableEditor::slotEditTableFooter()
}
-void TableEditor::slotTabChanged( QWidget *w)
+void TableEditor::slotTabChanged( TQWidget *w)
{
int i = tabWidget->indexOf(w);
switch (i)
@@ -636,9 +636,9 @@ void TableEditor::slotTabChanged( QWidget *w)
}
-QString TableEditor::readModifiedTable()
+TQString TableEditor::readModifiedTable()
{
- QString tableString;
+ TQString tableString;
tableString = m_table->toString();
if (!captionText->text().isEmpty()) {
tableString += indent(2);
@@ -646,7 +646,7 @@ QString TableEditor::readModifiedTable()
tableString += captionText->text();
tableString += "</" + QuantaCommon::tagCase("caption") + ">";
}
- for (QValueList<Tag*>::Iterator it = m_colTags.begin(); it != m_colTags.end(); ++it) {
+ for (TQValueList<Tag*>::Iterator it = m_colTags.begin(); it != m_colTags.end(); ++it) {
tableString += indent(2);
tableString += (*it)->toString();
}
@@ -701,23 +701,23 @@ QString TableEditor::readModifiedTable()
}
-QString TableEditor::indent( int n )
+TQString TableEditor::indent( int n )
{
- QString str;
+ TQString str;
str.fill(' ', n);
str.prepend('\n');
return str;
}
-QString TableEditor::cellValue( int row, int col )
+TQString TableEditor::cellValue( int row, int col )
{
if (!m_dataTable)
- return QString::null;
- QString str;
+ return TQString::null;
+ TQString str;
Node *node = (*m_tableTags)[row][col].node;
if (!node)
- return QString::null;
+ return TQString::null;
str = node->tag->toString();
str += m_dataTable->text(row, col);
str += "</" + QuantaCommon::tagCase(node->tag->name) + ">";
@@ -725,9 +725,9 @@ QString TableEditor::cellValue( int row, int col )
}
-QString TableEditor::tableToString()
+TQString TableEditor::tableToString()
{
- QString tableStr;
+ TQString tableStr;
for (int i = 0; i < m_dataTable->numRows(); i++) {
tableStr += indent(4);
Node *node = (*m_tableRows)[i].node;
@@ -755,11 +755,11 @@ QString TableEditor::tableToString()
}
-QString TableEditor::tagContent(Node *node)
+TQString TableEditor::tagContent(Node *node)
{
if (!node)
- return QString::null;
- QString content;
+ return TQString::null;
+ TQString content;
int bl, bc, el, ec;
node->tag->endPos(bl, bc);
bc++;
@@ -775,7 +775,7 @@ QString TableEditor::tagContent(Node *node)
n->tag->beginPos(el, ec);
ec--;
} else {
- return QString::null;
+ return TQString::null;
}
}
content = m_write->text(bl, bc, el, ec);
@@ -798,12 +798,12 @@ void TableEditor::slotInsertRow()
tableNode.node->tag = new Tag();
tableNode.node->tag->setDtd(m_dtd);
tableNode.node->tag->parse("<tr>", m_write);
- QValueList<TableNode>::Iterator rowIt = m_tableRows->at(num);
+ TQValueList<TableNode>::Iterator rowIt = m_tableRows->at(num);
if (rowIt != m_tableRows->end())
m_tableRows->insert(rowIt, tableNode);
else
m_tableRows->append(tableNode);
- QValueList<TableNode> tableRowTags;
+ TQValueList<TableNode> tableRowTags;
for (int i = 0; i < m_dataTable->numCols(); i++) {
tableNode.merged = false;
tableNode.node = new Node(0L);
@@ -818,7 +818,7 @@ void TableEditor::slotInsertRow()
tableRowTags.append(tableNode);
setCellText(m_dataTable, num, i, "");
}
- QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->at(num);
+ TQValueList<TQValueList<TableNode> >::Iterator it = m_tableTags->at(num);
if (it != m_tableTags->end())
m_tableTags->insert(it, tableRowTags);
else
@@ -838,7 +838,7 @@ void TableEditor::slotInsertCol()
if (m_createNodes) {
TableNode tableNode;
int i = 0;
- for (QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
+ for (TQValueList<TQValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
tableNode.merged = false;
tableNode.node = new Node(0L);
newNum++;
@@ -899,9 +899,9 @@ void TableEditor::slotRemoveRow()
m_row = m_dataTable->numRows() - 1;
int i = 0;
int j = 0;
- for (QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
+ for (TQValueList<TQValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
j = 0;
- for (QValueList<TableNode>::Iterator it2 = (*it).begin(); it2 != (*it).end(); ++it2) {
+ for (TQValueList<TableNode>::Iterator it2 = (*it).begin(); it2 != (*it).end(); ++it2) {
if ((*it2).merged && (*it2).mergedRow == m_row) {
(*it2).merged = false;
setCellText(m_dataTable, i, j, tagContent((*it2).node));
@@ -913,9 +913,9 @@ void TableEditor::slotRemoveRow()
}
i++;
}
- QValueList<TableNode*> updatedMainNodes;
- QValueList<QValueList<TableNode> >::Iterator it2 = m_tableTags->at(m_row);
- for (QValueList<TableNode>::Iterator it3 = (*it2).begin(); it3 != (*it2).end(); ++it3) {
+ TQValueList<TableNode*> updatedMainNodes;
+ TQValueList<TQValueList<TableNode> >::Iterator it2 = m_tableTags->at(m_row);
+ for (TQValueList<TableNode>::Iterator it3 = (*it2).begin(); it3 != (*it2).end(); ++it3) {
if ((*it3).merged)
{
TableNode *mainTableNode = &((*m_tableTags)[(*it3).mergedRow][(*it3).mergedCol]);
@@ -924,7 +924,7 @@ void TableEditor::slotRemoveRow()
int rowspan = mainTableNode->node->tag->attributeValue("rowspan", true).toInt();
rowspan--;
if (rowspan > 1)
- mainTableNode->node->tag->editAttribute("rowspan", QString("%1").arg(rowspan));
+ mainTableNode->node->tag->editAttribute("rowspan", TQString("%1").arg(rowspan));
else
mainTableNode->node->tag->deleteAttribute("rowspan");
updatedMainNodes.append(mainTableNode);
@@ -936,7 +936,7 @@ void TableEditor::slotRemoveRow()
}
m_tableTags->erase(it2);
m_dataTable->removeRow(m_row);
- QValueList<TableNode>::Iterator it = m_tableRows->at(m_row);
+ TQValueList<TableNode>::Iterator it = m_tableRows->at(m_row);
Node::deleteNode((*it).node);
newNum--;
m_tableRows->erase(it);
@@ -948,9 +948,9 @@ void TableEditor::slotRemoveCol()
{
int i = 0;
int j = 0;
- for (QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
+ for (TQValueList<TQValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
j = 0;
- for (QValueList<TableNode>::Iterator it2 = (*it).begin(); it2 != (*it).end(); ++it2) {
+ for (TQValueList<TableNode>::Iterator it2 = (*it).begin(); it2 != (*it).end(); ++it2) {
if ((*it2).merged && (*it2).mergedCol == m_col) {
(*it2).merged = false;
setCellText(m_dataTable, i, j, tagContent((*it2).node));
@@ -964,9 +964,9 @@ void TableEditor::slotRemoveCol()
}
if (m_col == -1)
m_col = m_dataTable->numCols() - 1;
- QValueList<TableNode*> updatedMainNodes;
- for (QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
- QValueList<TableNode>::Iterator it2 = (*it).at(m_col);
+ TQValueList<TableNode*> updatedMainNodes;
+ for (TQValueList<TQValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
+ TQValueList<TableNode>::Iterator it2 = (*it).at(m_col);
if ((*it2).merged)
{
TableNode *mainTableNode = &((*m_tableTags)[(*it2).mergedRow][(*it2).mergedCol]);
@@ -975,7 +975,7 @@ void TableEditor::slotRemoveCol()
int colspan = mainTableNode->node->tag->attributeValue("colspan", true).toInt();
colspan--;
if (colspan > 1)
- mainTableNode->node->tag->editAttribute("colspan", QString("%1").arg(colspan));
+ mainTableNode->node->tag->editAttribute("colspan", TQString("%1").arg(colspan));
else
mainTableNode->node->tag->deleteAttribute("colspan");
updatedMainNodes.append(mainTableNode);
@@ -1018,9 +1018,9 @@ void TableEditor::createNewTable(Document *write, const DTDStruct *dtd)
}
-void TableEditor::deleteList( QValueList<TableNode> *table )
+void TableEditor::deleteList( TQValueList<TableNode> *table )
{
- for (QValueList<TableNode>::Iterator it = table->begin(); it != table->end(); ++it) {
+ for (TQValueList<TableNode>::Iterator it = table->begin(); it != table->end(); ++it) {
Node::deleteNode((*it).node);
newNum--;
}
@@ -1029,10 +1029,10 @@ void TableEditor::deleteList( QValueList<TableNode> *table )
}
-void TableEditor::deleteMatrix( QValueList<QValueList<TableNode> > *matrix )
+void TableEditor::deleteMatrix( TQValueList<TQValueList<TableNode> > *matrix )
{
- for (QValueList<QValueList<TableNode> >::Iterator it = matrix->begin(); it != matrix->end(); ++it) {
- for (QValueList<TableNode>::Iterator it2 = (*it).begin(); it2 != (*it).end(); ++it2) {
+ for (TQValueList<TQValueList<TableNode> >::Iterator it = matrix->begin(); it != matrix->end(); ++it) {
+ for (TQValueList<TableNode>::Iterator it2 = (*it).begin(); it2 != (*it).end(); ++it2) {
Node::deleteNode((*it2).node);
newNum--;
}
@@ -1046,7 +1046,7 @@ void TableEditor::slotMergeCells()
{
slotUnmergeCells(); //first unmerge all cells from the selection
- QTableSelection selection = m_dataTable->selection(m_dataTable->currentSelection());
+ TQTableSelection selection = m_dataTable->selection(m_dataTable->currentSelection());
int tRow, bRow, lCol, rCol;
tRow = selection.topRow();
bRow = selection.bottomRow();
@@ -1054,9 +1054,9 @@ void TableEditor::slotMergeCells()
rCol = selection.rightCol();
TableNode *mainTableNode = &((*m_tableTags)[tRow][lCol]);
if (rCol - lCol > 0)
- mainTableNode->node->tag->editAttribute("colspan", QString("%1").arg(rCol - lCol + 1));
+ mainTableNode->node->tag->editAttribute("colspan", TQString("%1").arg(rCol - lCol + 1));
if (bRow - tRow > 0)
- mainTableNode->node->tag->editAttribute("rowspan", QString("%1").arg(bRow - tRow + 1));
+ mainTableNode->node->tag->editAttribute("rowspan", TQString("%1").arg(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) {
@@ -1080,7 +1080,7 @@ void TableEditor::slotUnmergeCells()
int tRow, bRow, lCol, rCol;
int selectionNum = m_dataTable->currentSelection();
if (selectionNum != -1) {
- QTableSelection selection = m_dataTable->selection(selectionNum);
+ TQTableSelection selection = m_dataTable->selection(selectionNum);
tRow = selection.topRow();
bRow = selection.bottomRow();
lCol = selection.leftCol();
@@ -1099,9 +1099,9 @@ void TableEditor::slotUnmergeCells()
TableNode newTableNode;
int i = 0;
int j = 0;
- for (QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
+ for (TQValueList<TQValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
j = 0;
- QValueList<TableNode>::Iterator it2 = (*it).begin();
+ TQValueList<TableNode>::Iterator it2 = (*it).begin();
while (it2 != (*it).end()) {
if ((*it2).merged &&
tableNode.mergedRow == (*it2).mergedRow &&
@@ -1138,8 +1138,8 @@ void TableEditor::slotUnmergeCells()
newTableNode.node = new Node(0L);
newNum++;
newTableNode.node->tag = new Tag(*(tmpNode.node->tag));
- QValueList<QValueList<TableNode> >::Iterator iter1 = m_tableTags->at(tableNode.mergedRow);
- QValueList<TableNode>::Iterator iter2 = (*iter1).at(tableNode.mergedCol);
+ TQValueList<TQValueList<TableNode> >::Iterator iter1 = m_tableTags->at(tableNode.mergedRow);
+ TQValueList<TableNode>::Iterator iter2 = (*iter1).at(tableNode.mergedCol);
iter2 = (*iter1).erase(iter2);
(*iter1).insert(iter2, newTableNode);
Node::deleteNode(tmpNode.node);
@@ -1153,16 +1153,16 @@ void TableEditor::slotEditChildTable()
{
bool tempDocCreated = false;
bool error = false;
- QValueList<NestedTable>::Iterator errorIt;
+ TQValueList<NestedTable>::Iterator errorIt;
Parser *localParser = 0L;
Document *w = 0L;
Node *savedBaseNode = 0L;
NestedTable table;
- for (QValueList<NestedTable>::Iterator it = m_nestedTables.begin(); it != m_nestedTables.end(); ++it) {
+ for (TQValueList<NestedTable>::Iterator it = m_nestedTables.begin(); it != m_nestedTables.end(); ++it) {
table = *it;
if (table.row == m_row && table.col == m_col) {
- QString cellData = m_dataTable->text(table.row, table.col);
+ TQString cellData = m_dataTable->text(table.row, table.col);
int pos = cellData.find(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"));
@@ -1174,7 +1174,7 @@ void TableEditor::slotEditChildTable()
KTextEditor::Document *doc =
KTextEditor::createDocument ("libkatepart", 0L, "KTextEditor::Document");
w = new Document(doc, 0L);
- QString tableData = readModifiedTable();
+ TQString tableData = readModifiedTable();
w->editIf->insertText(0, 0, tableData);
localParser = new Parser();
savedBaseNode = baseNode; //we must save it as it's deleted in the localParser->parse();
@@ -1228,7 +1228,7 @@ void TableEditor::slotEditChildTable()
//cleanup on error
if (error) {
m_nestedTables.erase(errorIt);
- m_dataTable->item(table.row, table.col)->setPixmap(QPixmap());
+ m_dataTable->item(table.row, table.col)->setPixmap(TQPixmap());
m_dataTable->updateCell(table.row, table.col);
if (tempDocCreated) {
Node::deleteNode(baseNode);
@@ -1245,7 +1245,7 @@ void TableEditor::slotHelpInvoked()
kapp->invokeHelp("table-editor","quanta");
}
-void TableEditor::configureTable( QTable * table )
+void TableEditor::configureTable( TQTable * table )
{
if (!table)
return;
@@ -1259,9 +1259,9 @@ void TableEditor::configureTable( QTable * table )
table->setRowMovingEnabled(true);
}
-void TableEditor::setCellText( QTable * table, int row, int col, const QString & text )
+void TableEditor::setCellText( TQTable * table, int row, int col, const TQString & text )
{
- table->setItem(row, col, new TableItem(table, QTableItem::OnTyping, text));
+ table->setItem(row, col, new TableItem(table, TQTableItem::OnTyping, text));
}
void TableEditor::configureCell(int row, int col, Node * node)
@@ -1273,7 +1273,7 @@ void TableEditor::configureCell(int row, int col, Node * node)
item->setHeader(node->tag->name.lower() == "th");
// Horizontal alignment
Qt::AlignmentFlags flags;
- QString align = node->tag->attributeValue("align", true);
+ TQString align = node->tag->attributeValue("align", true);
if (align == "right")
flags = Qt::AlignRight;
else if (align == "center")
@@ -1286,7 +1286,7 @@ void TableEditor::configureCell(int row, int col, Node * node)
flags = Qt::AlignLeft;
item->setAlignment(flags);
// Vertical alignment
- QString valign = node->tag->attributeValue("valign", true);
+ TQString valign = node->tag->attributeValue("valign", true);
if (valign == "top")
flags = Qt::AlignTop;
else if (valign == "bottom")