Révision 3376
TXM/trunk/org.txm.libs.office/src/org/txm/libs/office/WriteODS.java (revision 3376) | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 | 4 |
import java.util.ArrayList; |
5 |
import java.util.logging.Level; |
|
6 |
import java.util.logging.Logger; |
|
5 | 7 |
|
8 |
import org.odftoolkit.odfdom.pkg.OdfXMLFactory; |
|
6 | 9 |
import org.odftoolkit.simple.SpreadsheetDocument; |
7 | 10 |
import org.odftoolkit.simple.table.Cell; |
8 | 11 |
import org.odftoolkit.simple.table.Row; |
... | ... | |
10 | 13 |
|
11 | 14 |
public class WriteODS { |
12 | 15 |
|
16 |
static { // set Log level to WARNING |
|
17 |
try { |
|
18 |
SpreadsheetDocument.newSpreadsheetDocument().close(); |
|
19 |
Logger.getLogger(OdfXMLFactory.class.getName()).setLevel(Level.WARNING); |
|
20 |
} |
|
21 |
catch (Exception e) { |
|
22 |
// TODO Auto-generated catch block |
|
23 |
e.printStackTrace(); |
|
24 |
} |
|
25 |
} |
|
26 |
|
|
13 | 27 |
SpreadsheetDocument spreadsheet; |
14 | 28 |
|
15 | 29 |
Table table; |
TXM/trunk/org.txm.libs.office/src/org/txm/libs/office/ReadODS.java (revision 3376) | ||
---|---|---|
4 | 4 |
import java.util.ArrayList; |
5 | 5 |
import java.util.HashMap; |
6 | 6 |
import java.util.List; |
7 |
import java.util.logging.Level; |
|
8 |
import java.util.logging.Logger; |
|
7 | 9 |
|
8 | 10 |
import org.odftoolkit.odfdom.dom.element.table.TableTableRowElement; |
11 |
import org.odftoolkit.odfdom.pkg.OdfXMLFactory; |
|
9 | 12 |
import org.odftoolkit.simple.SpreadsheetDocument; |
10 | 13 |
import org.odftoolkit.simple.table.Cell; |
11 | 14 |
import org.odftoolkit.simple.table.Row; |
... | ... | |
14 | 17 |
|
15 | 18 |
public class ReadODS { |
16 | 19 |
|
20 |
static { // set Log level to WARNING |
|
21 |
try { |
|
22 |
SpreadsheetDocument.newSpreadsheetDocument().close(); |
|
23 |
Logger.getLogger(OdfXMLFactory.class.getName()).setLevel(Level.WARNING); |
|
24 |
} |
|
25 |
catch (Exception e) { |
|
26 |
// TODO Auto-generated catch block |
|
27 |
e.printStackTrace(); |
|
28 |
} |
|
29 |
} |
|
30 |
|
|
17 | 31 |
SpreadsheetDocument spreadsheet = null; |
18 | 32 |
|
19 | 33 |
Table table = null; |
... | ... | |
27 | 41 |
int nRows, nCols; |
28 | 42 |
|
29 | 43 |
public ReadODS(File tableFile, String sheetname) throws Exception { |
44 |
|
|
30 | 45 |
spreadsheet = SpreadsheetDocument.loadDocument(tableFile); |
31 | 46 |
|
32 | 47 |
// the first access to the document causes a very long process |
Formats disponibles : Unified diff