Browse Source

Enable the AutoCompress option for zipwriter

So we can generate a smaller .xlsx file
master
Debao Zhang 11 years ago
parent
commit
c80a601b25
  1. 4
      src/xlsx/xlsxzipwriter.cpp

4
src/xlsx/xlsxzipwriter.cpp

@ -31,13 +31,13 @@ namespace QXlsx {
ZipWriter::ZipWriter(const QString &filePath) ZipWriter::ZipWriter(const QString &filePath)
{ {
m_writer = new QZipWriter(filePath, QIODevice::WriteOnly); m_writer = new QZipWriter(filePath, QIODevice::WriteOnly);
m_writer->setCompressionPolicy(QZipWriter::NeverCompress); m_writer->setCompressionPolicy(QZipWriter::AutoCompress);
} }
ZipWriter::ZipWriter(QIODevice *device) ZipWriter::ZipWriter(QIODevice *device)
{ {
m_writer = new QZipWriter(device); m_writer = new QZipWriter(device);
m_writer->setCompressionPolicy(QZipWriter::NeverCompress); m_writer->setCompressionPolicy(QZipWriter::AutoCompress);
} }
ZipWriter::~ZipWriter() ZipWriter::~ZipWriter()

Loading…
Cancel
Save