Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the Phrase should not contain invalid characters. #109

Open
HsiaoYuShih opened this issue Mar 21, 2016 · 3 comments
Open

the Phrase should not contain invalid characters. #109

HsiaoYuShih opened this issue Mar 21, 2016 · 3 comments

Comments

@HsiaoYuShih
Copy link

When I try to modify phrase, if the input contains non-Chinese characters, then it will fail and the original phrase will be removed.
2016-03-21 10 09 55

The information of debug mode:
2016-03-21 10 10 33
It triggers function chewing_userphrase_remove in libchewing/src/chewingio.c

Alphabet, digit, and any other symbol should not be allowed.

@david50407
Copy link
Member

Because the implementation of 'Edit' function is adding the new phrase after removing old phrase selected, but this won't check if new phrase is valid before removing.
Maybe we can try to add first and then remove the old one if the change is succeed, or we can recover the old phrase while error happening?

@HsiaoYuShih
Copy link
Author

Yeh, adding first and then removing the old one only when the new one is successfully added is OK.

@kidwm
Copy link
Member

kidwm commented Mar 22, 2016

Ref: #108

jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Mar 26, 2016
The phrase can be preserved when the "add" step in "modify" is failed.
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Mar 26, 2016
The phrase can be preserved when the "add" step in "modify" is failed.

After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.

Resolves: chewing#75
See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Mar 27, 2016
The phrase can be preserved when the "add" step in "modify" is failed.

After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.

Resolves: chewing#75
See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Mar 28, 2016
The phrase can be preserved when the "add" step in "modify" is failed.

After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.

Resolves: chewing#75
See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Apr 1, 2016
The phrase can be preserved when the "add" step in "modify" is failed.

After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.

Resolves: chewing#75
See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Apr 4, 2016
The phrase can be preserved when the "add" step in "modify" is failed.

After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.

Resolves: chewing#75
See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Apr 9, 2016
Close chewing#75

The phrase can be preserved when the "add" step in "modify" is failed.
After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.

See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Apr 9, 2016
Close chewing#75

The phrase can be preserved when the "add" step in "modify" is failed.
After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.

See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Apr 9, 2016
Close chewing#75
The phrase can be preserved when the "add" step in "modify" is failed.
After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.
See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Apr 9, 2016
Close chewing#75
The phrase can be preserved when the "add" step in "modify" is failed.
After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.
See also: chewing#109
jeffreyhc pushed a commit to jeffreyhc/chewing-editor that referenced this issue Apr 10, 2016
Close chewing#75
The phrase can be preserved when the "add" step in "modify" is failed.
After a new phrase is added, the selection of the original phrase in
chewing-editor seems to be reset, then the remove() in UserphaseView
will lost the remove target.
So I check the modified phrase add to the database successfully or not,
If the adding is fail, then re-add the original phrase.
See also: chewing#109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants