Issue 29417 - CRASH if TabStopDistance set to 0
Summary: CRASH if TabStopDistance set to 0
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: OOo 1.1.1
Hardware: All Windows, all
: P4 Minor (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2004-05-23 13:45 UTC by christianjunker
Modified: 2017-05-20 10:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

Test Document (10.91 KB, application/vnd.oasis.opendocument.text)
2014-05-27 05:13 UTC, Rainer Bielefeld
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description christianjunker 2004-05-23 13:45:07 UTC
Setting the TabDistance in Tools>Options>Text Document>General can not be set 
under 20 inches. Though when using the following macro the tabstopdistance can 
be set to 0:
Sub tabdistance( )
 oServiceMgr = GetProcessServiceManager()
 odoc = thisComponent
 oset = odoc.createInstance("")
 oset.TabStopDistance = 0 'set TabStopDistance to 0
End Sub

If TabStopDistance is 0 then the Tab Key has no function anymore, thus 
OpenOffice crashes.
Comment 1 michael.ruess 2004-05-24 10:44:30 UTC
MRU->SW: please have a look.  Via UI, it is not possible to set the default tab
stop distance to 0,00. So it also shouldn't be possible via API.
Comment 2 stephan.wunderlich 2004-05-24 11:02:53 UTC
SW->TL: just run the given macro attached to a document and then use the tab-key
in this document => the crashreporter appears
Comment 3 thomas.lange 2004-05-24 11:06:36 UTC
The minimal distance shouzld be set to let's say 100 (i.e. 1mm) which should
already be smaller than any really useful distance.
Comment 4 christianjunker 2005-09-28 15:02:24 UTC
cyb->tl: A note in the idl docs might be sufficient to solve this issue, since
the OOo API shouldn't prohibit too much. What do you think here? What is the
state so  far?

Comment 5 thomas.lange 2005-09-28 15:11:38 UTC
Adding some docu in the IDL alone won't fix this since the Office should still
not crash even if it was tried to set the distance to 0.

But adding a note that those values should be positve and not too small would be
nice. I wouldn't specify a minimal value in the IDL though since in the end the
actual value migth be different.
Comment 6 christianjunker 2005-10-27 20:36:39 UTC
How about ignoring 0 in the implementation?? (does not change TabStopDistance)
Comment 7 thomas.lange 2005-11-01 09:00:25 UTC
tl->cyb: since tiny values as 1 or even 100 or 1000 are still quite not useful
(since the unit for the API is 1/100th mm) I think we should enforce a minimum
value. And if that is to be done it won't be much more to raise an exception for
0 as well.
Comment 8 christianjunker 2005-11-01 11:49:28 UTC
cyb->tl: "Enforcing" means ignoring all values under a certain minimum in the implementation?
Comment 9 thomas.lange 2005-11-01 11:53:35 UTC
Nope. It means throwing an "illegal argument exception" when trying to set zhose
values. That is provided the interface has specified that exception which I will
assume would be natural.
Comment 10 christianjunker 2005-11-01 12:02:52 UTC
I just tested 0 TabStopDistance under Mac OS X with OOo 2.0 and it did not crash at all. 
cyb->tl: Can you test this on your platform (Win32/Linux?).
I wonder if we should still fix it, if it's working under WinXP and *ix.
Comment 11 thomas.lange 2005-11-01 13:17:53 UTC
No. If it works for some other platform it is likely to be by chance only.
And also not having a reasonable minimal value may affect performance and
For example: if you have a tab-stop every 1/100th mm the number of tabsops is
quite large and thus accessing a specific tabstop will become slower.
Also from implementation side the tab-stops are likely to be stored in some
array,  with a fixed upper bound for the index (let's say USHORT_MAX for example
which is about 65536) if by allowing such tiny values for tab-stops the maximal
number for tab-stops will be above that (sth that actually may happen depending
on the specified page width) the array might be too small and if per chance
there is no proper bounds checking implemented the office may crash. And even if
proper bounds checking is implemented any tab-stop above that limit will be of
no use because the values can not be stored.

So forcing some decent 'real-life' value should be the way to go even if from
pure API view there would be no such need.
Comment 12 Rainer Bielefeld 2014-05-27 05:13:40 UTC
Created attachment 83468 [details]
Test Document

With macro from original report I created attached sample document. For a test simply open test document from OO Start Center

Additional info:
(a) Crash no longer reproducible with sever installation of "OOo 3.3.0 English UI
   / German locale [OOO330m20 (Build 9567)]" on WIN7 Home Premium (64bit) DE
(b) Crash still Reproducible with sever installation of "OOo 3.2.1 English UI
    / German locale [OOO320m18 (Build 9502)]" on WIN7 Home Premium (64bit) DE 
    "Ooo 1.1.5 [645m58 (Build 8950)]" on German WIN7 Home Premium (64bit) will 
     crash immediately when I try to open document
Comment 13 Rainer Bielefeld 2014-05-27 05:17:04 UTC
(c) Has been fixed for OOo 3.3.0, but because of incomplete Target Milestone
   selector contents (Bug 123063) I only can select TM = 4.1.0, no correct
   information can be contributed.