diff options
Diffstat (limited to 'core/src/Model/Template/TableTemplate.cpp')
-rw-r--r-- | core/src/Model/Template/TableTemplate.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/core/src/Model/Template/TableTemplate.cpp b/core/src/Model/Template/TableTemplate.cpp index e01af02..6c3d86b 100644 --- a/core/src/Model/Template/TableTemplate.cpp +++ b/core/src/Model/Template/TableTemplate.cpp @@ -20,22 +20,22 @@ bool TableCell::IsMergedCell() const return PrimaryCellLocation.x == -1 || PrimaryCellLocation.y == -1; } -Vec2i TableCellArrayGroup::GetLeftCell() const +Vec2i TableArrayGroup::GetLeftCell() const { return { Row, LeftCell }; } -Vec2i TableCellArrayGroup::GetRightCell() const +Vec2i TableArrayGroup::GetRightCell() const { return { Row, RightCell }; } -int TableCellArrayGroup::GetCount() const +int TableArrayGroup::GetCount() const { return RightCell - LeftCell + 1; } -Vec2i TableCellArrayGroup::FindCell(std::string_view name) +Vec2i TableArrayGroup::FindCell(std::string_view name) { } @@ -165,10 +165,11 @@ void TableTemplate::SetCellType(Vec2i pos, TableCell::CellType type) case TableCell::ArrayParametricCell: { auto& ag = mArrayGroups[cell.DataId]; if (cell.Location.x == ag.LeftCell) { - + ag.LeftCell++; } else if (cell.Location.x == ag.RightCell) { - + ag.RightCell--; } else { + } } break; } @@ -205,17 +206,17 @@ int TableTemplate::GetArrayGroupCount() const return mArrayGroups.size(); } -const TableCellArrayGroup& TableTemplate::GetArrayGroup(int id) const +const TableArrayGroup& TableTemplate::GetArrayGroup(int id) const { return mArrayGroups[id]; } -TableCellArrayGroup& TableTemplate::GetArrayGroup(int id) +TableArrayGroup& TableTemplate::GetArrayGroup(int id) { return mArrayGroups[id]; } -TableCellArrayGroup* TableTemplate::AddArrayGroup(int row, int left, int right) +TableArrayGroup* TableTemplate::AddArrayGroup(int row, int left, int right) { // size_t max value: 18446744073709551615 // ^~~~~~~~~~~~~~~~~~~~ 20 chars @@ -226,7 +227,7 @@ TableCellArrayGroup* TableTemplate::AddArrayGroup(int row, int left, int right) return AddArrayGroup(nameStr, row, left, right); } -TableCellArrayGroup* TableTemplate::AddArrayGroup(std::string_view name, int row, int left, int right) +TableArrayGroup* TableTemplate::AddArrayGroup(std::string_view name, int row, int left, int right) { assert(row >= 0 && row < GetTableHeight()); assert(left >= 0 && left < GetTableWidth()); @@ -243,7 +244,7 @@ TableCellArrayGroup* TableTemplate::AddArrayGroup(std::string_view name, int row return nullptr; } - mArrayGroups.push_back(TableCellArrayGroup{ + mArrayGroups.push_back(TableArrayGroup{ .Row = row, .LeftCell = left, .RightCell = right, @@ -281,7 +282,7 @@ TableCell* TableTemplate::FindCell(std::string_view name) } } -TableCellArrayGroup* TableTemplate::FindArrayGroup(std::string_view name) +TableArrayGroup* TableTemplate::FindArrayGroup(std::string_view name) { auto iter = mName2ArrayGroups.find(name); if (iter != mName2ArrayGroups.end()) { |