26#include <quazipfile.h>
51 qDebug() << odsFile.fileName();
52 QFileInfo ods_file_info(odsFile.fileName());
53 if(!ods_file_info.exists())
55 throw OdsException(QObject::tr(
"ODS file %1 does not exists")
56 .arg(ods_file_info.absoluteFilePath()));
58 if(!ods_file_info.isReadable())
60 throw OdsException(QObject::tr(
"ODS file %1 is not readable")
61 .arg(ods_file_info.absoluteFilePath()));
63 if(!odsFile.open(QIODevice::ReadOnly))
65 throw OdsException(QObject::tr(
"Unable to read ODS file %1")
66 .arg(ods_file_info.absoluteFilePath()));
68 qDebug() << ods_file_info.absoluteFilePath();
81 for(
bool more =
_p_quaZip->goToFirstFile(); more;
84 qDebug() <<
_p_quaZip->getCurrentFileName();
86 if(
_p_quaZip->getCurrentFileName() ==
"content.xml")
92 zip_file.open(QIODevice::ReadOnly);
93 content_reader.setDevice(&zip_file);
94 content_reader.setNamespaceProcessing(
true);
95 content_reader.
read();
96 if(content_reader.error())
100 qDebug() <<
" error " << content_reader.errorString();
101 throw OdsException(QObject::tr(
"error reading ODS input file :\n")
102 .append(content_reader.errorString()));
104 qDebug() <<
" contentXml : DONE on file '"
105 <<
_p_quaZip->getCurrentFileName() <<
"'";
const QDateTime & getDateTimeValue() const
const QString & toString() const
double getDoubleValue() const
const QString & getStringValue() const
const QString & getOfficeValueType() const
virtual void endSheet()=0
virtual void setCell(const OdsCell &)=0
virtual void endDocument()=0
virtual void startLine()=0
virtual void startSheet(const QString &sheet_name)=0
OdsDocHandlerInterface & _handler
void startSheet(const QString &sheet_name)
void setCell(const OdsCell &cell)
void parse(QFile &odsFile)
void setInsideCell(const OdsCell &cell)
OdsDocReader(OdsDocHandlerInterface &handler)