Bug 52340 - EDITING: CRASH when Copy+Paste row with conditional formatting to other sheet and back to inserted row
Summary: EDITING: CRASH when Copy+Paste row with conditional formatting to other sheet...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other All
: medium critical
Assignee: Markus Mohrhard
URL:
Whiteboard: target:3.7.0 target:3.6.0
Keywords: regression
Depends on:
Blocks: Conditional-Formatting mab3.6
  Show dependency treegraph
 
Reported: 2012-07-21 13:42 UTC by Rainer Bielefeld Retired
Modified: 2017-07-17 09:35 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample Document (7.70 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-07-21 13:42 UTC, Rainer Bielefeld Retired
Details
Step4BeforeRemove (11.64 KB, image/png)
2012-08-28 12:22 UTC, pierre-yves samyn
Details
AfterStep5 (6.06 KB, image/png)
2012-08-28 12:23 UTC, pierre-yves samyn
Details
Screenshot CrashAfterPaste (4.48 KB, image/png)
2012-08-30 06:18 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Bielefeld Retired 2012-07-21 13:42:49 UTC
Created attachment 64489 [details]
Sample Document

Steps how to reproduce with Server Installation of  "LibreOffice 3.6.0.2 rc  German UI/Locale [Build-ID:  815c576] on German WIN7 Home Premium (64bit) 

1. open attached sample document
2. Select all row 2 by clicking row heading
3. <control+c> for Copy
4. go to sheet2 (Tabelle2)
   You see Cell cursor in A1
5. <control+v> for paste
   contents appears
6. <control+c> for Copy (all row)
7. Select all row 2 by clicking row heading
8. Menu 'Insert -> Row'
9. New row appears, single cell with contents shifted 1 row down
10. <control+v> for paste
    Bug: Crash

For me also reproducible:
7. Click Table1.A1
8. nothing

For me also reproducible:
4. Open new CALC docoument

For me also reproducible:
With attachment 62511 [details] of "Bug 50679 - EDITING: Copying cell(s) with conditional formatting CRASH when paste"

Already [Reproducible] with Server installation of Master "LOdev 3.6.0alpha0+ 
– WIN7 Home Premium (64bit) ENGLISH UI [Build ID: a502549]" (tinderbox:
Win-x86@6-fast, pull time 2012-05-31 07:33:55)

Still worked fine with 
- MinGW 2012-04-26

That might mean that this bug has similar roots as Bug 52333 

An other aspect of this bug I observed is that I get a crash when I copy complete rows to other documents with the same structure. I believe this is an action used by many users very often, what makes this bug critical
Comment 1 Rainer Bielefeld Retired 2012-07-21 17:53:51 UTC
I even see the crash when I remove conditional formatting between step 1 and 
step 2

