Changeset View
Changeset View
Standalone View
Standalone View
src/ui/spellcheckdecorator.cpp
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | |||||
166 | } | 166 | } | ||
167 | 167 | | |||
168 | void SpellCheckDecorator::Private::execSuggestionMenu(const QPoint &pos, const QString &selectedWord, const QTextCursor &_cursor) | 168 | void SpellCheckDecorator::Private::execSuggestionMenu(const QPoint &pos, const QString &selectedWord, const QTextCursor &_cursor) | ||
169 | { | 169 | { | ||
170 | QTextCursor cursor = _cursor; | 170 | QTextCursor cursor = _cursor; | ||
171 | QMenu menu; //don't use KMenu here we don't want auto management accelerator | 171 | QMenu menu; //don't use KMenu here we don't want auto management accelerator | ||
172 | 172 | | |||
173 | //Add the suggestions to the menu | 173 | //Add the suggestions to the menu | ||
174 | const QStringList reps = m_highlighter->suggestionsForWord(selectedWord); | 174 | const QStringList reps = m_highlighter->suggestionsForWord(selectedWord, cursor); | ||
175 | if (reps.isEmpty()) { | 175 | if (reps.isEmpty()) { | ||
176 | QAction *suggestionsAction = menu.addAction(tr("No suggestions for %1").arg(selectedWord)); | 176 | QAction *suggestionsAction = menu.addAction(tr("No suggestions for %1").arg(selectedWord)); | ||
177 | suggestionsAction->setEnabled(false); | 177 | suggestionsAction->setEnabled(false); | ||
178 | } else { | 178 | } else { | ||
179 | QStringList::const_iterator end(reps.constEnd()); | 179 | QStringList::const_iterator end(reps.constEnd()); | ||
180 | for (QStringList::const_iterator it = reps.constBegin(); it != end; ++it) { | 180 | for (QStringList::const_iterator it = reps.constBegin(); it != end; ++it) { | ||
181 | menu.addAction(*it); | 181 | menu.addAction(*it); | ||
182 | } | 182 | } | ||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |