Issue 23680 - duplicate tables
Summary: duplicate tables
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: putopuntocom
QA Contact: issues@api
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2003-12-18 14:00 UTC by putopuntocom
Modified: 2013-02-24 21:07 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description putopuntocom 2003-12-18 14:00:54 UTC
Hi,
I'm trying to duplicate a textTable in a textDocument or insert into an empty 
one.
I'm doing the following:

String loadUrl = "private:factory/swriter";
Object desktop = xRemoteServiceManager.createInstanceWithContext(
            "com.sun.star.frame.Desktop", xRemoteContext);
XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(
            XComponentLoader.class, desktop);
PropertyValue[] loadProps = new PropertyValue[0];
XComponent blanco = xComponentLoader.loadComponentFromURL(loadUrl, "_blank", 0, 
loadProps);
XTextDocument td = (XTextDocument)UnoRuntime.queryInterface
(XTextDocument.class, blanco);
XText text = td.getText();
XTextRange xtr = (XTextRange)UnoRuntime.queryInterface
(XTextRange.class,text.getStart());
XTextContent tc = (XTextContent)UnoRuntime.queryInterface(XTextContent.class, 
xIndexedTables.getByIndex(1));
text.insertTextContent(xtr, tc, false);

The conexion is allright and I'm sure that the load and store documents work.
I've tried in differents ways and always get the same Exception:

om.sun.star.uno.RuntimeException: SwXTextTable: already attached to range.

	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.in
voke(java_remote_bridge.java:182)

	at 
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.ru
n(java_remote_bridge.java:173)

Why I get this if my document is empty??
Comment 1 ooo 2004-01-06 14:26:16 UTC
forwarding to responsible developer
Comment 2 thomas.lange 2004-03-18 11:56:35 UTC
Since the table is already inserted in the document you cannot call
insertTextContent for that table thus the "SwXTextTable: already attached to
range." exception.

You can only attach / insert tables that are currenlty only a descriptor i.e.
the table was created via API but not yet inserted in the document. That is you
can not insert the same table twice.

The only way to copy a table is to select the table with the view cursor (e.g.
by selecting all cells) and use cut-copy and paste as macro call (UNO dispatches).
You can see how this works by using the mcro recorder and having a look at the
generated macro.

Comment 3 thomas.lange 2004-03-18 11:57:10 UTC
Set to invalid.
Comment 4 ace_dent 2008-05-18 12:07:50 UTC
The Patch you submitted has been marked as 'Resolved' and not updated within the
last 2 years+. 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 as part of:
~ The Grand Bug Squash, pre v3 ~
http://marketing.openoffice.org/3.0/announcementbeta.html
Comment 5 ace_dent 2008-05-18 12:10:39 UTC
The Patch you submitted has been marked as 'Resolved' and not updated within the
last 2 years+. 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 as part of:
~ The Grand Bug Squash, pre v3 ~
http://marketing.openoffice.org/3.0/announcementbeta.html
Comment 6 ace_dent 2008-05-18 12:50:36 UTC
As per previous comment: Verified > Closed.

Regards,
Andrew