summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Edit.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp52
1 files changed, 1 insertions, 51 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index e193d0f469..e836594378 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -23,9 +23,7 @@
#include "third_party/base/stl_util.h"
CPWL_Edit::CPWL_Edit()
- : m_pFillerNotify(NULL), m_pSpellCheck(NULL), m_bFocus(FALSE) {
- m_pFormFiller = NULL;
-}
+ : m_pFillerNotify(nullptr), m_bFocus(FALSE), m_pFormFiller(nullptr) {}
CPWL_Edit::~CPWL_Edit() {
ASSERT(m_bFocus == FALSE);
@@ -247,10 +245,6 @@ void CPWL_Edit::SetParamByFlag() {
GetClientRect(), 1.0f)); // +1 for caret beside border
}
}
-
- if (HasFlag(PES_SPELLCHECK)) {
- m_pSpellCheck = GetCreationParam().pSpellCheck;
- }
}
void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
@@ -356,16 +350,6 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
<< CPWL_Utils::GetColorAppStream(GetTextColor()).AsByteStringC()
<< sEditAfter.AsByteStringC() << "ET\n";
- if (HasFlag(PES_SPELLCHECK)) {
- CFX_ByteString sSpellCheck = CPWL_Utils::GetSpellCheckAppStream(
- m_pEdit, m_pSpellCheck, ptOffset, &wrVisible);
- if (sSpellCheck.GetLength() > 0)
- sText << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB, 1, 0, 0),
- FALSE)
- .AsByteStringC()
- << sSpellCheck.AsByteStringC();
- }
-
if (sText.GetLength() > 0) {
CFX_FloatRect rcClient = GetClientRect();
sAppStream << "q\n/Tx BMC\n";
@@ -467,12 +451,6 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()),
CPWL_Utils::PWLColorToFXColor(GetTextStrokeColor(), GetTransparency()),
rcClip, CFX_FloatPoint(0.0f, 0.0f), pRange, pSysHandler, m_pFormFiller);
-
- if (HasFlag(PES_SPELLCHECK)) {
- CPWL_Utils::DrawEditSpellCheck(pDevice, pUser2Device, m_pEdit, rcClip,
- CFX_FloatPoint(0.0f, 0.0f), pRange,
- GetCreationParam().pSpellCheck);
- }
}
FX_BOOL CPWL_Edit::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) {
@@ -536,27 +514,6 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) {
std::vector<CFX_ByteString> sSuggestWords;
CFX_FloatPoint ptPopup = point;
- if (!IsReadOnly()) {
- if (HasFlag(PES_SPELLCHECK) && !swLatin.IsEmpty()) {
- if (m_pSpellCheck) {
- CFX_ByteString sLatin = CFX_ByteString::FromUnicode(swLatin);
- if (!m_pSpellCheck->CheckWord(sLatin)) {
- m_pSpellCheck->SuggestWords(sLatin, sSuggestWords);
-
- int32_t nSuggest = pdfium::CollectionSize<int32_t>(sSuggestWords);
- for (int32_t nWord = 0; nWord < nSuggest; nWord++) {
- pSH->AppendMenuItem(hPopup, WM_PWLEDIT_SUGGEST + nWord,
- sSuggestWords[nWord].UTF8Decode());
- }
- if (nSuggest > 0)
- pSH->AppendMenuItem(hPopup, 0, L"");
-
- ptPopup = GetWordRightBottomPoint(wrLatin.EndPos);
- }
- }
- }
- }
-
IPWL_Provider* pProvider = GetProvider();
if (HasFlag(PES_UNDO)) {
@@ -864,13 +821,6 @@ FX_BOOL CPWL_Edit::IsVScrollBarVisible() const {
return FALSE;
}
-void CPWL_Edit::EnableSpellCheck(FX_BOOL bEnabled) {
- if (bEnabled)
- AddFlag(PES_SPELLCHECK);
- else
- RemoveFlag(PES_SPELLCHECK);
-}
-
FX_BOOL CPWL_Edit::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
if (m_bMouseDown)
return TRUE;