void CharStyle::getNamedResources(ResourceCollection& lists) const { for (const Style* sty = parentStyle(); sty != NULL; sty = sty->parentStyle()) lists.collectCharStyle(sty->name()); lists.collectColor(fillColor()); lists.collectColor(strokeColor()); lists.collectFont(font().scName()); }
void TableStyle::getNamedResources(ResourceCollection& lists) const { for (const BaseStyle* style = parentStyle(); style != nullptr; style = style->parentStyle()) lists.collectCellStyle(style->name()); lists.collectColor(fillColor()); // TODO: Collect colors of borders. }
void LineStyle::getNamedResources(ResourceCollection& lists) const { QList<LineStyle>::const_iterator it, itend = m_Sublines.constEnd(); lists.collectColor(color()); for (const Style* sty = parentStyle(); sty != NULL; sty = sty->parentStyle()) lists.collectLineStyle(sty->name()); for (it = m_Sublines.begin(); it != itend; ++it) (*it).getNamedResources(lists); }
void PageItem_Group::getNamedResources(ResourceCollection& lists) const { if (hasSoftShadow()) lists.collectColor(softShadowColor()); for (int em = 0; em < groupItemList.count(); ++em) { PageItem* embedded = groupItemList.at(em); embedded->getNamedResources(lists); } }
void PageItem_Table::getNamedResources(ResourceCollection& lists) const { TableBorder lborder = leftBorder(); foreach (const TableBorderLine& line, lborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } TableBorder rborder = rightBorder(); foreach (const TableBorderLine& line, rborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } TableBorder bborder = bottomBorder(); foreach (const TableBorderLine& line, bborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } TableBorder tborder = topBorder(); foreach (const TableBorderLine& line, tborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } QString tableStyleName = this->styleName(); if (!tableStyleName.isEmpty()) lists.collectTableStyle(tableStyleName); for (int row = 0; row < rows(); ++row) { int colSpan = 0; for (int col = 0; col < columns(); col += colSpan) { TableCell cell = cellAt(row, col); PageItem_TextFrame* textFrame = cell.textFrame(); textFrame->getNamedResources(lists); QString cellStyle = cell.styleName(); if (!cellStyle.isEmpty()) lists.collectCellStyle(cellStyle); QString cellFill = cell.fillColor(); if (cellFill != CommonStrings::None) lists.collectColor(cellFill); lborder = cell.leftBorder(); foreach (const TableBorderLine& line, lborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } rborder = cell.rightBorder(); foreach (const TableBorderLine& line, rborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } bborder = cell.bottomBorder(); foreach (const TableBorderLine& line, bborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } tborder = cell.topBorder(); foreach (const TableBorderLine& line, tborder.borderLines()) { if (line.color() == CommonStrings::None) continue; lists.collectColor(line.color()); } colSpan = cell.columnSpan(); } } PageItem::getNamedResources(lists); }