Spreadsheet: Removed own expression parser and instead use the one in App.

This commit is contained in:
Eivind Kvedalen
2016-03-17 00:32:00 +01:00
committed by wmayer
parent 4f7470c5e8
commit ae111d11b5
33 changed files with 121 additions and 3666 deletions

View File

@@ -151,17 +151,17 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
float coloffset = 0.0;
float cellheight = 100;
float cellwidth = 100;
std::string celltext;
std::string celltext;
Spreadsheet::Sheet* sheet = static_cast<Spreadsheet::Sheet*>(link);
std::vector<std::string> skiplist;
for (std::vector<std::string>::const_iterator col = columns.begin(); col != columns.end(); ++col) {
for (std::vector<std::string>::const_iterator col = columns.begin(); col != columns.end(); ++col) {
// create a group for each column
result << " <g id=\"" << ViewName << "_col" << (*col) << "\">" << endl;
for (std::vector<int>::const_iterator row = rows.begin(); row != rows.end(); ++row) {
// get cell size
std::stringstream srow;
srow << (*row);
Spreadsheet::CellAddress address((*col) + srow.str());
App::CellAddress address((*col) + srow.str());
cellwidth = sheet->getColumnWidth(address.col());
cellheight = sheet->getRowHeight(address.row());
celltext = "";
@@ -216,7 +216,7 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
if (cell->getSpans(rowspan,colspan)) {
for (int i=0; i<colspan; ++i) {
for (int j=0; j<rowspan; ++j) {
Spreadsheet::CellAddress nextcell(address.row()+j,address.col()+i);
App::CellAddress nextcell(address.row()+j,address.col()+i);
if (i > 0)
cellwidth = cellwidth + sheet->getColumnWidth(nextcell.col());
if (j > 0)
@@ -227,7 +227,7 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
}
}
cell->getAlignment(alignment);
}
}
// skip cell if found in skiplist
if (std::find(skiplist.begin(), skiplist.end(), address.toString()) == skiplist.end()) {
result << " <rect x=\"" << coloffset << "\" y=\"" << rowoffset << "\" width=\"" << cellwidth
@@ -241,7 +241,7 @@ App::DocumentObjectExecReturn *FeatureViewSpreadsheet::execute(void)
result << " <text text-anchor=\"end\" style=\"" << textstyle << "\" x=\"" << coloffset + (cellwidth - FontSize.getValue()/2) << "\" y=\"" << rowoffset + 0.75 * cellheight << "\" font-family=\"" ;
result << Font.getValue() << "\"" << " font-size=\"" << FontSize.getValue() << "\""
<< " fill=\"" << fcolor << "\">" << celltext << "</text>" << endl;
}
}
rowoffset = rowoffset + cellheight;
}
result << " </g>" << endl;