[gedit: 5/6] spell-checker: pass -1 instead of strlen() to enchant functions
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit: 5/6] spell-checker: pass -1 instead of strlen() to enchant functions
- Date: Fri, 24 Jul 2015 05:57:18 +0000 (UTC)
commit 06fd1c4a8ff8008dce9bb08a6f939a2254f51099
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Jul 24 07:47:51 2015 +0200
spell-checker: pass -1 instead of strlen() to enchant functions
plugins/spell/gedit-spell-checker.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/plugins/spell/gedit-spell-checker.c b/plugins/spell/gedit-spell-checker.c
index 9fca432..61a4516 100644
--- a/plugins/spell/gedit-spell-checker.c
+++ b/plugins/spell/gedit-spell-checker.c
@@ -347,7 +347,7 @@ gedit_spell_checker_check_word (GeditSpellChecker *spell,
}
g_return_val_if_fail (spell->dict != NULL, FALSE);
- enchant_result = enchant_dict_check (spell->dict, word, strlen (word));
+ enchant_result = enchant_dict_check (spell->dict, word, -1);
switch (enchant_result)
{
@@ -428,7 +428,7 @@ gedit_spell_checker_add_word_to_personal (GeditSpellChecker *spell,
g_return_val_if_fail (spell->dict != NULL, FALSE);
- enchant_dict_add_to_pwl (spell->dict, word, strlen (word));
+ enchant_dict_add_to_pwl (spell->dict, word, -1);
g_signal_emit (G_OBJECT (spell), signals[ADD_WORD_TO_PERSONAL], 0, word);
@@ -449,7 +449,7 @@ gedit_spell_checker_add_word_to_session (GeditSpellChecker *spell,
g_return_val_if_fail (spell->dict != NULL, FALSE);
- enchant_dict_add_to_session (spell->dict, word, strlen (word));
+ enchant_dict_add_to_session (spell->dict, word, -1);
g_signal_emit (G_OBJECT (spell), signals[ADD_WORD_TO_SESSION], 0, word);
@@ -496,10 +496,8 @@ gedit_spell_checker_set_correction (GeditSpellChecker *spell,
g_return_val_if_fail (spell->dict != NULL, FALSE);
enchant_dict_store_replacement (spell->dict,
- word,
- strlen (word),
- replacement,
- strlen (replacement));
+ word, -1,
+ replacement, -1);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]