aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/TextHostControlService.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-12-05 20:49:10 +0800
committerYuqian Yang <crupest@crupest.life>2025-12-05 20:49:10 +0800
commitf5c801de04f423269d9cefa3d725b52b87c7a0b9 (patch)
tree51bbda6cf58cdd0a6d9128d073ad00c9337680aa /src/ui/controls/TextHostControlService.cpp
parent5edaa008efabb1b97446bed2f6b542cf01eb3c70 (diff)
downloadcru-f5c801de04f423269d9cefa3d725b52b87c7a0b9.tar.gz
cru-f5c801de04f423269d9cefa3d725b52b87c7a0b9.tar.bz2
cru-f5c801de04f423269d9cefa3d725b52b87c7a0b9.zip
Refactor CRU_LOG_TAG_*.
Diffstat (limited to 'src/ui/controls/TextHostControlService.cpp')
-rw-r--r--src/ui/controls/TextHostControlService.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/ui/controls/TextHostControlService.cpp b/src/ui/controls/TextHostControlService.cpp
index 39c28393..9c57140c 100644
--- a/src/ui/controls/TextHostControlService.cpp
+++ b/src/ui/controls/TextHostControlService.cpp
@@ -222,7 +222,7 @@ void TextHostControlService::SetText(std::string text, bool stop_composition) {
void TextHostControlService::InsertText(Index position, std::string_view text,
bool stop_composition) {
if (!Utf8IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_TAG_ERROR("Invalid text insert position.");
+ CruLogError(kLogTag, "Invalid text insert position.");
return;
}
this->text_.insert(this->text_.cbegin() + position, text.cbegin(),
@@ -236,7 +236,7 @@ void TextHostControlService::InsertText(Index position, std::string_view text,
void TextHostControlService::DeleteChar(Index position, bool stop_composition) {
if (!Utf8IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_TAG_ERROR("Invalid text delete position {}.", position);
+ CruLogError(kLogTag, "Invalid text delete position {}.", position);
return;
}
if (position == static_cast<Index>(this->text_.size())) return;
@@ -249,7 +249,7 @@ void TextHostControlService::DeleteChar(Index position, bool stop_composition) {
Index TextHostControlService::DeleteCharPrevious(Index position,
bool stop_composition) {
if (!Utf8IsValidInsertPosition(this->text_, position)) {
- CRU_LOG_TAG_ERROR("Invalid text delete position {}.", position);
+ CruLogError(kLogTag, "Invalid text delete position {}.", position);
return 0;
}
if (position == 0) return 0;
@@ -265,12 +265,13 @@ void TextHostControlService::DeleteText(TextRange range,
if (range.count == 0) return;
range = range.Normalize();
if (!Utf8IsValidInsertPosition(this->text_, range.GetStart())) {
- CRU_LOG_TAG_ERROR("Invalid text delete start position {}.",
- range.GetStart());
+ CruLogError(kLogTag, "Invalid text delete start position {}.",
+ range.GetStart());
return;
}
if (!Utf8IsValidInsertPosition(this->text_, range.GetEnd())) {
- CRU_LOG_TAG_ERROR("Invalid text delete end position {}.", range.GetEnd());
+ CruLogError(kLogTag, "Invalid text delete end position {}.",
+ range.GetEnd());
return;
}
this->text_.erase(this->text_.cbegin() + range.GetStart(),
@@ -464,8 +465,9 @@ void TextHostControlService::UpdateInputMethodPosition() {
right_bottom.y += 5;
if constexpr (debug_flags::text_service) {
- CRU_LOG_TAG_DEBUG("Calculate input method candidate window position: {}.",
- right_bottom);
+ CruLogDebug(kLogTag,
+ "Calculate input method candidate window position: {}.",
+ right_bottom);
}
input_method_context->SetCandidateWindowPosition(right_bottom);
@@ -691,7 +693,7 @@ void TextHostControlService::SetUpShortcuts() {
void TextHostControlService::OpenContextMenu(const Point& position,
ContextMenuItem items) {
- CRU_LOG_TAG_DEBUG("Open context menu.");
+ CruLogDebug(kLogTag, "Open context menu.");
if (!context_menu_) {
context_menu_.reset(new components::PopupMenu());
}