diff options
author | dsinclair <dsinclair@chromium.org> | 2016-07-18 10:04:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-18 10:04:07 -0700 |
commit | efd5a99f98a263da9de52059681ff6ed27b2567c (patch) | |
tree | 83abdb823c7b2941f4891f4f27986576c740ab7b /fpdfsdk/fxedit | |
parent | d8f397878b5cd83ba4b75b3e69331986357301b9 (diff) | |
download | pdfium-efd5a99f98a263da9de52059681ff6ed27b2567c.tar.xz |
Removing default params from CFX_Edit.
This CL removes all of the default params from CFX_Edit. They are either
moved to the callsite or removed completely if unused.
Review-Url: https://codereview.chromium.org/2152473002
Diffstat (limited to 'fpdfsdk/fxedit')
-rw-r--r-- | fpdfsdk/fxedit/fxet_edit.cpp | 200 | ||||
-rw-r--r-- | fpdfsdk/fxedit/fxet_list.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fxedit/include/fxet_edit.h | 82 |
3 files changed, 77 insertions, 207 deletions
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index 603c459cf7..123106b8a2 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -702,8 +702,7 @@ void CFXEU_Clear::Undo() { if (m_pEdit) { m_pEdit->SelectNone(); m_pEdit->SetCaret(m_wrSel.BeginPos); - m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, nullptr, nullptr, - FALSE, TRUE); + m_pEdit->InsertText(m_swText.c_str(), DEFAULT_CHARSET, FALSE, TRUE); m_pEdit->SetSel(m_wrSel.BeginPos, m_wrSel.EndPos); } } @@ -712,21 +711,12 @@ CFXEU_InsertText::CFXEU_InsertText(CFX_Edit* pEdit, const CPVT_WordPlace& wpOldPlace, const CPVT_WordPlace& wpNewPlace, const CFX_WideString& swText, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps) + int32_t charset) : m_pEdit(pEdit), m_wpOld(wpOldPlace), m_wpNew(wpNewPlace), m_swText(swText), - m_nCharset(charset), - m_SecProps(), - m_WordProps() { - if (pSecProps) - m_SecProps = *pSecProps; - if (pWordProps) - m_WordProps = *pWordProps; -} + m_nCharset(charset) {} CFXEU_InsertText::~CFXEU_InsertText() {} @@ -734,8 +724,7 @@ void CFXEU_InsertText::Redo() { if (m_pEdit && IsLast()) { m_pEdit->SelectNone(); m_pEdit->SetCaret(m_wpOld); - m_pEdit->InsertText(m_swText.c_str(), m_nCharset, &m_SecProps, &m_WordProps, - FALSE, TRUE); + m_pEdit->InsertText(m_swText.c_str(), m_nCharset, FALSE, TRUE); } } @@ -1436,11 +1425,10 @@ IPVT_FontMap* CFX_Edit::GetFontMap() { return m_pVTProvider ? m_pVTProvider->GetFontMap() : nullptr; } -void CFX_Edit::SetPlateRect(const CFX_FloatRect& rect, FX_BOOL bPaint) { +void CFX_Edit::SetPlateRect(const CFX_FloatRect& rect) { m_pVT->SetPlateRect(rect); m_ptScrollPos = CFX_FloatPoint(rect.left, rect.top); - if (bPaint) - Paint(); + Paint(); } void CFX_Edit::SetAlignmentH(int32_t nFormat, FX_BOOL bPaint) { @@ -1461,28 +1449,19 @@ void CFX_Edit::SetPasswordChar(uint16_t wSubWord, FX_BOOL bPaint) { Paint(); } -void CFX_Edit::SetLimitChar(int32_t nLimitChar, FX_BOOL bPaint) { +void CFX_Edit::SetLimitChar(int32_t nLimitChar) { m_pVT->SetLimitChar(nLimitChar); - if (bPaint) - Paint(); + Paint(); } -void CFX_Edit::SetCharArray(int32_t nCharArray, FX_BOOL bPaint) { +void CFX_Edit::SetCharArray(int32_t nCharArray) { m_pVT->SetCharArray(nCharArray); - if (bPaint) - Paint(); + Paint(); } -void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace, FX_BOOL bPaint) { +void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace) { m_pVT->SetCharSpace(fCharSpace); - if (bPaint) - Paint(); -} - -void CFX_Edit::SetHorzScale(int32_t nHorzScale, FX_BOOL bPaint) { - m_pVT->SetHorzScale(nHorzScale); - if (bPaint) - Paint(); + Paint(); } void CFX_Edit::SetMultiLine(FX_BOOL bMultiLine, FX_BOOL bPaint) { @@ -1497,22 +1476,15 @@ void CFX_Edit::SetAutoReturn(FX_BOOL bAuto, FX_BOOL bPaint) { Paint(); } -void CFX_Edit::SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint) { - m_pVT->SetLineLeading(fLineLeading); - if (bPaint) - Paint(); -} - 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) { +void CFX_Edit::SetFontSize(FX_FLOAT fFontSize) { m_pVT->SetFontSize(fFontSize); - if (bPaint) - Paint(); + Paint(); } void CFX_Edit::SetAutoScroll(FX_BOOL bAuto, FX_BOOL bPaint) { @@ -1555,8 +1527,7 @@ void CFX_Edit::SetSel(const CPVT_WordPlace& begin, const CPVT_WordPlace& end) { if (m_SelState.IsExist()) { ScrollToCaret(); - CPVT_WordRange wr(m_SelState.BeginPos, m_SelState.EndPos); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretInfo(); } else { ScrollToCaret(); @@ -1695,22 +1666,18 @@ CPVT_WordRange CFX_Edit::CombineWordRange(const CPVT_WordRange& wr1, return wrRet; } -void CFX_Edit::SetText(const FX_WCHAR* text, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps) { - SetText(text, charset, pSecProps, pWordProps, TRUE, TRUE); +void CFX_Edit::SetText(const FX_WCHAR* text) { + Empty(); + DoInsertText(CPVT_WordPlace(0, 0, -1), text, DEFAULT_CHARSET); + Paint(); } -FX_BOOL CFX_Edit::InsertWord(uint16_t word, - int32_t charset, - const CPVT_WordProps* pWordProps) { - return InsertWord(word, charset, pWordProps, TRUE, TRUE); +FX_BOOL CFX_Edit::InsertWord(uint16_t word, int32_t charset) { + return InsertWord(word, charset, nullptr, TRUE, TRUE); } -FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps) { - return InsertReturn(pSecProps, pWordProps, TRUE, TRUE); +FX_BOOL CFX_Edit::InsertReturn() { + return InsertReturn(nullptr, nullptr, TRUE, TRUE); } FX_BOOL CFX_Edit::Backspace() { @@ -1725,11 +1692,8 @@ FX_BOOL CFX_Edit::Clear() { return Clear(TRUE, TRUE); } -FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps) { - return InsertText(text, charset, pSecProps, pWordProps, TRUE, TRUE); +FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset) { + return InsertText(text, charset, TRUE, TRUE); } FX_FLOAT CFX_Edit::GetFontSize() const { @@ -1797,7 +1761,7 @@ void CFX_Edit::Paint() { if (m_pVT->IsValid()) { RearrangeAll(); ScrollToCaret(); - Refresh(RP_NOANALYSE); + Refresh(); SetCaretOrigin(); SetCaretInfo(); } @@ -1844,8 +1808,7 @@ void CFX_Edit::SelectAll() { SetCaret(m_SelState.EndPos); ScrollToCaret(); - CPVT_WordRange wrVisible = GetVisibleWordRange(); - Refresh(RP_OPTIONAL, &wrVisible); + Refresh(); SetCaretInfo(); } } @@ -1853,9 +1816,8 @@ void CFX_Edit::SelectAll() { void CFX_Edit::SelectNone() { if (m_pVT->IsValid()) { if (m_SelState.IsExist()) { - CPVT_WordRange wrTemp = m_SelState.ConvertToWordRange(); m_SelState.Default(); - Refresh(RP_OPTIONAL, &wrTemp); + Refresh(); } } } @@ -1948,7 +1910,7 @@ void CFX_Edit::SetScrollPosX(FX_FLOAT fx) { if (m_pVT->IsValid()) { if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.x, fx)) { m_ptScrollPos.x = fx; - Refresh(RP_NOANALYSE); + Refresh(); } } } @@ -1960,7 +1922,7 @@ void CFX_Edit::SetScrollPosY(FX_FLOAT fy) { if (m_pVT->IsValid()) { if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y, fy)) { m_ptScrollPos.y = fy; - Refresh(RP_NOANALYSE); + Refresh(); if (m_pNotify) { if (!m_bNotifyFlag) { @@ -2067,9 +2029,7 @@ void CFX_Edit::ScrollToCaret() { } } -void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan, - const CPVT_WordRange* pRange1, - const CPVT_WordRange* pRange2) { +void CFX_Edit::Refresh() { if (m_bEnableRefresh && m_pVT->IsValid()) { m_Refresh.BeginRefresh(); RefreshPushLineRects(GetVisibleWordRange()); @@ -2289,8 +2249,7 @@ void CFX_Edit::OnMouseMove(const CFX_FloatPoint& point, m_SelState.SetEndPos(m_wpCaret); ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretOrigin(); SetCaretInfo(); } @@ -2309,8 +2268,7 @@ void CFX_Edit::OnVK_UP(FX_BOOL bShift, FX_BOOL bCtrl) { if (m_wpOldCaret != m_wpCaret) { ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretInfo(); } } else { @@ -2334,8 +2292,7 @@ void CFX_Edit::OnVK_DOWN(FX_BOOL bShift, FX_BOOL bCtrl) { if (m_wpOldCaret != m_wpCaret) { ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretInfo(); } } else { @@ -2363,8 +2320,7 @@ void CFX_Edit::OnVK_LEFT(FX_BOOL bShift, FX_BOOL bCtrl) { if (m_wpOldCaret != m_wpCaret) { ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretInfo(); } } else { @@ -2408,8 +2364,7 @@ void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl) { if (m_wpOldCaret != m_wpCaret) { ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretInfo(); } } else { @@ -2451,8 +2406,7 @@ void CFX_Edit::OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl) { m_SelState.Set(m_wpOldCaret, m_wpCaret); ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretInfo(); } else { if (m_SelState.IsExist()) { @@ -2492,8 +2446,7 @@ void CFX_Edit::OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) { m_SelState.Set(m_wpOldCaret, m_wpCaret); ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, m_wpCaret); - Refresh(RP_OPTIONAL, &wr); + Refresh(); SetCaretInfo(); } else { if (m_SelState.IsExist()) { @@ -2519,18 +2472,6 @@ void CFX_Edit::OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl) { } } -void CFX_Edit::SetText(const FX_WCHAR* text, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps, - FX_BOOL bAddUndo, - FX_BOOL bPaint) { - Empty(); - DoInsertText(CPVT_WordPlace(0, 0, -1), text, charset, pSecProps, pWordProps); - if (bPaint) - Paint(); -} - FX_BOOL CFX_Edit::InsertWord(uint16_t word, int32_t charset, const CPVT_WordProps* pWordProps, @@ -2586,8 +2527,7 @@ FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps* pSecProps, if (bPaint) { RearrangePart(CPVT_WordRange(m_wpOldCaret, m_wpCaret)); ScrollToCaret(); - CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos); - Refresh(RP_ANALYSE, &wr); + Refresh(); SetCaretOrigin(); SetCaretInfo(); } @@ -2636,20 +2576,7 @@ FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint) { if (bPaint) { RearrangePart(CPVT_WordRange(m_wpCaret, m_wpOldCaret)); ScrollToCaret(); - - CPVT_WordRange wr; - if (m_wpCaret.SecCmp(m_wpOldCaret) != 0) - wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret), - GetVisibleWordRange().EndPos); - else if (m_wpCaret.LineCmp(m_wpOldCaret) != 0) - wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret), - m_pVT->GetSectionEndPlace(m_wpCaret)); - else - wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret), - m_pVT->GetSectionEndPlace(m_wpCaret)); - - Refresh(RP_ANALYSE, &wr); - + Refresh(); SetCaretOrigin(); SetCaretInfo(); } @@ -2699,20 +2626,7 @@ FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint) { if (bPaint) { RearrangePart(CPVT_WordRange(m_wpOldCaret, m_wpCaret)); ScrollToCaret(); - - CPVT_WordRange wr; - if (bSecEnd) - wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret), - GetVisibleWordRange().EndPos); - else if (m_wpCaret.LineCmp(m_wpOldCaret) != 0) - wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret), - m_pVT->GetSectionEndPlace(m_wpCaret)); - else - wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret), - m_pVT->GetSectionEndPlace(m_wpCaret)); - - Refresh(RP_ANALYSE, &wr); - + Refresh(); SetCaretOrigin(); SetCaretInfo(); } @@ -2756,10 +2670,7 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) { if (bPaint) { RearrangePart(range); ScrollToCaret(); - - CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos); - Refresh(RP_ANALYSE, &wr); - + Refresh(); SetCaretOrigin(); SetCaretInfo(); } @@ -2772,21 +2683,19 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) { FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) { if (IsTextOverflow()) return FALSE; m_pVT->UpdateWordPlace(m_wpCaret); - SetCaret(DoInsertText(m_wpCaret, text, charset, pSecProps, pWordProps)); + SetCaret(DoInsertText(m_wpCaret, text, charset)); m_SelState.Set(m_wpCaret, m_wpCaret); if (m_wpCaret != m_wpOldCaret) { if (bAddUndo && m_bEnableUndo) { - AddEditUndoItem(new CFXEU_InsertText(this, m_wpOldCaret, m_wpCaret, text, - charset, pSecProps, pWordProps)); + AddEditUndoItem( + new CFXEU_InsertText(this, m_wpOldCaret, m_wpCaret, text, charset)); } if (bPaint) @@ -2805,14 +2714,7 @@ void CFX_Edit::PaintInsertText(const CPVT_WordPlace& wpOld, if (m_pVT->IsValid()) { RearrangePart(CPVT_WordRange(wpOld, wpNew)); ScrollToCaret(); - - CPVT_WordRange wr; - if (m_wpCaret.LineCmp(wpOld) != 0) - wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(wpOld), - m_pVT->GetSectionEndPlace(wpNew)); - else - wr = CPVT_WordRange(wpOld, m_pVT->GetSectionEndPlace(wpNew)); - Refresh(RP_ANALYSE, &wr); + Refresh(); SetCaretOrigin(); SetCaretInfo(); } @@ -2978,9 +2880,7 @@ FX_FLOAT CFX_Edit::GetLineBottom(const CPVT_WordPlace& place) const { CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, const FX_WCHAR* text, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps) { + int32_t charset) { CPVT_WordPlace wp = place; if (m_pVT->IsValid()) { @@ -2990,12 +2890,12 @@ CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, uint16_t word = sText[i]; switch (word) { case 0x0D: - wp = m_pVT->InsertSection(wp, pSecProps, pWordProps); + wp = m_pVT->InsertSection(wp, nullptr, nullptr); if (sText[i + 1] == 0x0A) i++; break; case 0x0A: - wp = m_pVT->InsertSection(wp, pSecProps, pWordProps); + wp = m_pVT->InsertSection(wp, nullptr, nullptr); if (sText[i + 1] == 0x0D) i++; break; @@ -3003,7 +2903,7 @@ CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, word = 0x20; default: wp = m_pVT->InsertWord(wp, word, GetCharSetFromUnicode(word, charset), - pWordProps); + nullptr); break; } } diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp index b4d5473f6c..77484e6a8a 100644 --- a/fpdfsdk/fxedit/fxet_list.cpp +++ b/fpdfsdk/fxedit/fxet_list.cpp @@ -14,7 +14,7 @@ CFX_ListItem::CFX_ListItem() : m_pEdit(new CFX_Edit), m_bSelected(FALSE), m_rcListItem(0.0f, 0.0f, 0.0f, 0.0f) { - m_pEdit->SetAlignmentV(1); + m_pEdit->SetAlignmentV(1, TRUE); m_pEdit->Initialize(); } diff --git a/fpdfsdk/fxedit/include/fxet_edit.h b/fpdfsdk/fxedit/include/fxet_edit.h index e6253cb345..bf8828696b 100644 --- a/fpdfsdk/fxedit/include/fxet_edit.h +++ b/fpdfsdk/fxedit/include/fxet_edit.h @@ -30,8 +30,6 @@ class IFX_Edit_UndoItem; #define FX_EDIT_IsFloatSmaller(fa, fb) \ (fa < fb && !FX_EDIT_IsFloatEqual(fa, fb)) -enum REFRESH_PLAN_E { RP_ANALYSE, RP_NOANALYSE, RP_OPTIONAL }; - enum EDIT_PROPS_E { EP_LINELEADING, EP_LINEINDENT, @@ -352,9 +350,7 @@ class CFXEU_InsertText : public CFX_Edit_UndoItem { const CPVT_WordPlace& wpOldPlace, const CPVT_WordPlace& wpNewPlace, const CFX_WideString& swText, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps); + int32_t charset); ~CFXEU_InsertText() override; // CFX_Edit_UndoItem @@ -368,22 +364,19 @@ class CFXEU_InsertText : public CFX_Edit_UndoItem { CPVT_WordPlace m_wpNew; CFX_WideString m_swText; int32_t m_nCharset; - CPVT_SecProps m_SecProps; - CPVT_WordProps m_WordProps; }; class CFX_Edit { public: - static CFX_ByteString GetEditAppearanceStream( - CFX_Edit* pEdit, - const CFX_FloatPoint& ptOffset, - const CPVT_WordRange* pRange = nullptr, - FX_BOOL bContinuous = TRUE, - uint16_t SubWord = 0); + static CFX_ByteString GetEditAppearanceStream(CFX_Edit* pEdit, + const CFX_FloatPoint& ptOffset, + const CPVT_WordRange* pRange, + FX_BOOL bContinuous, + uint16_t SubWord); static CFX_ByteString GetSelectAppearanceStream( CFX_Edit* pEdit, const CFX_FloatPoint& ptOffset, - const CPVT_WordRange* pRange = nullptr); + const CPVT_WordRange* pRange); static void DrawEdit(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, CFX_Edit* pEdit, @@ -440,29 +433,27 @@ class CFX_Edit { void Initialize(); // Set the bounding box of the text area. - void SetPlateRect(const CFX_FloatRect& rect, FX_BOOL bPaint = TRUE); + void SetPlateRect(const CFX_FloatRect& rect); void SetScrollPos(const CFX_FloatPoint& point); // Set the horizontal text alignment. (nFormat [0:left, 1:middle, 2:right]) - void SetAlignmentH(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); + void SetAlignmentH(int32_t nFormat, FX_BOOL bPaint); // Set the vertical text alignment. (nFormat [0:left, 1:middle, 2:right]) - void SetAlignmentV(int32_t nFormat = 0, FX_BOOL bPaint = TRUE); + void SetAlignmentV(int32_t nFormat, FX_BOOL bPaint); // Set the substitution character for hidden text. - void SetPasswordChar(uint16_t wSubWord = '*', FX_BOOL bPaint = TRUE); + void SetPasswordChar(uint16_t wSubWord, FX_BOOL bPaint); // Set the maximum number of words in the text. - void SetLimitChar(int32_t nLimitChar = 0, FX_BOOL bPaint = TRUE); - void SetCharArray(int32_t nCharArray = 0, FX_BOOL bPaint = TRUE); - void SetCharSpace(FX_FLOAT fCharSpace = 0.0f, FX_BOOL bPaint = TRUE); - void SetHorzScale(int32_t nHorzScale = 100, FX_BOOL bPaint = TRUE); - void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); - void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE); - void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); - void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); - void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); - void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE); - void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE); + void SetLimitChar(int32_t nLimitChar); + void SetCharArray(int32_t nCharArray); + void SetCharSpace(FX_FLOAT fCharSpace); + void SetMultiLine(FX_BOOL bMultiLine, FX_BOOL bPaint); + void SetAutoReturn(FX_BOOL bAuto, FX_BOOL bPaint); + void SetAutoFontSize(FX_BOOL bAuto, FX_BOOL bPaint); + void SetAutoScroll(FX_BOOL bAuto, FX_BOOL bPaint); + void SetFontSize(FX_FLOAT fFontSize); + void SetTextOverflow(FX_BOOL bAllowed, FX_BOOL bPaint); FX_BOOL IsRichText() const; void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE); FX_BOOL SetRichFontSize(FX_FLOAT fFontSize); @@ -486,22 +477,13 @@ class CFX_Edit { void OnVK_RIGHT(FX_BOOL bShift, FX_BOOL bCtrl); void OnVK_HOME(FX_BOOL bShift, FX_BOOL bCtrl); void OnVK_END(FX_BOOL bShift, FX_BOOL bCtrl); - void SetText(const FX_WCHAR* text, - int32_t charset = DEFAULT_CHARSET, - const CPVT_SecProps* pSecProps = nullptr, - const CPVT_WordProps* pWordProps = nullptr); - FX_BOOL InsertWord(uint16_t word, - int32_t charset = DEFAULT_CHARSET, - const CPVT_WordProps* pWordProps = nullptr); - FX_BOOL InsertReturn(const CPVT_SecProps* pSecProps = nullptr, - const CPVT_WordProps* pWordProps = nullptr); + void SetText(const FX_WCHAR* text); + FX_BOOL InsertWord(uint16_t word, int32_t charset); + FX_BOOL InsertReturn(); FX_BOOL Backspace(); FX_BOOL Delete(); FX_BOOL Clear(); - FX_BOOL InsertText(const FX_WCHAR* text, - int32_t charset = DEFAULT_CHARSET, - const CPVT_SecProps* pSecProps = nullptr, - const CPVT_WordProps* pWordProps = nullptr); + FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset); FX_BOOL Redo(); FX_BOOL Undo(); int32_t WordPlaceToWordIndex(const CPVT_WordPlace& place) const; @@ -551,9 +533,7 @@ class CFX_Edit { CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, const FX_WCHAR* text, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps); + int32_t charset); int32_t GetCharSetFromUnicode(uint16_t word, int32_t nOldCharset); int32_t GetTotalLines() const; @@ -578,12 +558,6 @@ class CFX_Edit { void SetScrollLimit(); void SetContentChanged(); - void SetText(const FX_WCHAR* text, - int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps, - FX_BOOL bAddUndo, - FX_BOOL bPaint); FX_BOOL InsertWord(uint16_t word, int32_t charset, const CPVT_WordProps* pWordProps, @@ -598,8 +572,6 @@ class CFX_Edit { FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset, - const CPVT_SecProps* pSecProps, - const CPVT_WordProps* pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint); void PaintInsertText(const CPVT_WordPlace& wpOld, @@ -610,9 +582,7 @@ class CFX_Edit { inline CFX_FloatRect VTToEdit(const CFX_FloatRect& rect) const; inline CFX_FloatRect EditToVT(const CFX_FloatRect& rect) const; - void Refresh(REFRESH_PLAN_E ePlan, - const CPVT_WordRange* pRange1 = nullptr, - const CPVT_WordRange* pRange2 = nullptr); + void Refresh(); void RefreshPushLineRects(const CPVT_WordRange& wr); void RefreshPushRandomRects(const CPVT_WordRange& wr); |