r16866 by craig - Write cell definitions to SLAs now
scribus-commit
scribus-commit at lists.scribus.net
Fri Sep 30 22:06:47 UTC 2011
Author: craig
Date: Fri Sep 30 22:06:47 2011
New Revision: 16866
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16866
Log:
Write cell definitions to SLAs now
Modified:
trunk/Scribus/scribus/pageitem_table.h
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
Modified: trunk/Scribus/scribus/pageitem_table.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16866&path=/trunk/Scribus/scribus/pageitem_table.h
==============================================================================
--- trunk/Scribus/scribus/pageitem_table.h (original)
+++ trunk/Scribus/scribus/pageitem_table.h Fri Sep 30 22:06:47 2011
@@ -454,8 +454,11 @@
/// Returns a textual description of this item.
virtual QString infoDescription() { return QString(); }
- // Returns the Cell Areas from this table
+ /// Returns the Cell Areas from this table
QList<CellArea> cellAreas() const { return m_cellAreas; }
+
+ /// Returns the rows of the table for writing to SLA
+ QList<QList<TableCell> > cellRows() const { return m_cellRows; }
signals:
/// This signal is emitted whenever the table changes.
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16866&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Fri Sep 30 22:06:47 2011
@@ -1736,12 +1736,89 @@
{
WriteObjects(m_Doc, docu, baseDir, 0, 0, ItemSelectionGroup, &item->groupItemList);
}
-
+ //Write all the cells and their data to the document, as sub-elements of the pageitem.
if (item->isTable())
{
//PTYPE == PageItem::Table or 16 (pageitem.h)
PageItem_Table* tableItem=item->asTable();
docu.writeStartElement("TableData");
+ //for each cell, write it to the doc
+ foreach (QList<TableCell> cellRow, tableItem->cellRows())
+ {
+ docu.writeStartElement("Row");
+ foreach(TableCell cell, cellRow)
+ {
+ docu.writeStartElement("Cell");
+ docu.writeAttribute("Row", cell.row());
+ docu.writeAttribute("Column",cell.column());
+ docu.writeAttribute("RowSpan", cell.rowSpan());
+ docu.writeAttribute("ColSpan",cell.columnSpan());
+ docu.writeAttribute("Style",cell.style());
+ //TODO
+ //BoundRect?
+ //ContentRect?
+ docu.writeAttribute("FillColor", cell.fillColor());
+ docu.writeAttribute("LeftPadding",cell.leftPadding());
+ docu.writeAttribute("RightPadding", cell.rightPadding());
+ docu.writeAttribute("TopPadding",cell.topPadding());
+ docu.writeAttribute("BottomPadding", cell.bottomPadding());
+
+ TableBorder tbLeft=cell.leftBorder();
+ docu.writeStartElement("TableBorderLeft");
+ docu.writeAttribute("Width", tbLeft.width());
+ foreach (TableBorderLine tbl, tbLeft.borderLines())
+ {
+ docu.writeStartElement("TableBorderLine");
+ docu.writeAttribute("Width", tbl.width());
+ docu.writeAttribute("PenStyle", tbl.style());
+ docu.writeAttribute("Color", tbl.color());
+ docu.writeEndElement();
+ }
+ docu.writeEndElement();
+
+ TableBorder tbRight=cell.rightBorder();
+ docu.writeStartElement("TableBorderRight");
+ docu.writeAttribute("Width", tbRight.width());
+ foreach (TableBorderLine tbl, tbRight.borderLines())
+ {
+ docu.writeStartElement("TableBorderLine");
+ docu.writeAttribute("Width", tbl.width());
+ docu.writeAttribute("PenStyle", tbl.style());
+ docu.writeAttribute("Color", tbl.color());
+ docu.writeEndElement();
+ }
+ docu.writeEndElement();
+
+ TableBorder tbTop=cell.topBorder();
+ docu.writeStartElement("TableBorderTop");
+ docu.writeAttribute("Width", tbTop.width());
+ foreach (TableBorderLine tbl, tbTop.borderLines())
+ {
+ docu.writeStartElement("TableBorderLine");
+ docu.writeAttribute("Width", tbl.width());
+ docu.writeAttribute("PenStyle", tbl.style());
+ docu.writeAttribute("Color", tbl.color());
+ docu.writeEndElement();
+ }
+ docu.writeEndElement();
+
+ TableBorder tbBottom=cell.bottomBorder();
+ docu.writeStartElement("TableBorderBottom");
+ docu.writeAttribute("Width", tbBottom.width());
+ foreach (TableBorderLine tbl, tbBottom.borderLines())
+ {
+ docu.writeStartElement("TableBorderLine");
+ docu.writeAttribute("Width", tbl.width());
+ docu.writeAttribute("PenStyle", tbl.style());
+ docu.writeAttribute("Color", tbl.color());
+ docu.writeEndElement();
+ }
+ docu.writeEndElement();
+ //End Cell
+ docu.writeEndElement();
+ }
+ docu.writeEndElement();
+ }
docu.writeEndElement();
}
More information about the scribus-commit
mailing list