[TD]fix display of spreadsheet cells with no horiz alignment

This commit is contained in:
wandererfan
2024-07-06 14:36:20 -04:00
committed by WandererFan
parent 1b2707f00a
commit 5570c7eadb

View File

@@ -353,6 +353,18 @@ std::string DrawViewSpreadsheet::getSheetImage()
<< " font-size=\"" << TextSize.getValue() << "\""
<< " fill=\"" << fcolor << "\">" << celltext << "</text>" << std::endl;
}
if (!(alignment & Spreadsheet::Cell::ALIGNMENT_LEFT) &&
!(alignment & Spreadsheet::Cell::ALIGNMENT_RIGHT) &&
!(alignment & Spreadsheet::Cell::ALIGNMENT_HCENTER) ) {
// no horizontal alignment specified, so we will default to
// Spreadsheet::Cell::ALIGNMENT_LEFT
result << " <text style=\"" << textstyle << "\" x=\""
<< coloffset + TextSize.getValue() / 2 << "\" y=\""
<< rowoffset + 0.75 * cellheight << "\" font-family=\"";
result << Font.getValue() << "\""
<< " font-size=\"" << TextSize.getValue() << "\""
<< " fill=\"" << fcolor << "\">" << celltext << "</text>" << std::endl;
}
}
rowoffset += sheet->getRowHeight(address.row());
}