From 8e20f8b12e87aa9b9462ff532b331bd1d9daf467 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Tue, 26 Nov 2013 10:53:53 +0800 Subject: [PATCH] Format: Make some private memeber public --- src/xlsx/xlsxformat.cpp | 29 ++++++++++++++++++++++++++--- src/xlsx/xlsxformat.h | 33 +++++++++++++-------------------- 2 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/xlsx/xlsxformat.cpp b/src/xlsx/xlsxformat.cpp index c88ec81..d9ba17c 100755 --- a/src/xlsx/xlsxformat.cpp +++ b/src/xlsx/xlsxformat.cpp @@ -493,7 +493,8 @@ void Format::setFontIndex(int index) d->font_index_valid = true; } -/* Internal +/*! + * \internal */ QByteArray Format::fontKey() const { @@ -895,7 +896,7 @@ void Format::setBorderIndex(int index) d->border_index = index; } -/* Internal +/*! \internal */ QByteArray Format::borderKey() const { @@ -1004,7 +1005,8 @@ void Format::setFillIndex(int index) d->fill_index = index; } -/* Internal +/*! + * \internal */ QByteArray Format::fillKey() const { @@ -1106,6 +1108,9 @@ bool Format::isEmpty() const return d->property.isEmpty(); } +/*! + * \internal + */ QByteArray Format::formatKey() const { if (isEmpty()) @@ -1134,11 +1139,19 @@ void Format::setXfIndex(int index) d->xf_indexValid = true; } +/*! + * \internal + */ int Format::xfIndex() const { + if (!d) + return -1; return d->xf_index; } +/*! + * \internal + */ bool Format::xfIndexValid() const { if (!d) @@ -1152,11 +1165,21 @@ void Format::setDxfIndex(int index) d->dxf_indexValid = true; } +/*! + * \internal + * Returns the index in the styles dxfs. + */ int Format::dxfIndex() const { + if (!d) + return -1; return d->dxf_index; } +/*! + * \internal + * Returns whether the dxf index is valid or not. + */ bool Format::dxfIndexValid() const { if (!d) diff --git a/src/xlsx/xlsxformat.h b/src/xlsx/xlsxformat.h index 2aed024..cafa87b 100755 --- a/src/xlsx/xlsxformat.h +++ b/src/xlsx/xlsxformat.h @@ -230,22 +230,6 @@ public: QString stringProperty(int propertyId) const; QColor colorProperty(int propertyId) const; -private: - friend class Styles; - friend class Worksheet; - friend class WorksheetPrivate; - friend class RichStringPrivate; - friend class SharedStrings; - friend class ::FormatTest; - friend Q_XLSX_EXPORT QDebug operator<<(QDebug, const Format &f); - - void fixNumberFormat(int id, const QString &format); - - bool fontIndexValid() const; - int fontIndex() const; - void setFontIndex(int index); - QByteArray fontKey() const; - bool hasNumFmtData() const; bool hasFontData() const; bool hasFillData() const; @@ -253,22 +237,31 @@ private: bool hasAlignmentData() const; bool hasProtectionData() const; + bool fontIndexValid() const; + int fontIndex() const; + QByteArray fontKey() const; bool borderIndexValid() const; QByteArray borderKey() const; int borderIndex() const; - void setBorderIndex(int index); - bool fillIndexValid() const; QByteArray fillKey() const; int fillIndex() const; - void setFillIndex(int index); QByteArray formatKey() const; bool xfIndexValid() const; int xfIndex() const; - void setXfIndex(int index); bool dxfIndexValid() const; int dxfIndex() const; +private: + friend class Styles; + friend class ::FormatTest; + friend Q_XLSX_EXPORT QDebug operator<<(QDebug, const Format &f); + + void fixNumberFormat(int id, const QString &format); + void setFontIndex(int index); + void setBorderIndex(int index); + void setFillIndex(int index); + void setXfIndex(int index); void setDxfIndex(int index); int theme() const;