Browse Source

Refactoring: Rename OOXmlFile to AbstractOOXmlFile

master
Debao Zhang 11 years ago
parent
commit
840d96a889
  1. 6
      src/xlsx/qtxlsx.pri
  2. 32
      src/xlsx/xlsxabstractooxmlfile.cpp
  3. 20
      src/xlsx/xlsxabstractooxmlfile.h
  4. 12
      src/xlsx/xlsxabstractooxmlfile_p.h
  5. 4
      src/xlsx/xlsxabstractsheet.cpp
  6. 4
      src/xlsx/xlsxabstractsheet.h
  7. 4
      src/xlsx/xlsxabstractsheet_p.h
  8. 4
      src/xlsx/xlsxchart.cpp
  9. 4
      src/xlsx/xlsxchart.h
  10. 4
      src/xlsx/xlsxchart_p.h
  11. 4
      src/xlsx/xlsxcontenttypes_p.h
  12. 4
      src/xlsx/xlsxdocpropsapp_p.h
  13. 4
      src/xlsx/xlsxdocpropscore_p.h
  14. 4
      src/xlsx/xlsxdrawing_p.h
  15. 4
      src/xlsx/xlsxexternallink_p.h
  16. 4
      src/xlsx/xlsxsharedstrings_p.h
  17. 4
      src/xlsx/xlsxstyles_p.h
  18. 4
      src/xlsx/xlsxtheme_p.h
  19. 4
      src/xlsx/xlsxworkbook.cpp
  20. 4
      src/xlsx/xlsxworkbook.h
  21. 4
      src/xlsx/xlsxworkbook_p.h

6
src/xlsx/qtxlsx.pri

@ -39,8 +39,8 @@ HEADERS += $$PWD/xlsxdocpropscore_p.h \
$$PWD/xlsxnumformatparser_p.h \
$$PWD/xlsxdrawinganchor_p.h \
$$PWD/xlsxmediafile_p.h \
$$PWD/xlsxooxmlfile.h \
$$PWD/xlsxooxmlfile_p.h \
$$PWD/xlsxabstractooxmlfile.h \
$$PWD/xlsxabstractooxmlfile_p.h \
$$PWD/xlsxchart.h \
$$PWD/xlsxchart_p.h \
$$PWD/xlsxexternallink_p.h
@ -70,7 +70,7 @@ SOURCES += $$PWD/xlsxdocpropscore.cpp \
$$PWD/xlsxnumformatparser.cpp \
$$PWD/xlsxdrawinganchor.cpp \
$$PWD/xlsxmediafile.cpp \
$$PWD/xlsxooxmlfile.cpp \
$$PWD/xlsxabstractooxmlfile.cpp \
$$PWD/xlsxchart.cpp \
$$PWD/xlsxexternallink.cpp

32
src/xlsx/xlsxooxmlfile.cpp → src/xlsx/xlsxabstractooxmlfile.cpp

