diff options
Diffstat (limited to 'src/ui/controls/text_control.cpp')
-rw-r--r-- | src/ui/controls/text_control.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/ui/controls/text_control.cpp b/src/ui/controls/text_control.cpp index 3c5d7c33..5769af58 100644 --- a/src/ui/controls/text_control.cpp +++ b/src/ui/controls/text_control.cpp @@ -3,6 +3,7 @@ #include "ui/window.h" #include "graph/graph.h" #include "exception.h" +#include <cassert> namespace cru::ui::controls { @@ -49,19 +50,6 @@ namespace cru::ui::controls Repaint(); } - void TextControl::AddTextLayoutHandler(TextLayoutHandlerPtr handler) - { - text_layout_handlers_.push_back(std::move(handler)); - } - - void TextControl::RemoveTextLayoutHandler(const TextLayoutHandlerPtr& handler) - { - const auto find_result = std::find(text_layout_handlers_.cbegin(), text_layout_handlers_.cend(), - handler); - if (find_result != text_layout_handlers_.cend()) - text_layout_handlers_.erase(find_result); - } - void TextControl::SetSelectable(const bool is_selectable) { if (!is_selectable) @@ -115,7 +103,7 @@ namespace cru::ui::controls ThrowIfFailed(layout->GetMetrics(&text_metrics)); const auto metrics_count = text_metrics.lineCount * text_metrics.maxBidiReorderingDepth; - Vector<DWRITE_HIT_TEST_METRICS> hit_test_metrics(metrics_count); + std::vector<DWRITE_HIT_TEST_METRICS> hit_test_metrics(metrics_count); UINT32 actual_count; layout->HitTestTextRange( range.value().position, range.value().count, @@ -238,8 +226,5 @@ namespace cru::ui::controls size.width, size.height, &text_layout_ )); - - for (const auto& handler : text_layout_handlers_) - (*handler)(text_layout_); } } |