summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fxedit
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fxedit')
-rw-r--r--fpdfsdk/src/fxedit/fxet_ap.cpp4
-rw-r--r--fpdfsdk/src/fxedit/fxet_edit.cpp156
-rw-r--r--fpdfsdk/src/fxedit/fxet_list.cpp22
-rw-r--r--fpdfsdk/src/fxedit/fxet_module.cpp5
-rw-r--r--fpdfsdk/src/fxedit/fxet_pageobjs.cpp25
5 files changed, 47 insertions, 165 deletions
diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp
index 4f879c0022..2803b60d72 100644
--- a/fpdfsdk/src/fxedit/fxet_ap.cpp
+++ b/fpdfsdk/src/fxedit/fxet_ap.cpp
@@ -4,9 +4,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "core/include/fpdfapi/fpdf_resource.h"
#include "fpdfsdk/include/fxedit/fx_edit.h"
#include "fpdfsdk/include/fxedit/fxet_edit.h"
-#include "fpdfsdk/include/fxedit/fxet_stub.h"
CFX_ByteString GetPDFWordString(IFX_Edit_FontMap* pFontMap,
int32_t nFontIndex,
@@ -177,7 +177,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(
CFX_ByteString IFX_Edit::GetSelectAppearanceStream(
IFX_Edit* pEdit,
const CPDF_Point& ptOffset,
- const CPVT_WordRange* pRange /*= NULL*/) {
+ const CPVT_WordRange* pRange) {
CFX_ByteTextBuf sRet;
if (pRange && pRange->IsExist()) {
diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp
index b048787cc8..c7abbf44bb 100644
--- a/fpdfsdk/src/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/src/fxedit/fxet_edit.cpp
@@ -5,12 +5,10 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "fpdfsdk/include/fxedit/fxet_edit.h"
-#include "fpdfsdk/include/fxedit/fxet_stub.h"
-#define FX_EDIT_UNDO_MAXITEM 10000
+#include "core/include/fpdfapi/fpdf_resource.h"
-/* ---------------------------- CFX_Edit_Iterator ----------------------------
- */
+#define FX_EDIT_UNDO_MAXITEM 10000
CFX_Edit_Iterator::CFX_Edit_Iterator(CFX_Edit* pEdit,
IPDF_VariableText_Iterator* pVTIterator)
@@ -88,9 +86,6 @@ IFX_Edit* CFX_Edit_Iterator::GetEdit() const {
return m_pEdit;
}
-/* --------------------------- CFX_Edit_Provider -------------------------------
- */
-
CFX_Edit_Provider::CFX_Edit_Provider(IFX_Edit_FontMap* pFontMap)
: m_pFontMap(pFontMap) {
ASSERT(m_pFontMap);
@@ -148,9 +143,6 @@ FX_BOOL CFX_Edit_Provider::IsLatinWord(FX_WORD word) {
return FX_EDIT_ISLATINWORD(word);
}
-/* --------------------------------- CFX_Edit_Refresh
- * --------------------------------- */
-
CFX_Edit_Refresh::CFX_Edit_Refresh() {}
CFX_Edit_Refresh::~CFX_Edit_Refresh() {}
@@ -219,9 +211,9 @@ void CFX_Edit_Refresh::Analyse(int32_t nAlignment) {
fWidthDiff =
pNewRect->m_rcLine.Width() - pOldRect->m_rcLine.Width();
rcResult = pNewRect->m_rcLine;
- if (fWidthDiff > 0.0f)
+ if (fWidthDiff > 0.0f) {
rcResult.left = rcResult.right - fWidthDiff;
- else {
+ } else {
rcResult.left = rcResult.right;
rcResult.right += (-fWidthDiff);
}
@@ -233,8 +225,6 @@ void CFX_Edit_Refresh::Analyse(int32_t nAlignment) {
rcResult.Union(pNewRect->m_rcLine);
m_RefreshRects.Add(rcResult);
}
- } else {
- // don't need to do anything
}
}
} else {
@@ -243,8 +233,6 @@ void CFX_Edit_Refresh::Analyse(int32_t nAlignment) {
} else {
if (pNewRect) {
m_RefreshRects.Add(pNewRect->m_rcLine);
- } else {
- // error
}
}
i++;
@@ -263,9 +251,6 @@ void CFX_Edit_Refresh::EndRefresh() {
m_RefreshRects.Empty();
}
-/* ------------------------------------- CFX_Edit_Undo
- * ------------------------------------- */
-
CFX_Edit_Undo::CFX_Edit_Undo(int32_t nBufsize)
: m_nCurUndoPos(0),
m_nBufSize(nBufsize),
@@ -371,9 +356,6 @@ void CFX_Edit_Undo::Reset() {
m_UndoItemStack.RemoveAll();
}
-/* -------------------------------- CFX_Edit_GroupUndoItem
- * -------------------------------- */
-
CFX_Edit_GroupUndoItem::CFX_Edit_GroupUndoItem(const CFX_WideString& sTitle)
: m_sTitle(sTitle) {}
@@ -423,9 +405,6 @@ CFX_WideString CFX_Edit_GroupUndoItem::GetUndoTitle() {
return m_sTitle;
}
-/* ------------------------------------- CFX_Edit_UndoItem derived classes
- * ------------------------------------- */
-
CFXEU_InsertWord::CFXEU_InsertWord(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
@@ -460,8 +439,6 @@ void CFXEU_InsertWord::Undo() {
}
}
-/* -------------------------------------------------------------------------- */
-
CFXEU_InsertReturn::CFXEU_InsertReturn(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
@@ -496,9 +473,6 @@ void CFXEU_InsertReturn::Undo() {
}
}
-/* -------------------------------------------------------------------------- */
-// CFXEU_Backspace
-
CFXEU_Backspace::CFXEU_Backspace(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
@@ -536,9 +510,6 @@ void CFXEU_Backspace::Undo() {
}
}
-/* -------------------------------------------------------------------------- */
-// CFXEU_Delete
-
CFXEU_Delete::CFXEU_Delete(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
@@ -578,9 +549,6 @@ void CFXEU_Delete::Undo() {
}
}
-/* -------------------------------------------------------------------------- */
-// CFXEU_Clear
-
CFXEU_Clear::CFXEU_Clear(CFX_Edit* pEdit,
const CPVT_WordRange& wrSel,
const CFX_WideString& swText)
@@ -606,9 +574,6 @@ void CFXEU_Clear::Undo() {
}
}
-/* -------------------------------------------------------------------------- */
-// CFXEU_ClearRich
-
CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
@@ -652,9 +617,6 @@ void CFXEU_ClearRich::Undo() {
}
}
}
-/* -------------------------------------------------------------------------- */
-// CFXEU_InsertText
-
CFXEU_InsertText::CFXEU_InsertText(CFX_Edit* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
@@ -694,8 +656,6 @@ void CFXEU_InsertText::Undo() {
}
}
-/* -------------------------------------------------------------------------- */
-
CFXEU_SetSecProps::CFXEU_SetSecProps(CFX_Edit* pEdit,
const CPVT_WordPlace& place,
EDIT_PROPS_E ep,
@@ -739,8 +699,6 @@ void CFXEU_SetSecProps::Undo() {
}
}
-/* -------------------------------------------------------------------------- */
-
CFXEU_SetWordProps::CFXEU_SetWordProps(CFX_Edit* pEdit,
const CPVT_WordPlace& place,
EDIT_PROPS_E ep,
@@ -780,9 +738,6 @@ void CFXEU_SetWordProps::Undo() {
}
}
-/* ------------------------------------- CFX_Edit
- * ------------------------------------- */
-
CFX_Edit::CFX_Edit(IPDF_VariableText* pVT)
: m_pVT(pVT),
m_pNotify(NULL),
@@ -817,8 +772,6 @@ CFX_Edit::~CFX_Edit() {
ASSERT(!m_pGroupUndoItem);
}
-// public methods
-
void CFX_Edit::Initialize() {
m_pVT->Initialize();
SetCaret(m_pVT->GetBeginWordPlace());
@@ -860,105 +813,92 @@ IFX_Edit_FontMap* CFX_Edit::GetFontMap() {
return NULL;
}
-void CFX_Edit::SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetPlateRect(const CPDF_Rect& rect, FX_BOOL bPaint) {
m_pVT->SetPlateRect(rect);
m_ptScrollPos = CPDF_Point(rect.left, rect.top);
if (bPaint)
Paint();
}
-void CFX_Edit::SetAlignmentH(int32_t nFormat /* =0 */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetAlignmentH(int32_t nFormat, FX_BOOL bPaint) {
m_pVT->SetAlignment(nFormat);
if (bPaint)
Paint();
}
-void CFX_Edit::SetAlignmentV(int32_t nFormat /* =0 */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetAlignmentV(int32_t nFormat, FX_BOOL bPaint) {
m_nAlignment = nFormat;
if (bPaint)
Paint();
}
-void CFX_Edit::SetPasswordChar(FX_WORD wSubWord /* ='*' */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetPasswordChar(FX_WORD wSubWord, FX_BOOL bPaint) {
m_pVT->SetPasswordChar(wSubWord);
if (bPaint)
Paint();
}
-void CFX_Edit::SetLimitChar(int32_t nLimitChar /* =0 */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetLimitChar(int32_t nLimitChar, FX_BOOL bPaint) {
m_pVT->SetLimitChar(nLimitChar);
if (bPaint)
Paint();
}
-void CFX_Edit::SetCharArray(int32_t nCharArray /* =0 */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetCharArray(int32_t nCharArray, FX_BOOL bPaint) {
m_pVT->SetCharArray(nCharArray);
if (bPaint)
Paint();
}
-void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace /* =0.0f */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint) {
m_pVT->SetCharSpace(fCharSpace);
if (bPaint)
Paint();
}
-void CFX_Edit::SetHorzScale(int32_t nHorzScale /* =100 */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint) {
m_pVT->SetHorzScale(nHorzScale);
if (bPaint)
Paint();
}
-void CFX_Edit::SetMultiLine(FX_BOOL bMultiLine /* =TRUE */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetMultiLine(FX_BOOL bMultiLine, FX_BOOL bPaint) {
m_pVT->SetMultiLine(bMultiLine);
if (bPaint)
Paint();
}
-void CFX_Edit::SetAutoReturn(FX_BOOL bAuto /* =TRUE */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetAutoReturn(FX_BOOL bAuto, FX_BOOL bPaint) {
m_pVT->SetAutoReturn(bAuto);
if (bPaint)
Paint();
}
-void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading /* =TRUE */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint) {
m_pVT->SetLineLeading(fLineLeading);
if (bPaint)
Paint();
}
-void CFX_Edit::SetAutoFontSize(FX_BOOL bAuto /* =TRUE */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetAutoFontSize(FX_BOOL bAuto, FX_BOOL bPaint) {
m_pVT->SetAutoFontSize(bAuto);
if (bPaint)
Paint();
}
-void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint) {
m_pVT->SetFontSize(fFontSize);
if (bPaint)
Paint();
}
-void CFX_Edit::SetAutoScroll(FX_BOOL bAuto /* =TRUE */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetAutoScroll(FX_BOOL bAuto, FX_BOOL bPaint) {
m_bEnableScroll = bAuto;
if (bPaint)
Paint();
}
-void CFX_Edit::SetTextOverflow(FX_BOOL bAllowed /*= FALSE*/,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetTextOverflow(FX_BOOL bAllowed, FX_BOOL bPaint) {
m_bEnableOverflow = bAllowed;
if (bPaint)
Paint();
@@ -1155,8 +1095,7 @@ FX_BOOL CFX_Edit::IsRichText() const {
return m_pVT->IsRichText();
}
-void CFX_Edit::SetRichText(FX_BOOL bRichText /* =TRUE */,
- FX_BOOL bPaint /* = TRUE*/) {
+void CFX_Edit::SetRichText(FX_BOOL bRichText, FX_BOOL bPaint) {
m_pVT->SetRichText(bRichText);
if (bPaint)
Paint();
@@ -1220,7 +1159,7 @@ FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace) {
return SetRichTextProps(EP_CHARSPACE, NULL, &WordProps);
}
-FX_BOOL CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale /*= 100*/) {
+FX_BOOL CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale) {
CPVT_WordProps WordProps;
WordProps.nHorzScale = nHorzScale;
return SetRichTextProps(EP_HORZSCALE, NULL, &WordProps);
@@ -1258,8 +1197,6 @@ FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps,
pIterator->SetAt(wrTemp.BeginPos);
BeginGroupUndo(L"");
- ;
-
bSet = SetSecProps(eProps, wrTemp.BeginPos, pSecProps, pWordProps, wrTemp,
TRUE);
@@ -1645,20 +1582,20 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps,
}
void CFX_Edit::SetText(const FX_WCHAR* text,
- int32_t charset /*= DEFAULT_CHARSET*/,
- const CPVT_SecProps* pSecProps /*= NULL*/,
- const CPVT_WordProps* pWordProps /*= NULL*/) {
+ int32_t charset,
+ const CPVT_SecProps* pSecProps,
+ const CPVT_WordProps* pWordProps) {
SetText(text, charset, pSecProps, pWordProps, TRUE, TRUE);
}
FX_BOOL CFX_Edit::InsertWord(FX_WORD word,
- int32_t charset /*= DEFAULT_CHARSET*/,
- const CPVT_WordProps* pWordProps /*= NULL*/) {
+ int32_t charset,
+ const CPVT_WordProps* pWordProps) {
return InsertWord(word, charset, pWordProps, TRUE, TRUE);
}
-FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps* pSecProps /*= NULL*/,
- const CPVT_WordProps* pWordProps /*= NULL*/) {
+FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps* pSecProps,
+ const CPVT_WordProps* pWordProps) {
return InsertReturn(pSecProps, pWordProps, TRUE, TRUE);
}
@@ -1675,9 +1612,9 @@ FX_BOOL CFX_Edit::Clear() {
}
FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text,
- int32_t charset /*= DEFAULT_CHARSET*/,
- const CPVT_SecProps* pSecProps /*= NULL*/,
- const CPVT_WordProps* pWordProps /*= NULL*/) {
+ int32_t charset,
+ const CPVT_SecProps* pSecProps,
+ const CPVT_WordProps* pWordProps) {
return InsertText(text, charset, pSecProps, pWordProps, TRUE, TRUE);
}
@@ -1709,8 +1646,6 @@ FX_FLOAT CFX_Edit::GetCharSpace() const {
return m_pVT->GetCharSpace();
}
-// inner methods
-
CPVT_WordRange CFX_Edit::GetWholeWordRange() const {
if (m_pVT->IsValid())
return CPVT_WordRange(m_pVT->GetBeginWordPlace(), m_pVT->GetEndWordPlace());
@@ -2033,31 +1968,8 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,
m_Refresh.BeginRefresh();
RefreshPushLineRects(GetVisibleWordRange());
- // if (!FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.x,m_ptScrollPos.x) ||
- // !FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.y,m_ptScrollPos.y))
- // {
m_Refresh.NoAnalyse();
m_ptRefreshScrollPos = m_ptScrollPos;
- // }
- // else
- // {
- // switch (ePlan)
- // {
- // case RP_ANALYSE:
- // m_Refresh.Analyse(m_pVT->GetAlignment());
- //
- // if (pRange1) RefreshPushRandomRects(*pRange1);
- // if (pRange2) RefreshPushRandomRects(*pRange2);
- // break;
- // case RP_NOANALYSE:
- // m_Refresh.NoAnalyse();
- // break;
- // case RP_OPTIONAL:
- // if (pRange1) RefreshPushRandomRects(*pRange1);
- // if (pRange2) RefreshPushRandomRects(*pRange2);
- // break;
- // }
- // }
if (m_bNotify && m_pNotify) {
if (!m_bNotifyFlag) {
@@ -2097,7 +2009,6 @@ void CFX_Edit::RefreshPushLineRects(const CPVT_WordRange& wr) {
m_Refresh.Push(CPVT_WordRange(lineinfo.lineplace, lineinfo.lineEnd),
VTToEdit(rcLine));
-
} while (pIterator->NextLine());
}
}
@@ -2549,7 +2460,6 @@ void CFX_Edit::SetText(const FX_WCHAR* text,
Paint();
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnSetText(m_wpCaret, m_wpOldCaret);
- // if (bAddUndo)
}
FX_BOOL CFX_Edit::InsertWord(FX_WORD word,
@@ -3103,9 +3013,9 @@ void CFX_Edit::EndGroupUndo() {
}
void CFX_Edit::AddEditUndoItem(CFX_Edit_UndoItem* pEditUndoItem) {
- if (m_pGroupUndoItem)
+ if (m_pGroupUndoItem) {
m_pGroupUndoItem->AddUndoItem(pEditUndoItem);
- else {
+ } else {
m_Undo.AddItem(pEditUndoItem);
if (m_bOprNotify && m_pOprNotify)
m_pOprNotify->OnAddUndo(pEditUndoItem);
diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp
index 1ece0ef11a..4e8ae0cb8e 100644
--- a/fpdfsdk/src/fxedit/fxet_list.cpp
+++ b/fpdfsdk/src/fxedit/fxet_list.cpp
@@ -6,10 +6,6 @@
#include "fpdfsdk/include/fxedit/fxet_edit.h"
#include "fpdfsdk/include/fxedit/fxet_list.h"
-#include "fpdfsdk/include/fxedit/fxet_stub.h"
-
-/* ------------------------------- CFX_ListItem
- * ---------------------------------- */
CFX_ListItem::CFX_ListItem()
: m_pEdit(NULL),
@@ -100,9 +96,6 @@ CFX_WideString CFX_ListItem::GetText() const {
return L"";
}
-/* ------------------------------------ CFX_List
- * --------------------------------- */
-
CFX_List::CFX_List()
: m_fFontSize(0.0f), m_pFontMap(NULL), m_bMultiple(FALSE) {}
@@ -308,9 +301,6 @@ CFX_WideString CFX_List::GetItemText(int32_t nIndex) const {
return L"";
}
-/* ------------------------------------ CPLST_Select
- * ---------------------------------- */
-
CPLST_Select::CPLST_Select() {}
CPLST_Select::~CPLST_Select() {
@@ -323,9 +313,9 @@ CPLST_Select::~CPLST_Select() {
void CPLST_Select::Add(int32_t nItemIndex) {
int32_t nIndex = Find(nItemIndex);
- if (nIndex < 0)
+ if (nIndex < 0) {
m_aItems.Add(new CPLST_Select_Item(nItemIndex, 1));
- else {
+ } else {
if (CPLST_Select_Item* pItem = m_aItems.GetAt(nIndex)) {
pItem->nState = 1;
}
@@ -418,9 +408,6 @@ void CPLST_Select::Done() {
}
}
-/* ------------------------------------ CFX_ListCtrl
- * --------------------------------- */
-
CFX_ListCtrl::CFX_ListCtrl()
: m_pNotify(NULL),
m_bNotifyFlag(FALSE),
@@ -591,8 +578,6 @@ FX_BOOL CFX_ListCtrl::OnChar(FX_WORD nChar, FX_BOOL bShift, FX_BOOL bCtrl) {
return FALSE;
}
-/* -------- inner methods ------- */
-
void CFX_ListCtrl::SetPlateRect(const CPDF_Rect& rect) {
CFX_ListContainer::SetPlateRect(rect);
m_ptScrollPos.x = rect.left;
@@ -710,8 +695,9 @@ void CFX_ListCtrl::Select(int32_t nItemIndex) {
if (IsMultipleSel()) {
m_aSelItems.Add(nItemIndex);
SelectItems();
- } else
+ } else {
SetSingleSelect(nItemIndex);
+ }
}
FX_BOOL CFX_ListCtrl::IsItemVisible(int32_t nItemIndex) const {
diff --git a/fpdfsdk/src/fxedit/fxet_module.cpp b/fpdfsdk/src/fxedit/fxet_module.cpp
index 553cf3a62f..889b0f81a6 100644
--- a/fpdfsdk/src/fxedit/fxet_module.cpp
+++ b/fpdfsdk/src/fxedit/fxet_module.cpp
@@ -6,9 +6,6 @@
#include "fpdfsdk/include/fxedit/fxet_edit.h"
#include "fpdfsdk/include/fxedit/fxet_list.h"
-#include "fpdfsdk/include/fxedit/fxet_stub.h"
-
-/* ---------------------- IFX_Edit ---------------------- */
IFX_Edit* IFX_Edit::NewEdit() {
if (IPDF_VariableText* pVT = IPDF_VariableText::NewVariableText()) {
@@ -24,8 +21,6 @@ void IFX_Edit::DelEdit(IFX_Edit* pEdit) {
delete (CFX_Edit*)pEdit;
}
-/* ---------------------- IFX_List ---------------------- */
-
IFX_List* IFX_List::NewList() {
return new CFX_ListCtrl();
}
diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
index fefa42bdfd..18687679c2 100644
--- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
+++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp
@@ -4,9 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "core/include/fpdfapi/fpdf_pageobj.h"
+#include "core/include/fpdfapi/fpdf_render.h"
+#include "fpdfsdk/include/fx_systemhandler.h"
#include "fpdfsdk/include/fxedit/fx_edit.h"
#include "fpdfsdk/include/fxedit/fxet_edit.h"
-#include "fpdfsdk/include/fxedit/fxet_stub.h"
#define FX_EDIT_UNDERLINEHALFWIDTH 0.5f
#define FX_EDIT_CROSSOUTHALFWIDTH 0.5f
@@ -57,9 +59,10 @@ static void DrawTextString(CFX_RenderDevice* pDevice,
CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize, &mt,
str, crTextFill, crTextStroke, &gsd,
&ro);
- } else
+ } else {
CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize, &mt,
str, crTextFill, 0, NULL, &ro);
+ }
} else {
CPDF_RenderOptions ro;
ro.m_Flags = RENDER_CLEARTYPE;
@@ -76,10 +79,11 @@ static void DrawTextString(CFX_RenderDevice* pDevice,
CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize,
pUser2Device, str, crTextFill,
crTextStroke, &gsd, &ro);
- } else
+ } else {
CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize,
pUser2Device, str, crTextFill, 0,
NULL, &ro);
+ }
}
}
}
@@ -218,8 +222,6 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
word.ptWord.x + word.fWidth,
line.ptLine.y + line.fLineAscent);
rc.Intersect(rcClip);
- // CFX_Edit* pEt = (CFX_Edit*)pEdit;
- // CPDF_Rect rcEdit = pEt->VTToEdit(rc);
pSystemHandler->OutputSelectedRect(pFFLData, rc);
} else {
CFX_PathData pathSelBK;
@@ -282,7 +284,6 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice,
const CPDF_Rect& rcClip,
const CPDF_Point& ptOffset,
const CPVT_WordRange* pRange) {
- // FX_FLOAT fFontSize = pEdit->GetFontSize();
CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
FX_COLORREF crCurText = ArgbEncode(255, 0, 0, 0);
@@ -588,17 +589,7 @@ void IFX_Edit::GenerateRichPageObjects(
sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex,
word.Word, 0);
- if (word.WordProps.nWordStyle &
- PVTWORD_STYLE_UNDERLINE) { /*
- AddLineToPageObjects(pPageObjects,
- crCurText,
- CPDF_Point(word.ptWord.x,
- word.ptWord.y + word.fDescent *
- 0.4f),
- CPDF_Point(word.ptWord.x
- + word.fWidth, word.ptWord.y +
- word.fDescent * 0.4f));
-*/
+ if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) {
CPDF_Rect rcUnderline = GetUnderLineRect(word);
rcUnderline.left += ptOffset.x;
rcUnderline.right += ptOffset.x;