[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/libs/kotext/opendocument
From: Carlos Licea <carlos_licea () hotmail ! com>
Date: 2010-09-14 19:07:36
Message-ID: 20100914190736.6BC32AC888 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1175336 by clicea:
Load properly the default cell style for the rows and columns on a table.
M +25 -2 KoTextLoader.cpp
--- trunk/koffice/libs/kotext/opendocument/KoTextLoader.cpp #1175335:1175336
@@ -1200,6 +1200,15 @@
}
}
}
+
+ QString defaultCellStyleName = \
tblTag.attributeNS(KoXmlNS::table, "default-cell-style-name", ""); + \
if (!defaultCellStyleName.isEmpty()) { + for (int c = columns; \
c < columns + repeatColumn; c++) { + KoTableCellStyle \
*cellStyle = d->textSharedData->tableCellStyle(defaultCellStyleName, \
d->stylesDotXml); + \
tcarManager->setDefaultColumnCellStyle(c, cellStyle); + }
+ }
+
columns = columns + repeatColumn;
if (rows > 0)
tbl->resize(rows, columns);
@@ -1213,6 +1222,13 @@
tcarManager->setRowStyle(rows, *rowStyle);
}
}
+
+ QString defaultCellStyleName = \
tblTag.attributeNS(KoXmlNS::table, "default-cell-style-name", ""); + \
if (!defaultCellStyleName.isEmpty()) { + KoTableCellStyle \
*cellStyle = d->textSharedData->tableCellStyle(defaultCellStyleName, \
d->stylesDotXml); + tcarManager->setDefaultRowCellStyle(rows, \
cellStyle); + }
+
rows++;
if (columns > 0)
tbl->resize(rows, columns);
@@ -1237,13 +1253,20 @@
if (cell.isValid()) {
QString cellStyleName = \
rowTag.attributeNS(KoXmlNS::table, "style-name", ""); + \
KoTableCellStyle *cellStyle = 0; if (!cellStyleName.isEmpty()) {
- KoTableCellStyle *cellStyle = \
d->textSharedData->tableCellStyle(cellStyleName, d->stylesDotXml); + \
cellStyle = d->textSharedData->tableCellStyle(cellStyleName, d->stylesDotXml); + \
} else if (tcarManager->defaultRowCellStyle(currentRow)) { + \
cellStyle = tcarManager->defaultRowCellStyle(currentRow); + \
} else if (tcarManager->defaultColumnCellStyle(currentCell)) { + \
cellStyle = tcarManager->defaultColumnCellStyle(currentCell); + \
} +
QTextTableCellFormat cellFormat = \
cell.format().toTableCellFormat(); + \
Q_ASSERT(cellStyle); if (cellStyle)
cellStyle->applyStyle(cellFormat);
cell.setFormat(cellFormat);
- }
// handle inline Rdf
// rowTag is the current table cell.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic