TechDraw: Fix spreadsheet incorrect render due to cell merges

This commit is contained in:
Ryan Kembrey
2025-09-08 00:23:22 +10:00
committed by Chris Hennes
parent ff349c81d6
commit ddaa841036

View File

@@ -259,12 +259,16 @@ std::string DrawViewSpreadsheet::getSheetImage()
col != validColNames.end(); ++col) {
// create a group for each column
result << " <g id=\"" << ViewName << "_col" << (*col) << "\">" << std::endl;
float naturalColumnWidth = 0.0;
for (std::vector<int>::const_iterator row = validRowNumbers.begin();
row != validRowNumbers.end(); ++row) {
// get cell size
std::stringstream srow;
srow << (*row);
App::CellAddress address((*col) + srow.str());
if (naturalColumnWidth == 0.0) {
naturalColumnWidth = sheet->getColumnWidth(address.col());
}
cellwidth = sheet->getColumnWidth(address.col());
cellheight = sheet->getRowHeight(address.row());
celltext = "";
@@ -372,7 +376,7 @@ std::string DrawViewSpreadsheet::getSheetImage()
}
result << " </g>" << std::endl;
rowoffset = 0.0;
coloffset += cellwidth;
coloffset += naturalColumnWidth;
}
// close the containing group