Add read support for indexedColors

Some old .xlsx files use indexed colors
This commit is contained in:
Debao Zhang
2013-11-02 14:26:59 +08:00
parent 6279b7e49b
commit 2e2a4ff9bc
2 changed files with 98 additions and 15 deletions
+7
View File
@@ -32,6 +32,7 @@
#include <QList>
#include <QMap>
#include <QStringList>
#include <QVector>
class QIODevice;
class StylesTest;
@@ -81,6 +82,10 @@ private:
bool readBorder(XmlStreamReader &reader);
bool readSubBorder(XmlStreamReader &reader, const QString &name, Format::BorderStyle &style, QColor &color);
bool readCellXfs(XmlStreamReader &reader);
bool readColors(XmlStreamReader &reader);
bool readIndexedColors(XmlStreamReader &reader);
QColor getColorByIndex(int idx);
QHash<QString, int> m_builtinNumFmtsHash;
QMap<int, QSharedPointer<NumberData> > m_customNumFmtIdMap;
@@ -93,6 +98,8 @@ private:
QHash<QByteArray, QSharedPointer<FillData> > m_fillsHash;
QHash<QByteArray, QSharedPointer<BorderData> > m_bordersHash;
QVector<QColor> m_indexedColors;
QList<QSharedPointer<Format> > m_createdFormatsList; //All created formats
QList<Format *> m_xf_formatsList;