Browse Source

Pass const QString by reference instead of by value

master
Debao Zhang 11 years ago
parent
commit
afbf4effbf
  1. 2
      src/xlsx/xlsxdocument.cpp
  2. 2
      src/xlsx/xlsxdocument.h
  3. 2
      src/xlsx/xlsxworksheet.cpp
  4. 2
      src/xlsx/xlsxworksheet.h

2
src/xlsx/xlsxdocument.cpp

@ -113,7 +113,7 @@ Format *Document::createFormat()
/*! /*!
* Write \a value to cell \a row_column with the \a format. * Write \a value to cell \a row_column with the \a format.
*/ */
int Document::write(const QString row_column, const QVariant &value, Format *format) int Document::write(const QString &row_column, const QVariant &value, Format *format)
{ {
return currentWorksheet()->write(row_column, value, format); return currentWorksheet()->write(row_column, value, format);
} }

2
src/xlsx/xlsxdocument.h

@ -53,7 +53,7 @@ public:
~Document(); ~Document();
Format *createFormat(); Format *createFormat();
int write(const QString cell, const QVariant &value, Format *format=0); int write(const QString &cell, const QVariant &value, Format *format=0);
int write(int row, int col, const QVariant &value, Format *format=0); int write(int row, int col, const QVariant &value, Format *format=0);
int insertImage(int row, int column, const QImage &image, double xOffset=0, double yOffset=0, double xScale=1, double yScale=1); int insertImage(int row, int column, const QImage &image, double xOffset=0, double yOffset=0, double xScale=1, double yScale=1);
int mergeCells(const QString &range); int mergeCells(const QString &range);

2
src/xlsx/xlsxworksheet.cpp

@ -326,7 +326,7 @@ int Worksheet::write(int row, int column, const QVariant &value, Format *format)
} }
//convert the "A1" notation to row/column notation //convert the "A1" notation to row/column notation
int Worksheet::write(const QString row_column, const QVariant &value, Format *format) int Worksheet::write(const QString &row_column, const QVariant &value, Format *format)
{ {
QPoint pos = xl_cell_to_rowcol(row_column); QPoint pos = xl_cell_to_rowcol(row_column);
if (pos == QPoint(-1, -1)) { if (pos == QPoint(-1, -1)) {

2
src/xlsx/xlsxworksheet.h

@ -50,7 +50,7 @@ class Q_XLSX_EXPORT Worksheet
{ {
Q_DECLARE_PRIVATE(Worksheet) Q_DECLARE_PRIVATE(Worksheet)
public: public:
int write(const QString row_column, const QVariant &value, Format *format=0); int write(const QString &row_column, const QVariant &value, Format *format=0);
int write(int row, int column, const QVariant &value, Format *format=0); int write(int row, int column, const QVariant &value, Format *format=0);
int writeString(int row, int column, const QString &value, Format *format=0); int writeString(int row, int column, const QString &value, Format *format=0);
int writeInlineString(int row, int column, const QString &value, Format *format=0); int writeInlineString(int row, int column, const QString &value, Format *format=0);

Loading…
Cancel
Save