diff --git a/apps/code/script_node_cell.cpp b/apps/code/script_node_cell.cpp index faeadc806..312978e2a 100644 --- a/apps/code/script_node_cell.cpp +++ b/apps/code/script_node_cell.cpp @@ -7,21 +7,6 @@ namespace Code { constexpr char ScriptNodeCell::k_parentheses[]; constexpr char ScriptNodeCell::k_parenthesesWithEmpty[]; -ScriptNodeCell::ScriptNodeView::ScriptNodeView() : - HighlightCell(), - m_scriptNode(nullptr), - m_scriptStore(nullptr) -{ -} - -void ScriptNodeCell::ScriptNodeView::setScriptNode(ScriptNode * scriptNode) { - m_scriptNode = scriptNode; -} - -void ScriptNodeCell::ScriptNodeView::setScriptStore(ScriptStore * scriptStore) { - m_scriptStore = scriptStore; -} - void ScriptNodeCell::ScriptNodeView::drawRect(KDContext * ctx, KDRect rect) const { ctx->drawString(m_scriptNode->name(), KDPoint(0, Metric::TableCellVerticalMargin), k_font, KDColorBlack, isHighlighted()? Palette::Select : KDColorWhite, m_scriptNode->nameLength()); KDSize nameSize = k_font->stringSize(m_scriptNode->name(), m_scriptNode->nameLength()); @@ -44,21 +29,11 @@ KDSize ScriptNodeCell::ScriptNodeView::minimalSizeForOptimalDisplay() const { return KDSize(size1.width() + size3.width() > size2.width() ? size1.width() + size3.width() : size2.width(), Metric::TableCellVerticalMargin + size1.width() + k_verticalMargin + size2.width()); } -ScriptNodeCell::ScriptNodeCell() : - TableCell(), - m_scriptNodeView() -{ -} - void ScriptNodeCell::setScriptNode(ScriptNode * scriptNode) { m_scriptNodeView.setScriptNode(scriptNode); reloadCell(); } -void ScriptNodeCell::setScriptStore(ScriptStore * scriptStore) { - m_scriptNodeView.setScriptStore(scriptStore); -} - void ScriptNodeCell::setHighlighted(bool highlight) { TableCell::setHighlighted(highlight); m_scriptNodeView.setHighlighted(highlight); diff --git a/apps/code/script_node_cell.h b/apps/code/script_node_cell.h index c4d7651b7..4367e8c12 100644 --- a/apps/code/script_node_cell.h +++ b/apps/code/script_node_cell.h @@ -10,9 +10,12 @@ namespace Code { class ScriptNodeCell : public TableCell { public: - ScriptNodeCell(); - void setScriptNode(ScriptNode * node); - void setScriptStore(ScriptStore * scriptStore); + ScriptNodeCell() : + TableCell(), + m_scriptNodeView() + {} + void setScriptNode(ScriptNode * node) { m_scriptNode = scriptNode; } + void setScriptStore(ScriptStore * scriptStore) { m_scriptNodeView.setScriptStore(scriptStore); } /* TableCell */ View * labelView() const override { return const_cast(static_cast(&m_scriptNodeView)); } @@ -29,9 +32,13 @@ public: protected: class ScriptNodeView : public HighlightCell { public: - ScriptNodeView(); - void setScriptNode(ScriptNode * scriptNode); - void setScriptStore(ScriptStore * scriptStore); + ScriptNodeView() : + HighlightCell(), + m_scriptNode(nullptr), + m_scriptStore(nullptr) + {} + void setScriptNode(ScriptNode * node) { m_scriptNode = scriptNode; } + void setScriptStore(ScriptStore * scriptStore) { m_scriptStore = scriptStore; } void drawRect(KDContext * ctx, KDRect rect) const override; virtual KDSize minimalSizeForOptimalDisplay() const override; const char * text() const override {