diff options
Diffstat (limited to 'core/src/UI/UI_Templates.cpp')
-rw-r--r-- | core/src/UI/UI_Templates.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/core/src/UI/UI_Templates.cpp b/core/src/UI/UI_Templates.cpp index b4e3aa5..0320ea0 100644 --- a/core/src/UI/UI_Templates.cpp +++ b/core/src/UI/UI_Templates.cpp @@ -194,7 +194,6 @@ private: if (!IsSelected()) { ImGui::Text(I18N_TEXT("Select a cell to edit", L10N_TABLE_CELL_SELECT_MSG)); } else if (mSelectionTL == mSelectionBR) { - auto& selectCell = mTable->GetCell(mSelectionTL); DisplayCellProperties(mSelectionTL); } else { DisplayRangeProperties(mSelectionTL, mSelectionBR); @@ -260,9 +259,9 @@ private: int dividend = column; int modulo; - char* lastChar = bufferEnd - 1; - *lastChar = '\0'; - char* writeHead = lastChar - 1; + char* writeHead = bufferEnd - 1; + *writeHead = '\0'; + --writeHead; while (dividend > 0) { if (writeHead < bufferBegin) { @@ -730,17 +729,19 @@ std::unique_ptr<TemplateUI> TemplateUI::CreateByKind(Template::Kind kind, std::u #define UNIQUE_CAST(TargetType, input) std::unique_ptr<TargetType>(static_cast<TargetType*>(input.release())) switch (kind) { case Template::KD_Table: return std::make_unique<TableTemplateUI>(UNIQUE_CAST(TableTemplate, tmpl)); - case Template::InvalidKind: return nullptr; + case Template::InvalidKind: break; } #pragma pop_macro("UNIQUE_CAST") + return nullptr; } std::unique_ptr<TemplateUI> TemplateUI::CreateByKind(Template::Kind kind) { switch (kind) { case Template::KD_Table: return std::make_unique<TableTemplateUI>(std::make_unique<TableTemplate>()); - case Template::InvalidKind: return nullptr; + case Template::InvalidKind: break; } + return nullptr; } } // namespace |