7#include "ispellcheckerdict.h"
8#include "ispellcheckerdebug.h"
12ISpellCheckerDict::ISpellCheckerDict(ISpellChecker *spellChecker,
const QString &language)
13 : SpellerPlugin(language)
14 , m_spellChecker(spellChecker)
16 Q_ASSERT(m_spellChecker);
19ISpellCheckerDict::~ISpellCheckerDict()
24bool ISpellCheckerDict::isCorrect(
const QString &word)
const
28 IEnumSpellingError *enumSpellingError =
nullptr;
29 if (SUCCEEDED(m_spellChecker->Check(word.
toStdWString().c_str(), &enumSpellingError))) {
30 ISpellingError *spellingError =
nullptr;
31 if (S_OK == enumSpellingError->Next(&spellingError)) {
33 spellingError->Release();
35 enumSpellingError->Release();
44 IEnumString *words =
nullptr;
45 if (SUCCEEDED(m_spellChecker->Suggest(word.
toStdWString().c_str(), &words))) {
48 LPOLESTR
string =
nullptr;
49 hr = words->Next(1, &
string,
nullptr);
52 CoTaskMemFree(
string);
60bool ISpellCheckerDict::storeReplacement(
const QString &bad,
const QString &good)
64 qCDebug(SONNET_ISPELLCHECKER) <<
"ISpellCheckerDict::storeReplacement not implemented";
68bool ISpellCheckerDict::addToPersonal(
const QString &word)
71 return SUCCEEDED(m_spellChecker->Add(word.
toStdWString().c_str()));
74bool ISpellCheckerDict::addToSession(
const QString &word)
77 return SUCCEEDED(m_spellChecker->Ignore(word.
toStdWString().c_str()));
void push_back(parameter_type value)
QString fromWCharArray(const wchar_t *string, qsizetype size)
std::wstring toStdWString() const const