diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-01 23:01:54 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-06 08:20:52 +0000 |
commit | e7e8267fd52f1c04fd6342307cb944bb92006542 (patch) | |
tree | 6a1cf312f87f099ab2cea195830c61546cde01eb /src/plugins/openwnn | |
parent | dadbe3cd2eccbd15ee9d611c9cd8a132227c39a1 (diff) |
Fix zero as null pointer constant
Change-Id: If41bd31f1fcec5647197ca6834909f4011fe87fa
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/plugins/openwnn')
-rw-r--r-- | src/plugins/openwnn/plugin/openwnninputmethod.cpp | 20 | ||||
-rw-r--r-- | src/plugins/openwnn/plugin/openwnninputmethod_p.h | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/openwnn/plugin/openwnninputmethod.cpp b/src/plugins/openwnn/plugin/openwnninputmethod.cpp index a038fa34..ce7496a7 100644 --- a/src/plugins/openwnn/plugin/openwnninputmethod.cpp +++ b/src/plugins/openwnn/plugin/openwnninputmethod.cpp @@ -67,10 +67,10 @@ public: q_ptr(q_ptr), inputMode(InputEngine::Latin), exactMatchMode(false), - converter(0), + converter(nullptr), converterJAJP(), activeConvertType(CONVERT_TYPE_NONE), - preConverter(0), + preConverter(nullptr), enableLearning(true), enablePrediction(true), enableConverter(true), @@ -86,22 +86,22 @@ public: switch (mode) { case ENGINE_MODE_DIRECT: /* Full/Half-width number or Full-width alphabet */ - converter = NULL; + converter = nullptr; preConverter.reset(); break; case ENGINE_MODE_NO_LV2_CONV: - converter = NULL; + converter = nullptr; preConverter.reset(new Romkan()); break; case ENGINE_MODE_FULL_KATAKANA: - converter = NULL; + converter = nullptr; preConverter.reset(new RomkanFullKatakana()); break; case ENGINE_MODE_HALF_KATAKANA: - converter = NULL; + converter = nullptr; preConverter.reset(new RomkanHalfKatakana()); break; @@ -126,7 +126,7 @@ public: bool isEnableL2Converter() { - return converter != NULL && enableConverter; + return converter != nullptr && enableConverter; } void startConvert(ConvertType convertType) @@ -447,7 +447,7 @@ public: } QString tmp = composingText.toString(layer, 0, cursor - 1); - if (converter != NULL) { + if (converter != nullptr) { if (learn) { if (activeConvertType == CONVERT_TYPE_RENBUN) { learnWord(0); /* select the top of the clauses */ @@ -665,7 +665,7 @@ bool OpenWnnInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboard Q_UNUSED(modifiers) Q_D(OpenWnnInputMethod); - if (d->preConverter == NULL && !d->isEnableL2Converter()) + if (d->preConverter == nullptr && !d->isEnableL2Converter()) return false; switch (key) { @@ -738,7 +738,7 @@ bool OpenWnnInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::Keyboard if (d->isEnableL2Converter()) { d->commitConvertingText(); d->composingText.insertStrSegment(ComposingText::LAYER0, ComposingText::LAYER1, text.mid(i, 1)); - if (d->preConverter != NULL) + if (d->preConverter != nullptr) d->preConverter->convert(d->composingText); if (i == last) d->updateViewStatusForPrediction(true, true); diff --git a/src/plugins/openwnn/plugin/openwnninputmethod_p.h b/src/plugins/openwnn/plugin/openwnninputmethod_p.h index 1ecdf8fc..dd439c13 100644 --- a/src/plugins/openwnn/plugin/openwnninputmethod_p.h +++ b/src/plugins/openwnn/plugin/openwnninputmethod_p.h @@ -54,7 +54,7 @@ class OpenWnnInputMethod : public AbstractInputMethod Q_DECLARE_PRIVATE(OpenWnnInputMethod) public: - explicit OpenWnnInputMethod(QObject *parent = 0); + explicit OpenWnnInputMethod(QObject *parent = nullptr); ~OpenWnnInputMethod(); QList<InputEngine::InputMode> inputModes(const QString &locale); |