[dev] Copy XTable problem

2007-02-06 Thread Georgy Dimitrov

I have document with XTable.I have to clone this XTable.Today , I use
XDispatchHelper.executeDispatch().
1.Copy table to clipboard
2.Move cursor to new position
3.Paste table from clipboard

Problem area:
1. I start to clone table 50 times
2. I open an Excel file and copy to clipboard.It changed clipboard content
and my clone XTable procedure crached , because
XDispatchHelper.executeDispatch() paste wrong data from clipboard.

I search OO API  , I discovered XClipboardManager
http://api.openoffice.org/docs/common/ref/com/sun/star/datatransfer/clipboard/XClipboardManager.html
It`s support addClipboard and getClipboard by parameter "clipboardName".
It`s may be a solution , but I don`t know , How to change cplipboard in
XDispatchHelper.executeDispatch() .

My questions:
1.How to change clipboard in XDispatchHelper.executeDispatch(XDispatchProvider
provider , String command ,.) ? (command :=.uno:Copy | .uno:Paste )
2.Is thare other way to clone XTable?

Thanks


Re: [dev] XTextTable cell count limitation to 65536 cells

2007-01-08 Thread Georgy Dimitrov

Thanks for your suggestions. The problem is not in the loop over the list
(in java the int type is big enough and I am sure we have not run over that
limit). It is the call to XTableRows.insertByIndex(...) that never returns.

The problem can be reproduced manually in Writer without running our code -
create a table with a bigger number of columns, add rows so that the
rows*columns is a little less than 2^16, then add some more rows so that the
size will go over that value and OO will hang and keep the CPU busy without
ever completing the command.

Thanks for your replies, any further information will be highly appreciated.
Georgy


[dev] XTextTable cell count limitation to 65536 cells

2007-01-05 Thread Georgy Dimitrov

Hallo,
I have a problem adding rows to XTextTable. I use the following code to add
rows in chunks - the call to insertByIndex(...) never returns and the
soffice.bin process takes about 50% of CPU. Code is like this:
 *Code:*
   com.sun.star.table.XTableRows rows = xTable.getRows();
   for (int i = 0; i < list.length; i++){
 if(row > currentRowCount){
   int diff = expectedRowCount - currentRowCount;
   if(diff > 100){
 diff = 100;
   }
   rows.insertByIndex(currentRowCount, diff);
   currentRowCount += diff;
 }
  //fill data in the cells in the row


It may be a coincidence, but it is working fine until rowcount*columncount <
65536 and not when this count is exceeded. In my case of 17 columns this
means 3855 rows.

Please let me know whether this limitation is real and known or there is
something that I may be doing wrong.

Thank you for your time

Georgyd