This action will force synchronization from sulayman_tien/poco, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
//// Table.cpp//#include "Poco/PDF/Table.h"namespace Poco {namespace PDF {Table::Table(int columnCount, int rowCount, const std::string& name, Cell::FontMapPtr pFontMap):_name(name), _cells(rowCount, TableRow(columnCount)){setFonts(pFontMap);}Table::~Table(){}void Table::addRow(){_cells.push_back(TableRow(columns()));}void Table::addRow(const TableRow& row){if (_cells.empty()){_cells.push_back(row);}else{_cells.push_back(row);_cells.back().resize(_cells.front().size());}}void Table::setCell(int col, int row, const Cell& cell){_cells[row][col] = cell;if (_pFontMap && !cell.getFonts()) _cells[row][col].setFonts(_pFontMap);}void Table::setColumnWidth(int col, double width){}void Table::setFonts(Cell::FontMapPtr pFontMap){_pFontMap = pFontMap;if (_pFontMap) { poco_assert(_pFontMap->size() == 4); }}void Table::draw(Page& page, float x, float y, float width, float height){if (_cells.size()){int rows = static_cast<int>(_cells.size());int cols = static_cast<int>(_cells[0].size());int r = 0;for (Cells::iterator it = _cells.begin(); it != _cells.end(); ++it){TableRow& row(*it);float h = height / rows;int c = 0;float lastX = x;for (TableRow::iterator itr = row.begin(); itr != row.end(); ++itr){Cell& cell(*itr);float w = width / cols;if (!cell.hasWidth()){cell.draw(page, x + (w * c), y - (h * r), w, h);lastX += (w * c);}else{w = width * cell.getWidthAsPct() / 100.0f;cell.draw(page, lastX, y - (h * r), w, h);lastX += w;}++c;}++r;}}}} } // namespace Poco::PDF
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。