QTextTable *qtable
= cur.
insertTable(rowCounter,constraints.
size(),tf
);
int gorow = -1;
int gocool = -1;
while ( !line.isNull() ) {
if (line.isElement() ) {
if (oorow.tagName() == "table:table-row") {
gorow++;
gocool = -1;
QDomElement oocell
= oorow.
firstChildElement("table:table-cell");
while (!oocell.isNull()) {
gocool++;
const int cr = qMax(oocell.attribute("table:number-rows-spanned").toInt(),0);
const int cs = qMax(oocell.attribute("table:number-columns-spanned").toInt(),0);
qWarning() << "----- spanning /" << cr << "/" << cs << " gocool->" << gocool << " gorow->" << gorow;
if (qMax(cs,cr) !=0) {
/* can not spanning all column */
qtable->mergeCells(gorow,gocool,qAbs(cr - 1),qAbs(cs - 1));
}
cell = qtable->cellAt(gorow,gocool);
//////void QTextTable::mergeCells ( int row, int column, int numRows, int numCols )
/////////////////qWarning() << " cursor on cella /" << gorow << "/" << gocool;
if (!convertCellTable(oocell,cell,cur,tname,processing)) {
qWarning() << "Error on parse table cell row:" << gorow << " column:" << gocool;
}
oocell = oocell.nextSiblingElement("table:table-cell");
}
}
}
line = line.nextSibling();
}
QTextTable *qtable = cur.insertTable(rowCounter,constraints.size(),tf);
int gorow = -1;
int gocool = -1;
while ( !line.isNull() ) {
if (line.isElement() ) {
const QDomElement oorow = line.toElement();
if (oorow.tagName() == "table:table-row") {
gorow++;
gocool = -1;
QDomElement oocell = oorow.firstChildElement("table:table-cell");
while (!oocell.isNull()) {
gocool++;
const QTextTableCell ctd = qtable->cellAt(gorow,gocool);
const int cr = qMax(oocell.attribute("table:number-rows-spanned").toInt(),0);
const int cs = qMax(oocell.attribute("table:number-columns-spanned").toInt(),0);
qWarning() << "----- spanning /" << cr << "/" << cs << " gocool->" << gocool << " gorow->" << gorow;
if (qMax(cs,cr) !=0) {
/* can not spanning all column */
qtable->mergeCells(gorow,gocool,qAbs(cr - 1),qAbs(cs - 1));
}
cell = qtable->cellAt(gorow,gocool);
//////void QTextTable::mergeCells ( int row, int column, int numRows, int numCols )
/////////////////qWarning() << " cursor on cella /" << gorow << "/" << gocool;
if (!convertCellTable(oocell,cell,cur,tname,processing)) {
qWarning() << "Error on parse table cell row:" << gorow << " column:" << gocool;
}
oocell = oocell.nextSiblingElement("table:table-cell");
}
}
}
line = line.nextSibling();
}
To copy to clipboard, switch view to plain text mode
Bookmarks