电子表格应用程序开发详解
1. 单元格矩阵(Cell Matrix)
电子表格的单元格以矩阵形式组织,矩阵大小由常量 ROWS 和 COLS 决定。 CellMatrix 类的 m_buffer 是一个二维数组,用于存储单元格。
以下是 CellMatrix 类的定义:
class TSetMatrix;
const int ROWS = 10;
const int COLS = 5;
class CellMatrix
{
public:
CellMatrix();
CellMatrix(const CellMatrix& cellMatrix);
CellMatrix operator=(const CellMatrix& cellMatrix);
void SetTargetSetMatrix(TSetMatrix* pTargetSetMatrix);
Cell* Get(int iRow, int iCol) const;
Cell* Get(Reference home) const;
void Serialize(CArchive& archive);
private:
Cell m_buffer[ROWS][COLS];
};
- 构造函数 :默认构造函数为每个单元格设置指向该单元格矩
超级会员免费看
订阅专栏 解锁全文
1715

被折叠的 条评论
为什么被折叠?