@pierre-yves
Can you confirm this problem?
Comment 2 pierre-yves samyn 2012-07-22 06:23:04 UTC
(In reply to comment #1)
> @pierre-yves
> Can you confirm this problem?

Yes, I confirm every points

Comment 1 made me found bug 52351

Regards
Pierre-Yves
Comment 3 Rainer Bielefeld Retired 2012-07-22 06:44:57 UTC
@Markus:
Can you please check?
Comment 4 Markus Mohrhard 2012-07-22 19:05:15 UTC
Ok, I see the problem but need to think a bit about it.
Comment 5 Not Assigned 2012-07-22 19:27:24 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=669784c6653732fd2ad43024332957d5df5652bb

use correct source table for cond format paste, fdo#52340
Comment 6 Not Assigned 2012-07-23 10:18:50 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8ac1d7cc1d825e53d42aac699b077ffddb9c8769&g=libreoffice-3-6

use correct source table for cond format paste, fdo#52340


It will be available in LibreOffice 3.6.1.
Comment 7 Not Assigned 2012-07-23 15:57:38 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=aeebb0d20c6163ecbea47bb84fc83dd34b1438fa&g=libreoffice-3-6-0

use correct source table for cond format paste, fdo#52340


It will be available already in LibreOffice 3.6.0.
Comment 8 pierre-yves samyn 2012-08-25 12:34:41 UTC
Hello

Still occurs with procedure described in comment 1
1. open attached sample document
2. Format> Conditional formatting> Manage

Dialog opens with 2 lines, respectively B1:B1048576 and B2

3. Select (mouse and <shift> or <Ctrl>) the 2 lines
4. Click Remove then Ok
5. Select all row 2 by clicking row heading
6. <control+c> for Copy
7. go to sheet2 (Tabelle2)
   You see Cell cursor in A1
8. <control+v> for paste

Crash

Platform: Version 3.6.1.2 (Build ID: e29a214) & Windows 7 64 bits

Regards
Pierre-Yves
Comment 9 Markus Mohrhard 2012-08-28 11:58:35 UTC
I can't reproduce this problem with master.

Can you please add detailed instructions how you were able to reproduce it?
Comment 10 pierre-yves samyn 2012-08-28 12:22:36 UTC
Created attachment 66218 [details]
Step4BeforeRemove
Comment 11 pierre-yves samyn 2012-08-28 12:23:04 UTC
Created attachment 66219 [details]
AfterStep5
Comment 12 pierre-yves samyn 2012-08-28 12:27:48 UTC
Hello Markus

(In reply to comment #9)
> I can't reproduce this problem with master.

I reproduce the bug with Version 3.6.1.2 (Build ID: e29a214) and
- Windows 7 64bits 
- Windows XP Pro
- Windows XP

> Can you please add detailed instructions how you were able to reproduce it?

With words, I do not see ... I added screenshots hoping to bring the necessary details

Pierre-Yves
Comment 13 Markus Mohrhard 2012-08-29 17:46:42 UTC
I need a step by step explanation what to do. Rainers original explanation is not enough to produce a problem here so I suspect one of us is doing something different here.
Comment 14 pierre-yves samyn 2012-08-30 06:17:32 UTC
(In reply to comment #13)
> I need a step by step explanation what to do.

1. Start Libo
2. Menu File> Open sample10.ods
3. Menu Format> Conditional formatting> Manage

Dialog opens with 2 lines, respectively B1:B1048576 and B2

4. Select (mouse and <shift> or <Ctrl>) the 2 lines
cf. the screenshot Step4BeforeRemove

5. click Remove then click Ok (closes the dialog)
6. Select all row 2 by Clicking row heading
cf. AfterStep5 screenshot (the name of the screenshot now no longer reflects the number of the step.: here after step 6)

7. <control+c> for Copy
8. click on the sheet tab to display the sheet "Tabelle2"
    You see cursor in Cell A1
9. <control+v> for paste

Crash cf. the screenshot CrashAfterPaste

I do not see how more detail ...
Comment 15 pierre-yves samyn 2012-08-30 06:18:36 UTC
Created attachment 66314 [details]
Screenshot CrashAfterPaste
Comment 16 Noel Power 2012-08-31 09:05:26 UTC
ah Markus, sorry I didn't see you had assigned yourself ( just saw your name when I was about to update info on this )

I managed to reproduce it,
sc/source/core/data/table2.cxx

 664         sal_uInt32 nId = ((SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue();
 665         if ( nId != 0)
 666         {
 667             if (aOldIdToNewId.find(nId) == aOldIdToNewId.end())
 668             {
 669                 ScConditionalFormat* pFormat = pOldCondFormatList->GetFormat(nId);
 670                 ScConditionalFormat* pNewFormat = pFormat->Clone(pDocument);

On 3.6 it crashes at 670 above, nFormat is null, I suppose though there is more to this than just avoiding the null point.
Comment 17 Not Assigned 2012-08-31 13:55:14 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=10efe1bcedfa450e95cbc3f08642d239ba2ab579

handle missing cond format entries more gracefully, related fdo#52340
Comment 18 Markus Mohrhard 2012-08-31 14:01:38 UTC
@Noel: The null pointer check is the correct way for the time being. I'm currently working on removing all these nasty corner cases where cond format code and cell storage are out of sync.
ATM it is better to not touch my bugs because I can only push in the university so it sometimes takes me 2 or three days before I push my changes.

@pierre-yves: Please never use an existing bug report for a new bug report. Your and Rainer's initial problem where two different things so I could not reproduce your problem because I was only looking at Rainer's description.

In the future I will just close such reopened bug reports where the reporter reports a different bug than the initial bug report.
Comment 19 Not Assigned 2012-08-31 14:30:11 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4bcd9947774c05df6031e3b2228939150aa8c78b&g=libreoffice-3-6

handle missing cond format entries more gracefully, related fdo#52340


It will be available in LibreOffice 3.6.2.
Comment 20 pierre-yves samyn 2012-09-05 08:05:15 UTC
(In reply to comment #18)
> @pierre-yves: Please never use an existing bug report for a new bug report.
> Your and Rainer's initial problem where two different things so I could not
> reproduce your problem because I was only looking at Rainer's description.
> 

For the record, the "new" bug report was not mine but Rainer's (see comment 1)