1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
diff --git a/src/unix/fcitx/surrounding_text_util.cc b/src/unix/fcitx/surrounding_text_util.cc
index b2d533c..76357cd 100644
--- a/src/unix/fcitx/surrounding_text_util.cc
+++ b/src/unix/fcitx/surrounding_text_util.cc
@@ -233,9 +233,9 @@ bool GetSurroundingText(FcitxInstance* instance,
const size_t selection_start = std::min(cursor_pos, anchor_pos);
const size_t selection_length = std::abs(info->relative_selected_length);
- info->preceding_text = Util::Utf8SubString(surrounding_text, 0, selection_start);
- info->selection_text = Util::Utf8SubString(surrounding_text, selection_start, selection_length);
- info->following_text = Util::Utf8SubString(surrounding_text, selection_start + selection_length);
+ info->preceding_text = std::string(Util::Utf8SubString(surrounding_text, 0, selection_start));
+ info->selection_text = std::string(Util::Utf8SubString(surrounding_text, selection_start, selection_length));
+ info->following_text = std::string(Util::Utf8SubString(surrounding_text, selection_start + selection_length));
return true;
}
diff --git a/src/unix/fcitx/eim.cc b/src/unix/fcitx/eim.cc
index 4da2e80..fc7a9ff 100644
--- a/src/unix/fcitx/eim.cc
+++ b/src/unix/fcitx/eim.cc
@@ -33,6 +33,7 @@
#include <fcitx/module.h>
#include <fcitx/keys.h>
#include <fcitx-config/xdg.h>
+#undef InvokeFunction
#include "fcitx_mozc.h"
#include "mozc_connection.h"
#include "mozc_response_parser.h
|