summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-05 16:46:58 -0800
committerLei Zhang <thestig@chromium.org>2016-01-05 16:46:58 -0800
commitc2fb35f2bbcf6c8fcf37380000544ae39d9a8cec (patch)
tree6b8da05d1624cbbe5a0c7042c9820f02180f442c /fpdfsdk/src/pdfwindow/PWL_Edit.cpp
parent62664cee15230d6cbe08ed010721a4557b36dc22 (diff)
downloadpdfium-c2fb35f2bbcf6c8fcf37380000544ae39d9a8cec.tar.xz
Merge to XFA: Remove header files that only have includes.
Also do some cleanups in affected files. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1552583002 . (cherry picked from commit d794d34b5deb6ad691c19af758090f9ce46015a3) Review URL: https://codereview.chromium.org/1566583002 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_Edit.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Edit.cpp49
1 files changed, 22 insertions, 27 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index 6d32b7270f..8ddb7dfb6e 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -4,18 +4,17 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "fpdfsdk/include/pdfwindow/PWL_Edit.h"
+
#include "core/include/fxcrt/fx_safe_types.h"
#include "core/include/fxcrt/fx_xml.h"
-#include "fpdfsdk/include/pdfwindow/PDFWindow.h"
#include "fpdfsdk/include/pdfwindow/PWL_Caret.h"
-#include "fpdfsdk/include/pdfwindow/PWL_Edit.h"
#include "fpdfsdk/include/pdfwindow/PWL_EditCtrl.h"
#include "fpdfsdk/include/pdfwindow/PWL_FontMap.h"
#include "fpdfsdk/include/pdfwindow/PWL_ScrollBar.h"
#include "fpdfsdk/include/pdfwindow/PWL_Utils.h"
#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h"
-
-/* ---------------------------- CPWL_Edit ------------------------------ */
+#include "public/fpdf_fwlevent.h"
CPWL_Edit::CPWL_Edit()
: m_pFillerNotify(NULL), m_pSpellCheck(NULL), m_bFocus(FALSE) {
@@ -101,12 +100,12 @@ CPDF_Rect CPWL_Edit::GetClientRect() const {
}
void CPWL_Edit::SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat,
- FX_BOOL bPaint /* = TRUE*/) {
+ FX_BOOL bPaint) {
m_pEdit->SetAlignmentH((int32_t)nFormat, bPaint);
}
void CPWL_Edit::SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat,
- FX_BOOL bPaint /* = TRUE*/) {
+ FX_BOOL bPaint) {
m_pEdit->SetAlignmentV((int32_t)nFormat, bPaint);
}
@@ -1126,43 +1125,39 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace& place,
if (bLatin) {
while (pIterator->NextWord()) {
- if (pIterator->GetWord(wordinfo) &&
- FX_EDIT_ISLATINWORD(wordinfo.Word)) {
- wpEnd = pIterator->GetAt();
- continue;
- } else
+ if (!pIterator->GetWord(wordinfo) ||
+ !FX_EDIT_ISLATINWORD(wordinfo.Word)) {
break;
- };
+ }
+
+ wpEnd = pIterator->GetAt();
+ }
} else if (bArabic) {
while (pIterator->NextWord()) {
- if (pIterator->GetWord(wordinfo) && PWL_ISARABICWORD(wordinfo.Word)) {
- wpEnd = pIterator->GetAt();
- continue;
- } else
+ if (!pIterator->GetWord(wordinfo) || !PWL_ISARABICWORD(wordinfo.Word))
break;
- };
+
+ wpEnd = pIterator->GetAt();
+ }
}
pIterator->SetAt(place);
if (bLatin) {
do {
- if (pIterator->GetWord(wordinfo) &&
- FX_EDIT_ISLATINWORD(wordinfo.Word)) {
- continue;
- } else {
- wpStart = pIterator->GetAt();
+ if (!pIterator->GetWord(wordinfo) ||
+ !FX_EDIT_ISLATINWORD(wordinfo.Word)) {
break;
}
+
+ wpStart = pIterator->GetAt();
} while (pIterator->PrevWord());
} else if (bArabic) {
do {
- if (pIterator->GetWord(wordinfo) && PWL_ISARABICWORD(wordinfo.Word)) {
- continue;
- } else {
- wpStart = pIterator->GetAt();
+ if (!pIterator->GetWord(wordinfo) || !PWL_ISARABICWORD(wordinfo.Word))
break;
- }
+
+ wpStart = pIterator->GetAt();
} while (pIterator->PrevWord());
}