ConvertData dataOut = null;
// Create and use the converter
// No longer uses the XMerge interface
// Somewhat messy, should be changed if XMerge is discarded
OfficeDocument oooDoc;
if (bCalc) {
oooDoc = new SxcDocument(sFileName);
}
else if (bImpress) {
oooDoc = new SxiDocument(sFileName);
}
else {
oooDoc = new SxwDocument(sFileName);
}
File f = new File(sFileName);
// Make sure the input file actually exists before using it
try {
if (!f.exists()) {
System.out.println("I'm sorry, I can't find "+sFileName);
System.exit(0);
}
FileInputStream fis = new FileInputStream(f);
oooDoc.read(fis,!bFlat);
}
catch (IOException e) {
System.out.println("Oops, there was an error reading "+sFileName);
e.printStackTrace();
}