Issue 70064

Summary: crash on format->alignment and moving outside cell
Product: Calc Reporter: caolanm
Component: codeAssignee: niklas.nebel
Status: CLOSED DUPLICATE QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 2.0.4   
Target Milestone: ---   
Hardware: PC (x86_64)   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
sample document
none
patch to workaround crash
none
additional part of the patch none

Description caolanm 2006-10-03 13:04:17 UTC
1. Take the attached .ods and load
2. triple click on cell B1, i.e. select the text of the full name in that cell
3. Format->Alignment->Center
4. Click in another cell

Crash with stacktrace like ...
0x17be2ecb: /usr/lib64/openoffice.org2.0/program/libsc680lx.so + 0x5e2ecb
(ScPatternAttr::GetNumberFormat(SvNumberFormatter*) const + 0x2b)
0x1780c50b: /usr/lib64/openoffice.org2.0/program/libsc680lx.so + 0x20c50b
0x178656c2: /usr/lib64/openoffice.org2.0/program/libsc680lx.so + 0x2656c2
0x178e5953: /usr/lib64/openoffice.org2.0/program/libsc680lx.so + 0x2e5953
0x178e6aec: /usr/lib64/openoffice.org2.0/program/libsc680lx.so + 0x2e6aec
0xe84d35c: /usr/lib64/openoffice.org2.0/program/libvcl680lx.so + 0x24d35c
(SelectionEngine::SelMouseButtonDown(MouseEvent const&) + 0x1cc)

The problem is that setting the alignment deletes the ScPatternAttr (in
ScColumn::ApplyPattern through pAttrArray->SetPattern) which the inputhdl has a
pLastPattern pointer to. so later the inputhdl uses the invalid pointer.

Attached is a patch which avoids the crash, though more from illustrative
purposes than a "patch" to fix
Comment 1 caolanm 2006-10-03 13:04:49 UTC
Created attachment 39523 [details]
sample document
Comment 2 caolanm 2006-10-03 13:05:52 UTC
Created attachment 39524 [details]
patch to workaround crash
Comment 3 caolanm 2006-10-03 13:16:01 UTC
Created attachment 39525 [details]
additional part of the patch
Comment 4 frank 2006-10-03 13:59:05 UTC
Hi Niklas,

please have a look at this one.

Frank
Comment 5 niklas.nebel 2006-10-04 18:20:32 UTC
This is the same crash as issue 67990. Long-term, pLastPattern should be removed
altogether, but for now the fix from 67990 will suffice.

*** This issue has been marked as a duplicate of 67990 ***
Comment 6 niklas.nebel 2006-10-04 18:21:02 UTC
closing