Issue 35453 - insertByIndex removeByIndex crashes on inserting 0 rows
Summary: insertByIndex removeByIndex crashes on inserting 0 rows
Status: CLOSED DUPLICATE of issue 23386
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P4 Trivial
Target Milestone: ---
Assignee: thomas.lange
QA Contact: issues@api
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2004-10-13 14:48 UTC by empy
Modified: 2013-02-24 21:10 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description empy 2004-10-13 14:48:38 UTC
If I try to insert 0 Rows into a com.sun.star.text.XTextTable
within a writer document using the api by doing : 

com.sun.star.text.XTableRows xRows = xTextTable.getRows();
xRows.insertByIndex(xRows.getCount()-1, 0);
xRows.removeByIndex(xRows.getCount()-1, 0);

a com.sun.star.uno.RuntimeException is thrown:
-------------------------------------------------
com.sun.star.uno.RuntimeException:
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at
com.sun.star.lib.uno.protocols.urp.Unmarshal.readThrowable(Unmarshal.java:315)
        at com.sun.star.lib.uno.protocols.urp.Unmarshal.readAny(Unmarshal.java:157)
        at
com.sun.star.lib.uno.protocols.urp.Unmarshal.readObject(Unmarshal.java:404)
        at com.sun.star.lib.uno.protocols.urp.urp.readReply(urp.java:192)
        at com.sun.star.lib.uno.protocols.urp.urp.readMessage(urp.java:308)
        at com.sun.star.lib.uno.protocols.urp.urp.readMessage(urp.java:607)
        at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.invoke(java_remote_bridge.java:184)
        at
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.run(java_remote_bridge.java:175)
------------------------------------------------------
Comment 1 christianjunker 2004-10-14 14:09:53 UTC
my vote for it ;-).
Comment 2 stephan.wunderlich 2004-10-14 14:31:51 UTC
a com::sun::star::lang::IllegalArgumentException seems to be more reasonable here.

The Simple Basic Macro:
	xTextTable=thisComponent.getTextTables().getByIndex(0)
	xRows = xTextTable.getRows()
	xRows.insertByIndex(xRows.getCount()-1, 0)
	xRows.removeByIndex(xRows.getCount()-1, 0)
can be run with a document that contains at least one table to reproduce the
behaviour.
Comment 3 christianjunker 2005-08-07 23:11:24 UTC
as dicussed on the mailinglist, why not throw no exception at all when trying to
insert/remove 0 rows?
Comment 4 empy 2005-08-08 07:45:17 UTC
As cyb mentions throwing no Exception 
on inserting/removing 0 rows will be 
a more convenient way i think.

My Application is calculating a amount 
of additional needed rows in a XTextTable
and by now i have to bypass the insertion
if no more rows are needed. 

IMHO this always will be a workaround.
Allowedly inserting 0 rows seems to be stupid,
but the fishy programmers of the world will 
be thankful ...
Comment 5 thomas.lange 2005-08-08 10:16:37 UTC
Duplicate to issue #23386# which is already fixed that way in CWS tl14.

*** This issue has been marked as a duplicate of 23386 ***
Comment 6 ace_dent 2008-05-17 22:03:28 UTC
The Issue you raised has been marked as 'Resolved' and not updated within the
last 1 year+. I am therefore setting this issue to 'Verified' as the first step
towards Closing it. If you feel this is incorrect, please re-open the issue and
add any comments.

Many thanks,
Andrew
 
Cleaning-up and Closing old Issues
~ The Grand Bug Squash, pre v3 ~
http://marketing.openoffice.org/3.0/announcementbeta.html
Comment 7 ace_dent 2008-05-18 00:07:15 UTC
As per previous posting: Verified -> Closed.
A Closed Issue is a Happy Issue (TM).

Regards,
Andrew