Bug Hunting Session
Bug 118842 - Pasting text from webpage then cancelling, lines are not reset to default size
Summary: Pasting text from webpage then cancelling, lines are not reset to default size
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Undo-Redo
  Show dependency treegraph
 
Reported: 2018-07-19 09:01 UTC by Julien ROPE
Modified: 2018-10-30 13:20 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of text pasted then cancelled (7.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-07-19 09:01 UTC, Julien ROPE
Details
Force an AdjustRowHeight call after the undo (531 bytes, patch)
2018-07-26 08:04 UTC, Julien ROPE
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien ROPE 2018-07-19 09:01:36 UTC
Created attachment 143636 [details]
Example of text pasted then cancelled

The problem occurs when copying formatted text from a webpage.
 When pasting it, the lines height is modified.
 When you use Ctrl+Z (or click the corresponding menu), the text is removed, but the lines height is unmodified.

 Forcing the height to "auto" on the faulty lines resolves the problem.

 If you copy content from another libreoffice component, the problem doesn't happen.
 The copy must be done on formatted text - plain text won't trigger the bug.

 Attaching a file containing two tabs: one with the text I used (from this very bug file creation webpage), the other with the result of a "ctrl+z" executed after the paste.
Comment 1 Julien ROPE 2018-07-19 09:05:14 UTC
 
 Found with v5.4.7.2 on Windows
 Reproduced with v6.0.3.2 on Linux
Comment 2 V Stuart Foote 2018-07-19 12:29:17 UTC
Confirmed on Windows 10 Home 64-bit en-US with
a current master/6.2.0

Version: 6.2.0.0.alpha0+ (x64)
Build ID: daafe79c55cd53decbeac2367f298d79371dcf3d
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-07-18_02:59:18
Locale: en-US (en_US); Calc: CL

reopening the example document has reset the optimal height for the cleared cells, but the Paste -> Ctrl+Z (or the Undo) of insert of formatted text into several rows is leaving behind the direct formatting applied to cells on undo.
Comment 3 V Stuart Foote 2018-07-19 13:54:01 UTC
@Julien, assigning the bug to yourself implies you are taking the issue and will provide patch in source code to correct the issue. 

If that is the case, fine. Otherwise, suggest you remove yourself as assignee.
Comment 4 Julien ROPE 2018-07-19 14:59:31 UTC
 @Stuart, I am working on it, and hopefully will find the bug and fix it.
 Whether or not I succeed is another question of course :-/

 Should I wait to have a fix to assign the bug to myself ?
Comment 5 V Stuart Foote 2018-07-19 16:57:52 UTC
(In reply to Julien ROPE from comment #4)
>  @Stuart, I am working on it, and hopefully will find the bug and fix it.
>  Whether or not I succeed is another question of course :-/
> 
>  Should I wait to have a fix to assign the bug to myself ?

No, keep it assigned and have at it...

If you get stuck ask for help on the Dev ML, and should you throw in the towel, just remove yourself as assignee.
Comment 6 Julien ROPE 2018-07-26 08:04:54 UTC
Created attachment 143769 [details]
Force an AdjustRowHeight call after the undo


 I could work around the issue by forcing an "AdjustRowHeight()" call after the undo, making sure the modified range's rows are restored.
 Now I'm not sure that is the proper way of fixing it, as it doesn't address the root cause (which still eludes me).

 Any comment/suggestion is welcome.
Comment 7 Xisco Faulí 2018-10-30 13:20:52 UTC
Dear Julien ROPE,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.