src.Copy(src) overwrites src with empty values

in aspose.cell pre 4.4 this code worked without the check that i <> src.Column

For i = fromCol To lastCol
If i <> src.Column Then 'don’t copy onto self, ends up writing nothing over self
ws.Cells(row, i).Copy(src)
End If
Next

after upgrading to 4.5 my application bugged out because src was erased when it was copied over itself.


I admit that copying over itself is stupid,(maybe it should throw) but it probably shouldn’t result in erasing the source cell.

Adding the check above make things work fine for me, but I thought you might want to know about this since it could be considered a bug.

Hi,

We will figure out the issue. If you want to copy a cell value to itself, I think you may try as:

...............

ws.Cells(row, i).PutValue(src.Value)

..............

Thank you.

Hi,

Please try this fix.

We will do nothing if cell copy itself.