wumu
2024-05-07 5e74d49c960965e3134cda27f603024483a4a1d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// xlsxcellreference.h
 
#ifndef QXLSX_XLSXCELLREFERENCE_H
#define QXLSX_XLSXCELLREFERENCE_H
 
#include <QtGlobal>
 
#include "xlsxglobal.h"
 
QT_BEGIN_NAMESPACE_XLSX
 
class QXLSX_EXPORT CellReference
{
public:
    CellReference();
    CellReference(int row, int column);
    CellReference(const QString &cell);
    CellReference(const char *cell);
    CellReference(const CellReference &other);
    ~CellReference();
 
    QString toString(bool row_abs=false, bool col_abs=false) const;
    static CellReference fromString(const QString &cell);
    bool isValid() const;
    inline void setRow(int row) { _row = row; }
    inline void setColumn(int col) { _column = col; }
    inline int row() const { return _row; }
    inline int column() const { return _column; }
 
    inline bool operator ==(const CellReference &other) const
    {
        return _row==other._row && _column==other._column;
    }
    inline bool operator !=(const CellReference &other) const
    {
        return _row!=other._row || _column!=other._column;
    }
private:
    void init(const QString &cell);
    int _row, _column;
};
 
QT_END_NAMESPACE_XLSX
 
Q_DECLARE_TYPEINFO(QXlsx::CellReference, Q_MOVABLE_TYPE);
 
#endif // QXLSX_XLSXCELLREFERENCE_H