@@ -19,13 +19,10 @@ RimeCandidateWord::RimeCandidateWord(RimeEngine *engine,
19
19
const RimeCandidate &candidate, KeySym sym,
20
20
int idx)
21
21
: CandidateWord(), engine_(engine), sym_(sym), idx_(idx) {
22
- Text text;
23
- text.append (std::string (candidate.text ));
24
- if (candidate.comment && strlen (candidate.comment )) {
25
- text.append (" " );
26
- text.append (std::string (candidate.comment ));
22
+ setText (Text{candidate.text });
23
+ if (candidate.comment && candidate.comment [0 ]) {
24
+ setComment (Text{candidate.comment });
27
25
}
28
- setText (text);
29
26
}
30
27
31
28
void RimeCandidateWord::select (InputContext *inputContext) const {
@@ -45,13 +42,10 @@ RimeGlobalCandidateWord::RimeGlobalCandidateWord(RimeEngine *engine,
45
42
const RimeCandidate &candidate,
46
43
int idx)
47
44
: CandidateWord(), engine_(engine), idx_(idx) {
48
- Text text;
49
- text.append (std::string (candidate.text ));
50
- if (candidate.comment && strlen (candidate.comment )) {
51
- text.append (" " );
52
- text.append (std::string (candidate.comment ));
45
+ setText (Text{candidate.text });
46
+ if (candidate.comment && candidate.comment [0 ]) {
47
+ setComment (Text{candidate.comment });
53
48
}
54
- setText (text);
55
49
}
56
50
57
51
void RimeGlobalCandidateWord::select (InputContext *inputContext) const {
0 commit comments