Bug 37030 - Crash when Copy/Paste as GDI metafile selected cell range from CALC to WRITER
Summary: Crash when Copy/Paste as GDI metafile selected cell range from CALC to WRITER
Status: RESOLVED DUPLICATE of bug 36688
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.4.0 Beta4
Hardware: x86-64 (AMD64) Windows (All)
: medium critical
Assignee: Kohei Yoshida
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: mab3.4
  Show dependency treegraph
 
Reported: 2011-05-09 10:49 UTC by Rainer Bielefeld Retired
Modified: 2011-10-29 08:43 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document (29.31 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-05-11 03:46 UTC, Rainer Bielefeld Retired
Details
Sample Document, see Comment 2 (11.49 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-05-11 04:48 UTC, Rainer Bielefeld Retired
Details
Sample with rotated text that does not crash (11.73 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-07-14 10:45 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Bielefeld Retired 2011-05-09 10:49:45 UTC
My "LibreOffice 3.4Beta4  – WIN7  Home Premium  (64bit) German UI [DEV300m103 (Build:4)]" frequently crashes when I copy a selection from a spreadsheet and paste it as GDI metafile to WRITER document.

Unfortunately until now I did not find a was to make it reproducible 100% and also I have not found a way to create sample documents.
Comment 1 Rainer Bielefeld Retired 2011-05-11 03:46:08 UTC
Created attachment 46597 [details]
Sample document
Comment 2 Rainer Bielefeld Retired 2011-05-11 04:47:54 UTC
With the sample document the bug is 100% reproducible for me:

1. Open Sample by double click from WIN Explorer
2. Select with pushed left mouse button A1:J14
3. <ctrl+c> for copy
4. Menu 'File > New > Text document
   new document appears
5. Click into new document
6. Click down-arrow of Paste-Icon, so that selection appears
7. Click "As GDI Metafile"
   Expected: Table dontents pasted
   actual: LibO crashes and disappears

It seems that the problem is related to the heading of the selected Spreadsheet range, and there with the rotated text.

In my "newsample.ods" you will find 3 rows. Crash will be reproducible with A1:K1 and A5:K5, but not with A6:K3

Crash is not limited to WRITER, I also see it when I 'paste special' to DRAW
Comment 3 Rainer Bielefeld Retired 2011-05-11 04:48:49 UTC
Created attachment 46601 [details]
Sample Document, see Comment 2
Comment 4 Rainer Bielefeld Retired 2011-05-11 04:49:38 UTC
Due to results with DRAW: Component LibO
Comment 5 Noel Power 2011-05-12 03:25:42 UTC
tor, could you see if you can provide a stack trace
Comment 6 Rainer Bielefeld Retired 2011-05-12 03:54:20 UTC
2 additional strange details:
The crash also is reproducible for me when I paste as bitmap
No crash when I copy from OOo-dev3.4 spreadsheet to LibO WRITER document as GDI or bitmap
Comment 7 Don't use this account, use tml@iki.fi 2011-05-12 07:34:29 UTC
Stack trace:

>	scmi.dll!ScOutputData::DrawRotatedFrame(const Color * pForceColor=0x00000000)  Line 1531 + 0xc5 bytes	C++
 	scmi.dll!ScOutputData::DrawFrame()  Line 1159	C++
 	scmi.dll!ScPrintFunc::DrawToDev(ScDocument * pDoc=0x12b09050, OutputDevice * pDev=0x00e9eb84, double __formal=1.0000000000000000, const Rectangle & rBound={...}, ScViewData * pViewData=0x00e9bfc0, unsigned char bMetaFile='')  Line 635	C++
 	scmi.dll!ScDocShell::Draw(OutputDevice * pDev=0x00e9eb84, const JobSetup & __formal={...}, unsigned short nAspect=1)  Line 1921 + 0x2b bytes	C++
 	sfxmi.dll!0166b0d4() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for sfxmi.dll]	
 	sfxmi.dll!0166b2b0() 	
 	scmi.dll!ScTransferObj::GetData(const com::sun::star::datatransfer::DataFlavor & rFlavor={...})  Line 374 + 0x5e bytes	C++

It is irritating to debug this, because after compiling sc with debug=t, when loading the newsample.ods, I get lots and lots of Assertion Failed! dialogs that I have to click "No" to (to ignore the assertion failure)...
Comment 8 Don't use this account, use tml@iki.fi 2011-05-12 07:48:32 UTC
The problem seems to be when ScOutputData::DrawRotatedFrame(const Color * pForceColor=0x00000000) calls  ScOutputData::CreateProcessor2D()  which then calls pDoc->GetDrawLayer(), which returns NULL. ScOutputData::CreateProcessor2D()  then returns NULL, too, which is assigned to pProcessor in ScOutputData::DrawRotatedFrame(). Later at line 1523 pProcessor is dereferenced anyway.
Comment 9 Don't use this account, use tml@iki.fi 2011-05-12 08:35:49 UTC
And here is the stack trace from when the ScOutputData is constructed where the pDoc->pDrawLayer is NULL. This happens when choosing the "GDI metafile" from the Paste drop-down menu.

>	scmi.dll!ScOutputData::ScOutputData(OutputDevice * pNewDev=0x00e9eb84, ScOutputType eNewType=OUTTYPE_PRINTER, ScTableInfo & rTabInfo={...}, ScDocument * pNewDoc=0x12b0f780, short nNewTab=0, long nNewScrX=1, long nNewScrY=1, short nNewX1=0, long nNewY1=0, short nNewX2=9, long nNewY2=13, double nPixelPerTwipsX=1.7546231546231545, double nPixelPerTwipsY=1.7528178243774575, const Fraction * pZoomX=0x00000000, const Fraction * pZoomY=0x00000000)  Line 213	C++
 	scmi.dll!ScPrintFunc::DrawToDev(ScDocument * pDoc=0x12b0f780, OutputDevice * pDev=0x00e9eb84, double __formal=1.0000000000000000, const Rectangle & rBound={...}, ScViewData * pViewData=0x00e9bfc0, unsigned char bMetaFile='')  Line 581 + 0x63 bytes	C++
 	scmi.dll!ScDocShell::Draw(OutputDevice * pDev=0x00e9eb84, const JobSetup & __formal={...}, unsigned short nAspect=1)  Line 1921 + 0x2b bytes	C++
 	sfxmi.dll!0166b0d4() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for sfxmi.dll]	
 	sfxmi.dll!0166b2b0() 	
 	scmi.dll!ScTransferObj::GetData(const com::sun::star::datatransfer::DataFlavor & rFlavor={...})  Line 374 + 0x5e bytes	C++
Comment 10 Rainer Bielefeld Retired 2011-07-14 10:45:37 UTC
Created attachment 49095 [details]
Sample with rotated text that does not crash

I can't tell whether that's useful additional information:
Copy / Paste as GDI does not crash for 'Sheet2.A5:K5' from "latestsample.ods"
With 3.4.1 WIN7
Comment 11 Rainer Bielefeld Retired 2011-07-22 10:29:07 UTC
Worked before 3.4 (Today checked again with 3.3.3 portable
Comment 12 Caolán McNamara 2011-08-10 16:06:13 UTC
This doesn't crash for me on master and 3-4. Reading Tor's comments and checking ScOutputData::CreateProcessor2D this was fixed by ensuring a drawlayer exists with http://cgit.freedesktop.org/libreoffice/calc/commit/?h=libreoffice-3-4&id=923514a2dc7a0de237eba70f131f361efd33865a

*** This bug has been marked as a duplicate of bug 36688 ***