Spreadsheet: do not copy empty cell
Because pasteCells() will clear empty cells in selected range
This commit is contained in:
@@ -356,20 +356,21 @@ void PropertySheet::copyCells(Base::Writer& writer, const std::vector<Range>& ra
|
||||
writer.Stream() << "<Cells count=\"" << ranges.size() << "\">" << std::endl;
|
||||
writer.incInd();
|
||||
for (auto range : ranges) {
|
||||
auto r = range;
|
||||
int count = 0;
|
||||
do {
|
||||
auto cell = getValue(*r);
|
||||
if(cell && cell->isUsed())
|
||||
++count;
|
||||
}while(r.next());
|
||||
writer.Stream() << writer.ind() << "<Range from=\"" << range.fromCellString()
|
||||
<< "\" to=\"" << range.toCellString() << "\" count=\"" << range.size() << "\">" << std::endl;
|
||||
<< "\" to=\"" << range.toCellString() << "\" count=\"" << count << "\">" << std::endl;
|
||||
writer.incInd();
|
||||
do {
|
||||
auto cell = getValue(*range);
|
||||
if (cell && cell->isUsed()) {
|
||||
cell->save(writer);
|
||||
}
|
||||
else {
|
||||
// The cell is empty, so when it's pasted it needs to clear the existing contents
|
||||
writer.Stream() << writer.ind() << "<Cell "
|
||||
<< "address=\"" << (*range).toString() << "\" "
|
||||
<< "content = \"\" />";
|
||||
}
|
||||
} while (range.next());
|
||||
writer.decInd();
|
||||
writer.Stream() << writer.ind() << "</Range>" << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user