@ -23,21 +23,21 @@
**
****************************************************************************/
#include "xlsxooxmlfile.h"
#include "xlsxooxmlfile_p.h"
#include "xlsxabstractooxmlfile.h"
#include "xlsxabstractooxmlfile_p.h"
#include <QBuffer>
#include <QByteArray>
QT_BEGIN_NAMESPACE_XLSX
OOXmlFilePrivate::OOXmlFilePrivate(OOXmlFile *q)
AbstractOOXmlFilePrivate::AbstractOOXmlFilePrivate(AbstractOOXmlFile *q)
:relationships(new Relationships), q_ptr(q)
{
}
OOXmlFilePrivate::~OOXmlFilePrivate()
AbstractOOXmlFilePrivate::~AbstractOOXmlFilePrivate()
{
}
@ -50,25 +50,25 @@ OOXmlFilePrivate::~OOXmlFilePrivate()
* Base class of all the ooxml part file.
*/
OOXmlFile::OOXmlFile()
:d_ptr(new OOXmlFilePrivate(this))
AbstractOOXmlFile::AbstractOOXmlFile()
:d_ptr(new AbstractOOXmlFilePrivate(this))
{
}
OOXmlFile::OOXmlFile(OOXmlFilePrivate *d)
AbstractOOXmlFile::AbstractOOXmlFile(AbstractOOXmlFilePrivate *d)
:d_ptr(d)
{
}
OOXmlFile::~OOXmlFile()
AbstractOOXmlFile::~AbstractOOXmlFile()
{
if (d_ptr->relationships)
delete d_ptr->relationships;
delete d_ptr;
}
QByteArray OOXmlFile::saveToXmlData() const
QByteArray AbstractOOXmlFile::saveToXmlData() const
{
QByteArray data;
QBuffer buffer(&data);
@ -78,7 +78,7 @@ QByteArray OOXmlFile::saveToXmlData() const
return data;
}
bool OOXmlFile::loadFromXmlData(const QByteArray &data)
bool AbstractOOXmlFile::loadFromXmlData(const QByteArray &data)
{
QBuffer buffer;
buffer.setData(data);
@ -90,18 +90,18 @@ bool OOXmlFile::loadFromXmlData(const QByteArray &data)
/*!
* \internal
*/
void OOXmlFile::setFilePath(const QString path)
void AbstractOOXmlFile::setFilePath(const QString path)
{
Q_D(OOXmlFile);
Q_D(AbstractOOXmlFile);
d->filePathInPackage = path;
}
/*!
* \internal
*/
QString OOXmlFile::filePath() const
QString AbstractOOXmlFile::filePath() const
{
Q_D(const OOXmlFile);
Q_D(const AbstractOOXmlFile);
return d->filePathInPackage;
}
@ -109,9 +109,9 @@ QString OOXmlFile::filePath() const
/*!
* \internal
*/
Relationships *OOXmlFile::relationships() const
Relationships *AbstractOOXmlFile::relationships() const
{
Q_D(const OOXmlFile);
Q_D(const AbstractOOXmlFile);
return d->relationships;
}

20
src/xlsx/xlsxooxmlfile.h → src/xlsx/xlsxabstractooxmlfile.h

@ -23,8 +23,8 @@
**
****************************************************************************/
#ifndef QXLSX_XLSXOOXMLFILE_H
#define QXLSX_XLSXOOXMLFILE_H
#ifndef QXLSX_XLSXABSTRACTOOXMLFILE_H
#define QXLSX_XLSXABSTRACTOOXMLFILE_H
#include "xlsxglobal.h"
@ -33,13 +33,13 @@ class QByteArray;
QT_BEGIN_NAMESPACE_XLSX
class Relationships;
class OOXmlFilePrivate;
class AbstractOOXmlFilePrivate;
class Q_XLSX_EXPORT OOXmlFile
class Q_XLSX_EXPORT AbstractOOXmlFile
{
Q_DECLARE_PRIVATE(OOXmlFile)
Q_DECLARE_PRIVATE(AbstractOOXmlFile)
public:
virtual ~OOXmlFile();
virtual ~AbstractOOXmlFile();
virtual void saveToXmlFile(QIODevice *device) const = 0;
virtual bool loadFromXmlFile(QIODevice *device) = 0;
@ -52,12 +52,12 @@ public:
void setFilePath(const QString path);
QString filePath() const;
protected:
OOXmlFile();
OOXmlFile(OOXmlFilePrivate *d);
AbstractOOXmlFile();
AbstractOOXmlFile(AbstractOOXmlFilePrivate *d);
OOXmlFilePrivate *d_ptr;
AbstractOOXmlFilePrivate *d_ptr;
};
QT_END_NAMESPACE_XLSX
#endif // QXLSX_XLSXOOXMLFILE_H
#endif // QXLSX_XLSXABSTRACTOOXMLFILE_H

12
src/xlsx/xlsxooxmlfile_p.h → src/xlsx/xlsxabstractooxmlfile_p.h

@ -37,25 +37,25 @@
// We mean it.
//
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include "xlsxrelationships_p.h"
#include <QString>
QT_BEGIN_NAMESPACE_XLSX
class XLSX_AUTOTEST_EXPORT OOXmlFilePrivate
class XLSX_AUTOTEST_EXPORT AbstractOOXmlFilePrivate
{
Q_DECLARE_PUBLIC(OOXmlFile)
Q_DECLARE_PUBLIC(AbstractOOXmlFile)
public:
OOXmlFilePrivate(OOXmlFile *q);
virtual ~OOXmlFilePrivate();
AbstractOOXmlFilePrivate(AbstractOOXmlFile *q);
virtual ~AbstractOOXmlFilePrivate();
QString filePathInPackage;//such as "xl/worksheets/sheet1.xml"
//used when load the .xlsx file
Relationships *relationships;
OOXmlFile *q_ptr;
AbstractOOXmlFile *q_ptr;
};
QT_END_NAMESPACE_XLSX

4
src/xlsx/xlsxabstractsheet.cpp

@ -29,7 +29,7 @@
QT_BEGIN_NAMESPACE_XLSX
AbstractSheetPrivate::AbstractSheetPrivate(AbstractSheet *p)
: OOXmlFilePrivate(p)
: AbstractOOXmlFilePrivate(p)
{
hidden = false;
type = AbstractSheet::ST_WorkSheet;
@ -58,7 +58,7 @@ AbstractSheetPrivate::~AbstractSheetPrivate()
* \internal
*/
AbstractSheet::AbstractSheet(const QString &name, int id, Workbook *workbook, AbstractSheetPrivate *d) :
OOXmlFile(d)
AbstractOOXmlFile(d)
{
d_func()->name = name;
d_func()->id = id;

4
src/xlsx/xlsxabstractsheet.h

@ -25,7 +25,7 @@
#ifndef XLSXABSTRACTSHEET_H
#define XLSXABSTRACTSHEET_H
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QStringList>
#include <QSharedPointer>
@ -33,7 +33,7 @@ QT_BEGIN_NAMESPACE_XLSX
class Workbook;
class Drawing;
class AbstractSheetPrivate;
class Q_XLSX_EXPORT AbstractSheet : public OOXmlFile
class Q_XLSX_EXPORT AbstractSheet : public AbstractOOXmlFile
{
Q_DECLARE_PRIVATE(AbstractSheet)
public:

4
src/xlsx/xlsxabstractsheet_p.h

@ -38,13 +38,13 @@
#include "xlsxglobal.h"
#include "xlsxabstractsheet.h"
#include "xlsxooxmlfile_p.h"
#include "xlsxabstractooxmlfile_p.h"
#include <QSharedPointer>
namespace QXlsx {
class XLSX_AUTOTEST_EXPORT AbstractSheetPrivate : public OOXmlFilePrivate
class XLSX_AUTOTEST_EXPORT AbstractSheetPrivate : public AbstractOOXmlFilePrivate
{
Q_DECLARE_PUBLIC(AbstractSheet)
public:

4
src/xlsx/xlsxchart.cpp

@ -36,7 +36,7 @@
QT_BEGIN_NAMESPACE_XLSX
ChartPrivate::ChartPrivate(Chart *q)
:OOXmlFilePrivate(q), chartType(static_cast<Chart::ChartType>(0))
:AbstractOOXmlFilePrivate(q), chartType(static_cast<Chart::ChartType>(0))
{
}
@ -78,7 +78,7 @@ ChartPrivate::~ChartPrivate()
* \internal
*/
Chart::Chart(Worksheet *parent)
:OOXmlFile(new ChartPrivate(this))
:AbstractOOXmlFile(new ChartPrivate(this))
{
d_func()->sheet = parent;
}

4
src/xlsx/xlsxchart.h

@ -26,7 +26,7 @@
#ifndef QXLSX_CHART_H
#define QXLSX_CHART_H
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QSharedPointer>
@ -40,7 +40,7 @@ class ChartPrivate;
class CellRange;
class DrawingAnchor;
class Q_XLSX_EXPORT Chart : public OOXmlFile
class Q_XLSX_EXPORT Chart : public AbstractOOXmlFile
{
Q_DECLARE_PRIVATE(Chart)

4
src/xlsx/xlsxchart_p.h

@ -37,7 +37,7 @@
// We mean it.
//
#include "xlsxooxmlfile_p.h"
#include "xlsxabstractooxmlfile_p.h"
#include "xlsxchart.h"
#include <QSharedPointer>
@ -87,7 +87,7 @@ public:
int crossAx;
};
class ChartPrivate : public OOXmlFilePrivate
class ChartPrivate : public AbstractOOXmlFilePrivate
{
Q_DECLARE_PUBLIC(Chart)

4
src/xlsx/xlsxcontenttypes_p.h

@ -36,7 +36,7 @@
// We mean it.
//
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QString>
#include <QStringList>
@ -46,7 +46,7 @@ class QIODevice;
namespace QXlsx {
class ContentTypes : public OOXmlFile
class ContentTypes : public AbstractOOXmlFile
{
public:
ContentTypes();

4
src/xlsx/xlsxdocpropsapp_p.h

@ -37,7 +37,7 @@
//
#include "xlsxglobal.h"
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QList>
#include <QPair>
#include <QStringList>
@ -47,7 +47,7 @@ class QIODevice;
namespace QXlsx {
class XLSX_AUTOTEST_EXPORT DocPropsApp : public OOXmlFile
class XLSX_AUTOTEST_EXPORT DocPropsApp : public AbstractOOXmlFile
{
public:
DocPropsApp();

4
src/xlsx/xlsxdocpropscore_p.h

@ -37,7 +37,7 @@
//
#include "xlsxglobal.h"
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QMap>
#include <QStringList>
@ -45,7 +45,7 @@ class QIODevice;
namespace QXlsx {
class XLSX_AUTOTEST_EXPORT DocPropsCore : public OOXmlFile
class XLSX_AUTOTEST_EXPORT DocPropsCore : public AbstractOOXmlFile
{
public:
explicit DocPropsCore();

4
src/xlsx/xlsxdrawing_p.h

@ -38,7 +38,7 @@
//
#include "xlsxrelationships_p.h"
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QList>
#include <QString>
@ -54,7 +54,7 @@ class Workbook;
class Worksheet;
class MediaFile;
class Drawing : public OOXmlFile
class Drawing : public AbstractOOXmlFile
{
public:
Drawing(Worksheet *workbook);

4
src/xlsx/xlsxexternallink_p.h

@ -35,14 +35,14 @@
//
// We mean it.
//
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QString>
class QIODevice;
namespace QXlsx {
class ExternalLinK : public OOXmlFile
class ExternalLinK : public AbstractOOXmlFile
{
public:
ExternalLinK();

4
src/xlsx/xlsxsharedstrings_p.h

@ -38,7 +38,7 @@
#include "xlsxglobal.h"
#include "xlsxrichstring.h"
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QHash>
#include <QStringList>
#include <QSharedPointer>
@ -61,7 +61,7 @@ public:
int count;
};
class XLSX_AUTOTEST_EXPORT SharedStrings : public OOXmlFile
class XLSX_AUTOTEST_EXPORT SharedStrings : public AbstractOOXmlFile
{
public:
SharedStrings();

4
src/xlsx/xlsxstyles_p.h

@ -38,7 +38,7 @@
#include "xlsxglobal.h"
#include "xlsxformat.h"
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QSharedPointer>
#include <QHash>
#include <QList>
@ -64,7 +64,7 @@ struct XlsxFormatNumberData
QString formatString;
};
class XLSX_AUTOTEST_EXPORT Styles : public OOXmlFile
class XLSX_AUTOTEST_EXPORT Styles : public AbstractOOXmlFile
{
public:
Styles(bool createEmpty=false);

4
src/xlsx/xlsxtheme_p.h

@ -35,14 +35,14 @@
//
// We mean it.
//
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include <QString>
class QIODevice;
namespace QXlsx {
class Theme : public OOXmlFile
class Theme : public AbstractOOXmlFile
{
public:
Theme();

4
src/xlsx/xlsxworkbook.cpp

@ -42,7 +42,7 @@
QT_BEGIN_NAMESPACE_XLSX
WorkbookPrivate::WorkbookPrivate(Workbook *q) :
OOXmlFilePrivate(q)
AbstractOOXmlFilePrivate(q)
{
sharedStrings = QSharedPointer<SharedStrings> (new SharedStrings);
styles = QSharedPointer<Styles>(new Styles);
@ -66,7 +66,7 @@ WorkbookPrivate::WorkbookPrivate(Workbook *q) :
}
Workbook::Workbook()
: OOXmlFile(new WorkbookPrivate(this))
: AbstractOOXmlFile(new WorkbookPrivate(this))
{
}

4
src/xlsx/xlsxworkbook.h

@ -26,7 +26,7 @@
#define XLSXWORKBOOK_H
#include "xlsxglobal.h"
#include "xlsxooxmlfile.h"
#include "xlsxabstractooxmlfile.h"
#include "xlsxabstractsheet.h"
#include <QList>
#include <QImage>
@ -47,7 +47,7 @@ class MediaFile;
class Chart;
class WorkbookPrivate;
class Q_XLSX_EXPORT Workbook : public OOXmlFile
class Q_XLSX_EXPORT Workbook : public AbstractOOXmlFile
{
Q_DECLARE_PRIVATE(Workbook)
public:

4
src/xlsx/xlsxworkbook_p.h

@ -37,7 +37,7 @@
//
#include "xlsxworkbook.h"
#include "xlsxooxmlfile_p.h"
#include "xlsxabstractooxmlfile_p.h"
#include "xlsxtheme_p.h"
#include "xlsxexternallink_p.h"
#include "xlsxrelationships_p.h"
@ -65,7 +65,7 @@ struct XlsxDefineNameData
int sheetId;
};
class WorkbookPrivate : public OOXmlFilePrivate
class WorkbookPrivate : public AbstractOOXmlFilePrivate
{
Q_DECLARE_PUBLIC(Workbook)
public:

Loading…
Cancel
Save