View Issue Details

IDProjectCategoryView StatusLast Update
0030607LazarusLCLpublic2016-12-18 20:19
ReporterK155LA3Assigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformOSWindowsOS Version7
Product Version1.7 (SVN)Product Buildrev. 52982 
Target Version1.8Fixed in Version1.7 (SVN) 
Summary0030607: TStringGrid empty cells does not replace cells with data when copy and paste one empty cell
DescriptionIf you copy one empty cell and paste it in cell with data, than empty cells does not replace cells with data.
Steps To Reproduce1 Place StringGrid to form.
2 Set in Options goEditing.
3 Run programm.
4 Fill some cell with any data.
5 Select one empty cell and press Ctrl+C.
6 Place cursor on cell with data and press Ctrl+V
7 Nothing happens.
TagsNo tags attached.
Fixed in Revision52995
LazTarget1.8
Widgetset
Attached Files

Relationships

related to 0030556 resolvedJesus Reyes TStringGrid empty cells does not replace cells with data when copy and paste one empty cell or one column with empty cell. 
related to 0030454 resolvedJesus Reyes TStringGrid copy selection bug, when cell in last column in selected range is empty. 

Activities

K155LA3

2016-09-16 22:20

reporter  

TSGBug3.gif (34,238 bytes)
TSGBug3.gif (34,238 bytes)

Jesus Reyes

2016-09-17 01:54

developer   ~0094689

This is a regression introduced in r52352

K155LA3

2016-09-17 22:10

reporter   ~0094697

I'm try to copy one empty cell from OpenOffice Calc and paste it in StringGrid. And it replace data in one cell. Clipboard is contained two bytes: 0000013#10 (Linebreak).
Copied cells from OpenOffice Calc in clipboard always contain at the end the linebreak.
If in procedure TCustomStringGrid.CopyCellRectToClipboard(const R: TRect), remove one condition:

- if (R.Top <> R.Bottom) or (R.Left <> R.Right) then

Then, when will copied some cells (or only one cell) to clipboard, "SelStr := SelStr + sLineBreak;" always will added line break at end, and all work fine.

Jesus Reyes

2016-09-17 23:36

developer   ~0094700

Yes, that is the regression. I already asked the author of the change about it, let see what he thinks about it.

Ondrej Pokorny

2016-09-19 14:58

developer   ~0094721

Last edited: 2016-09-19 14:59

View 2 revisions

I see r52352 was a mistake from myself. You are right that both Calc and Excel add a line break even for one cell. (I personally hate this feature but this is not important :) )

r52352 should be reverted. Jesus, what about the line break? What is correct: # 13#10 or sLineBreak? Can you test Calc under Linux (I can't now).

Jesus Reyes

2016-09-19 19:04

developer   ~0094722

Fixed.

@Ondrej: No problem with sLineBreak.

K155LA3

2016-09-19 21:58

reporter   ~0094725

I'm made some research with clipboad content from StringGrid and OO Calc. Found some problem with quote symbol: ".

1 Place StringGrid to form.
2 Set in Options goEditing.
3 Run programm.
4 Place symbol " in one cell

When copy this cell procedure TCustomStringGrid.CopyCellRectToClipboard get string as " but after function QuoteText it will converted to """".
When paste from clipboard to StringGrid it set cell data to ".
When paste from clipboard to OO Calc it set cell data to "".

When copy cell with " from OO Calc clipboard contained this data: "# 13#10
When paste from clipboard to StringGrid it clear cell data (make empty cell).
When paste from clipboard to OO Calc it set cell data to ".

If placed symbol "1" in cell, then:
StringGrid -> clipboard = """1"""
OO Calc -> clipboard = "1"# 13# 10

StringGrid -> OO Calc = ""1""
OO Calc -> StringGrid = 1

It is the known problem, or I can open new issue?

Jesus Reyes

2016-09-19 22:10

developer   ~0094726

Please submit a new report, if you can, please test also with excel if they doesn't behave the same I'm afraid we will have to choose one or the other.

K155LA3

2016-09-20 23:23

reporter   ~0094745

Open new issue 0030623: TStringGrid copy/paste to/from MS Excel and OO Calc bug: http://bugs.freepascal.org/view.php?id=30623

Issue History

Date Modified Username Field Change
2016-09-16 22:20 K155LA3 New Issue
2016-09-16 22:20 K155LA3 File Added: TSGBug3.gif
2016-09-16 23:59 Jesus Reyes Assigned To => Jesus Reyes
2016-09-16 23:59 Jesus Reyes Status new => assigned
2016-09-17 01:54 Jesus Reyes Note Added: 0094689
2016-09-17 22:10 K155LA3 Note Added: 0094697
2016-09-17 23:36 Jesus Reyes Note Added: 0094700
2016-09-19 14:58 Ondrej Pokorny Note Added: 0094721
2016-09-19 14:59 Ondrej Pokorny Note Edited: 0094721 View Revisions
2016-09-19 19:04 Jesus Reyes Fixed in Revision => 52995
2016-09-19 19:04 Jesus Reyes LazTarget => 1.8
2016-09-19 19:04 Jesus Reyes Note Added: 0094722
2016-09-19 19:04 Jesus Reyes Status assigned => resolved
2016-09-19 19:04 Jesus Reyes Fixed in Version => 1.7 (SVN)
2016-09-19 19:04 Jesus Reyes Resolution open => fixed
2016-09-19 19:04 Jesus Reyes Target Version => 1.8
2016-09-19 21:58 K155LA3 Note Added: 0094725
2016-09-19 22:10 Jesus Reyes Note Added: 0094726
2016-09-20 23:23 K155LA3 Note Added: 0094745
2016-12-18 20:17 Jesus Reyes Relationship added related to 0030556
2016-12-18 20:19 Jesus Reyes Relationship added related to 0030454