[Solved] Copy rows with Java

Java, C++, C#, Delphi, ??? - Using the UNO bridges

[Solved] Copy rows with Java

Postby lisa_florian » Tue Apr 10, 2012 9:43 am

Hi,

my task is to fill an existing Calc file with content from a database. The problem is, that i need to copy the style of the cells to the next line. If the first cell has red text, the next row should have red text too. Because I don't know what exactly is changed, I need to copy all properties. I made this work, but it takes far too long. This copying needs about 150 ms per cell. As there are about 50 cells in a row, thats about 8 seconds per row. If I've got 100 rows thats about 1.5 minutes. Is there a way to make that faster? In Excel we always copy a complete row, not each cell and each property. Is there a similar solution for OOo? Or is there a way to set the whole XPropertySet of the new cell to the XPropertySet of the old cell?

Here is a part of my code:

Code: Select all   Expand viewCollapse view
for (Property p : oldproperties){
       try {
              newPropSet.setPropertyValue(p.Name, oldPropSet.getPropertyValue(p.Name));
         } catch [...]               
}



Edit: Just found a solution. If you have the same problem, look here: http://wiki.services.openoffice.org/wik ... preadsheet
I use OOo 3.2.1 on Windows.
lisa_florian
 
Posts: 4
Joined: Tue Apr 10, 2012 8:57 am

Return to External Programs

Who is online

Users browsing this forum: No registered users and 1 guest