diff options
author | dsinclair <dsinclair@chromium.org> | 2016-12-14 13:21:18 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-12-14 13:21:18 -0800 |
commit | aefbe4b52d8f309dbb2d8655d936d4a4b443c76e (patch) | |
tree | e0a9472869961ba71f36bf598249889cd991468d /xfa/fwl | |
parent | 727a304f2ab5b72846186af0e75e6c047de0a13c (diff) | |
download | pdfium-aefbe4b52d8f309dbb2d8655d936d4a4b443c76e.tar.xz |
Remove unused CFWL_Edit flags.
This CL removes the flags from CFWL_Edit which are never set. In turn, the
coresponding text edit engine flags are removed.
Review-Url: https://codereview.chromium.org/2570033003
Diffstat (limited to 'xfa/fwl')
-rw-r--r-- | xfa/fwl/cfwl_edit.cpp | 56 | ||||
-rw-r--r-- | xfa/fwl/cfwl_edit.h | 13 | ||||
-rw-r--r-- | xfa/fwl/fwl_widgetdef.h | 1 |
3 files changed, 15 insertions, 55 deletions
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp index 5cf3f2f006..5cd0c90ac8 100644 --- a/xfa/fwl/cfwl_edit.cpp +++ b/xfa/fwl/cfwl_edit.cpp @@ -373,14 +373,10 @@ bool CFWL_Edit::Paste(const CFX_WideString& wsPaste) { } bool CFWL_Edit::Redo(const IFDE_TxtEdtDoRecord* pRecord) { - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo) - return true; return m_EdtEngine.Redo(pRecord); } bool CFWL_Edit::Undo(const IFDE_TxtEdtDoRecord* pRecord) { - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoRedoUndo) - return true; return m_EdtEngine.Undo(pRecord); } @@ -541,8 +537,7 @@ void CFWL_Edit::DrawContent(CFX_Graphics* pGraphics, mt.Concat(*pMatrix); } - bool bShowSel = (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_NoHideSel) || - (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused); + bool bShowSel = !!(m_pProperties->m_dwStates & FWL_WGTSTATE_Focused); if (bShowSel) { CFWL_Widget* pForm = m_pWidgetMgr->GetSystemFormWidget(this); if (pForm) { @@ -638,18 +633,6 @@ void CFWL_Edit::UpdateEditParams() { params.nHorzScale = 100; params.fPlateWidth = m_rtEngine.width; params.fPlateHeight = m_rtEngine.height; - if (m_pProperties->m_dwStyles & FWL_WGTSTYLE_RTLLayout) - params.dwLayoutStyles |= FDE_TEXTEDITLAYOUT_RTL; - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_VerticalLayout) - params.dwLayoutStyles |= FDE_TEXTEDITLAYOUT_DocVertical; - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_VerticalChars) - params.dwLayoutStyles |= FDE_TEXTEDITLAYOUT_CharVertial; - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ReverseLine) - params.dwLayoutStyles |= FDE_TEXTEDITLAYOUT_LineReserve; - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ArabicShapes) - params.dwLayoutStyles |= FDE_TEXTEDITLAYOUT_ArabicShapes; - if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_ExpandTab) - params.dwLayoutStyles |= FDE_TEXTEDITLAYOUT_ExpandTab; if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_CombText) params.dwLayoutStyles |= FDE_TEXTEDITLAYOUT_CombText; if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_LastLineHeight) @@ -680,10 +663,6 @@ void CFWL_Edit::UpdateEditParams() { params.dwAlignment |= FDE_TEXTEDITALIGN_Justified; break; } - case FWL_STYLEEXT_EDT_Distributed: { - params.dwAlignment |= FDE_TEXTEDITALIGN_Distributed; - break; - } default: { params.dwAlignment |= FDE_TEXTEDITALIGN_Normal; break; @@ -1239,17 +1218,9 @@ bool CFWL_Edit::ValidateNumberChar(FX_WCHAR cNum) { } void CFWL_Edit::InitCaret() { - if (!m_pCaret) { - if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_InnerCaret)) { - m_pCaret = pdfium::MakeUnique<CFWL_Caret>( - m_pOwnerApp, pdfium::MakeUnique<CFWL_WidgetProperties>(), this); - m_pCaret->SetParent(this); - m_pCaret->SetStates(m_pProperties->m_dwStates); - } - } else if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_EDT_InnerCaret) == - 0) { - m_pCaret.reset(); - } + if (!m_pCaret) + return; + m_pCaret.reset(); } void CFWL_Edit::ClearRecord() { @@ -1352,8 +1323,7 @@ void CFWL_Edit::DoButtonDown(CFWL_MessageMouse* pMsg) { } void CFWL_Edit::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { - uint32_t dwStyleEx = GetStylesEx(); - bool bRepaint = !!(dwStyleEx & FWL_STYLEEXT_EDT_InnerCaret); + bool bRepaint = false; if (bSet) { m_pProperties->m_dwStates |= FWL_WGTSTATE_Focused; @@ -1363,15 +1333,15 @@ void CFWL_Edit::OnFocusChanged(CFWL_Message* pMsg, bool bSet) { } else if (m_pProperties->m_dwStates & FWL_WGTSTATE_Focused) { m_pProperties->m_dwStates &= ~FWL_WGTSTATE_Focused; HideCaret(nullptr); - if ((dwStyleEx & FWL_STYLEEXT_EDT_NoHideSel) == 0) { - int32_t nSel = CountSelRanges(); - if (nSel > 0) { - ClearSelections(); - bRepaint = true; - } - m_EdtEngine.SetCaretPos(0, true); - UpdateOffset(); + + int32_t nSel = CountSelRanges(); + if (nSel > 0) { + ClearSelections(); + bRepaint = true; } + m_EdtEngine.SetCaretPos(0, true); + UpdateOffset(); + ClearRecord(); } diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h index f975bb2ba4..4193e735f9 100644 --- a/xfa/fwl/cfwl_edit.h +++ b/xfa/fwl/cfwl_edit.h @@ -21,31 +21,22 @@ #define FWL_STYLEEXT_EDT_ReadOnly (1L << 0) #define FWL_STYLEEXT_EDT_MultiLine (1L << 1) #define FWL_STYLEEXT_EDT_WantReturn (1L << 2) -#define FWL_STYLEEXT_EDT_NoHideSel (1L << 3) #define FWL_STYLEEXT_EDT_AutoHScroll (1L << 4) #define FWL_STYLEEXT_EDT_AutoVScroll (1L << 5) -#define FWL_STYLEEXT_EDT_NoRedoUndo (1L << 6) #define FWL_STYLEEXT_EDT_Validate (1L << 7) #define FWL_STYLEEXT_EDT_Password (1L << 8) #define FWL_STYLEEXT_EDT_Number (1L << 9) -#define FWL_STYLEEXT_EDT_VerticalLayout (1L << 12) -#define FWL_STYLEEXT_EDT_VerticalChars (1L << 13) -#define FWL_STYLEEXT_EDT_ReverseLine (1L << 14) -#define FWL_STYLEEXT_EDT_ArabicShapes (1L << 15) -#define FWL_STYLEEXT_EDT_ExpandTab (1L << 16) #define FWL_STYLEEXT_EDT_CombText (1L << 17) -#define FWL_STYLEEXT_EDT_HNear (0L << 18) +#define FWL_STYLEEXT_EDT_HNear 0 #define FWL_STYLEEXT_EDT_HCenter (1L << 18) #define FWL_STYLEEXT_EDT_HFar (2L << 18) -#define FWL_STYLEEXT_EDT_VNear (0L << 20) +#define FWL_STYLEEXT_EDT_VNear 0 #define FWL_STYLEEXT_EDT_VCenter (1L << 20) #define FWL_STYLEEXT_EDT_VFar (2L << 20) #define FWL_STYLEEXT_EDT_Justified (1L << 22) -#define FWL_STYLEEXT_EDT_Distributed (2L << 22) #define FWL_STYLEEXT_EDT_HAlignMask (3L << 18) #define FWL_STYLEEXT_EDT_VAlignMask (3L << 20) #define FWL_STYLEEXT_EDT_HAlignModeMask (3L << 22) -#define FWL_STYLEEXT_EDT_InnerCaret (1L << 24) #define FWL_STYLEEXT_EDT_ShowScrollbarFocus (1L << 25) #define FWL_STYLEEXT_EDT_OuterScrollbar (1L << 26) #define FWL_STYLEEXT_EDT_LastLineHeight (1L << 27) diff --git a/xfa/fwl/fwl_widgetdef.h b/xfa/fwl/fwl_widgetdef.h index 20013b0e4c..a11c211abd 100644 --- a/xfa/fwl/fwl_widgetdef.h +++ b/xfa/fwl/fwl_widgetdef.h @@ -24,7 +24,6 @@ #define FWL_WGTSTYLE_VCenterAlignment (1L << 15) #define FWL_WGTSTYLE_BottomAlignment (2L << 15) #define FWL_WGTSTYLE_RTLReading (1L << 17) -#define FWL_WGTSTYLE_RTLLayout (1L << 18) #define FWL_WGTSTYLE_EdgeNone (0L << 19) #define FWL_WGTSTYLE_EdgeFlat (1L << 19) #define FWL_WGTSTYLE_EdgeRaised (2L << 19) |