Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Unified Diff: fpdfsdk/src/pdfwindow/PWL_Edit.cpp

Issue 1701883004: Banish CFX_ByteStringArray and CFX_WideStringArray to the XFA side. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/javascript/PublicMethods.cpp ('k') | xfa/include/fwl/basewidget/fwl_edit.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/pdfwindow/PWL_Edit.cpp
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 057cb4191ef13dcd5360843975589f6107c7b716..4b3886a11d36571c2a4a37f4cbf4861d4419d941 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"");
« no previous file with comments | « fpdfsdk/src/javascript/PublicMethods.cpp ('k') | xfa/include/fwl/basewidget/fwl_edit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698