Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
227cafac
Commit
227cafac
authored
Dec 29, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle characters that have no encoding conversion in the spellchecker
parent
f4e877da
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src/util/spell_checker.cpp
src/util/spell_checker.cpp
+14
-3
No files found.
src/util/spell_checker.cpp
View file @
227cafac
...
...
@@ -46,11 +46,22 @@ void SpellChecker::destroyAll() {
// ----------------------------------------------------------------------------- : Spell checker : use
bool
SpellChecker
::
spell
(
const
String
&
word
)
{
return
Hunspell
::
spell
(
word
.
mb_str
(
encoding
));
if
(
word
.
empty
())
return
true
;
// empty word is okay
#ifdef UNICODE
wxCharBuffer
str
=
word
.
mb_str
(
encoding
);
#else
wxCharBuffer
str
=
word
.
mb_str
(
encoding
);
#endif
if
(
*
str
==
'\0'
)
{
// If encoding fails we get an empty string, since the word was not empty this can never happen
// words that can't be encoded are not in the dictionary, so they are wrong.
return
false
;
}
return
Hunspell
::
spell
(
str
);
}
const
String
word_start
=
String
(
_
(
"[({
\"\'
"
))
+
LEFT_SINGLE_QUOTE
+
LEFT_DOUBLE_QUOTE
;
const
String
word_end
=
String
(
_
(
"])}.,;:
\"\'
"
))
+
RIGHT_SINGLE_QUOTE
+
RIGHT_DOUBLE_QUOTE
;
const
String
word_start
=
String
(
_
(
"[({
\"\'
"
))
+
LEFT_SINGLE_QUOTE
+
LEFT_DOUBLE_QUOTE
;
const
String
word_end
=
String
(
_
(
"])}.,;:
?!
\"\'
"
))
+
RIGHT_SINGLE_QUOTE
+
RIGHT_DOUBLE_QUOTE
;
bool
SpellChecker
::
spell_with_punctuation
(
const
String
&
word
)
{
size_t
first
=
word
.
find_first_not_of
(
word_start
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment