summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/pdfwindow')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Edit.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 057cb4191e..4b3886a11d 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -15,6 +15,7 @@
#include "fpdfsdk/include/pdfwindow/PWL_Utils.h"
#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h"
#include "public/fpdf_fwlevent.h"
+#include "third_party/base/stl_util.h"
CPWL_Edit::CPWL_Edit()
: m_pFillerNotify(NULL), m_pSpellCheck(NULL), m_bFocus(FALSE) {
@@ -519,24 +520,21 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag) {
if (!hPopup)
return FALSE;
- CFX_ByteStringArray sSuggestWords;
+ std::vector<CFX_ByteString> sSuggestWords;
CPDF_Point 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 = sSuggestWords.GetSize();
-
+ 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"");