diff options
-rw-r--r-- | core/fpdfdoc/cpdf_variabletext.cpp | 5 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 11 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.h | 3 | ||||
-rw-r--r-- | core/fpdfdoc/include/cpdf_variabletext.h | 9 | ||||
-rw-r--r-- | fpdfsdk/fxedit/fxet_edit.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/fxedit/fxet_list.cpp | 25 | ||||
-rw-r--r-- | fpdfsdk/fxedit/include/fx_edit.h | 4 | ||||
-rw-r--r-- | fpdfsdk/fxedit/include/fxet_edit.h | 1 | ||||
-rw-r--r-- | fpdfsdk/fxedit/include/fxet_list.h | 14 |
9 files changed, 15 insertions, 61 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index 67887400a4..427cd5d306 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -1153,9 +1153,6 @@ CPDF_VariableText::Iterator* CPDF_VariableText::GetIterator() { return m_pVTIterator; } -CPDF_VariableText::Provider* CPDF_VariableText::SetProvider( - CPDF_VariableText::Provider* pProvider) { - CPDF_VariableText::Provider* pOld = m_pVTProvider; +void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { m_pVTProvider = pProvider; - return pOld; } diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index ec1b9fbf4e..5ec9513e84 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -503,23 +503,16 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( CPDF_VariableText::Iterator* pIterator, const CFX_FloatPoint& ptOffset, FX_BOOL bContinuous, - uint16_t SubWord, - const CPVT_WordRange* pVisible) { + uint16_t SubWord) { CFX_ByteTextBuf sEditStream, sLineStream, sWords; CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); int32_t nCurFontIndex = -1; if (pIterator) { - if (pVisible) - pIterator->SetAt(pVisible->BeginPos); - else - pIterator->SetAt(0); + pIterator->SetAt(0); CPVT_WordPlace oldplace; while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); - if (pVisible && place.WordCmp(pVisible->EndPos) > 0) - break; - if (bContinuous) { if (place.LineCmp(oldplace) != 0) { if (sWords.GetSize() > 0) { diff --git a/core/fpdfdoc/cpvt_generateap.h b/core/fpdfdoc/cpvt_generateap.h index 09c0507941..924de40ed4 100644 --- a/core/fpdfdoc/cpvt_generateap.h +++ b/core/fpdfdoc/cpvt_generateap.h @@ -42,8 +42,7 @@ class CPVT_GenerateAP { CPDF_VariableText::Iterator* pIterator, const CFX_FloatPoint& ptOffset, FX_BOOL bContinuous, - uint16_t SubWord = 0, - const CPVT_WordRange* pVisible = NULL); + uint16_t SubWord); static CFX_ByteString GenerateBorderAP(const CFX_FloatRect& rect, FX_FLOAT fWidth, const CPVT_Color& color, diff --git a/core/fpdfdoc/include/cpdf_variabletext.h b/core/fpdfdoc/include/cpdf_variabletext.h index b73d3df8c1..a14ad52752 100644 --- a/core/fpdfdoc/include/cpdf_variabletext.h +++ b/core/fpdfdoc/include/cpdf_variabletext.h @@ -24,8 +24,8 @@ struct CPVT_SecProps; struct CPVT_Section; struct CPVT_SectionInfo; struct CPVT_Word; -struct CPVT_WordProps; struct CPVT_WordInfo; +struct CPVT_WordProps; #define VARIABLETEXT_HALF 0.5f @@ -60,7 +60,7 @@ class CPDF_VariableText : private CPDF_EditContainer { class Provider { public: - Provider(IPVT_FontMap* pFontMap); + explicit Provider(IPVT_FontMap* pFontMap); virtual ~Provider(); virtual int32_t GetCharWidth(int32_t nFontIndex, @@ -79,10 +79,9 @@ class CPDF_VariableText : private CPDF_EditContainer { }; CPDF_VariableText(); - virtual ~CPDF_VariableText(); + ~CPDF_VariableText() override; - CPDF_VariableText::Provider* SetProvider( - CPDF_VariableText::Provider* pProvider); + void SetProvider(CPDF_VariableText::Provider* pProvider); CPDF_VariableText::Iterator* GetIterator(); // CPDF_EditContainer. diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index f2ff300452..a02a2a0278 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -791,10 +791,6 @@ void CFX_Edit::SetFontMap(IPVT_FontMap* pFontMap) { m_pVT->SetProvider(m_pVTProvide = new CFX_Edit_Provider(pFontMap)); } -void CFX_Edit::SetVTProvider(CPDF_VariableText::Provider* pProvider) { - m_pVT->SetProvider(pProvider); -} - void CFX_Edit::SetNotify(IFX_Edit_Notify* pNotify) { m_pNotify = pNotify; } diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp index af6e8588f6..63465ebe44 100644 --- a/fpdfsdk/fxedit/fxet_list.cpp +++ b/fpdfsdk/fxedit/fxet_list.cpp @@ -12,7 +12,6 @@ CFX_ListItem::CFX_ListItem() : m_pEdit(NULL), m_bSelected(FALSE), - m_bCaret(FALSE), m_rcListItem(0.0f, 0.0f, 0.0f, 0.0f) { m_pEdit = IFX_Edit::NewEdit(); m_pEdit->SetAlignmentV(1); @@ -55,14 +54,6 @@ void CFX_ListItem::SetSelect(FX_BOOL bSelected) { m_bSelected = bSelected; } -FX_BOOL CFX_ListItem::IsCaret() const { - return m_bCaret; -} - -void CFX_ListItem::SetCaret(FX_BOOL bCaret) { - m_bCaret = bCaret; -} - void CFX_ListItem::SetText(const FX_WCHAR* text) { if (m_pEdit) m_pEdit->SetText(text); @@ -257,17 +248,15 @@ CFX_FloatRect CFX_List::GetItemRect(int32_t nIndex) const { CFX_FloatRect rcItem = pListItem->GetRect(); rcItem.left = 0.0f; rcItem.right = GetPlateRect().Width(); - return InnerToOuter(rcItem); + return InnerToOuter(CLST_Rect(rcItem)); } return CFX_FloatRect(); } FX_BOOL CFX_List::IsItemSelected(int32_t nIndex) const { - if (CFX_ListItem* pListItem = m_aListItems.GetAt(nIndex)) { + if (CFX_ListItem* pListItem = m_aListItems.GetAt(nIndex)) return pListItem->IsSelected(); - } - return FALSE; } @@ -277,12 +266,6 @@ void CFX_List::SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected) { } } -void CFX_List::SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret) { - if (CFX_ListItem* pListItem = m_aListItems.GetAt(nItemIndex)) { - pListItem->SetCaret(bCaret); - } -} - void CFX_List::SetMultipleSel(FX_BOOL bMultiple) { m_bMultiple = bMultiple; } @@ -639,10 +622,6 @@ void CFX_ListCtrl::SetCaret(int32_t nItemIndex) { if (nOldIndex != nItemIndex) { m_nCaretIndex = nItemIndex; - - SetItemCaret(nOldIndex, FALSE); - SetItemCaret(nItemIndex, TRUE); - InvalidateItem(nOldIndex); InvalidateItem(nItemIndex); } diff --git a/fpdfsdk/fxedit/include/fx_edit.h b/fpdfsdk/fxedit/include/fx_edit.h index a00d1d41a7..5f0283f06f 100644 --- a/fpdfsdk/fxedit/include/fx_edit.h +++ b/fpdfsdk/fxedit/include/fx_edit.h @@ -169,10 +169,6 @@ class IFX_Edit { // set a IPVT_FontMap pointer implemented by user. virtual void SetFontMap(IPVT_FontMap* pFontMap) = 0; - // if user don't like to use FontMap, implement VTProvider and set it - // directly. - virtual void SetVTProvider(CPDF_VariableText::Provider* pProvider) = 0; - // set a IFX_Edit_Notify pointer implemented by user. virtual void SetNotify(IFX_Edit_Notify* pNotify) = 0; virtual void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) = 0; diff --git a/fpdfsdk/fxedit/include/fxet_edit.h b/fpdfsdk/fxedit/include/fxet_edit.h index 4233b1d301..738210a997 100644 --- a/fpdfsdk/fxedit/include/fxet_edit.h +++ b/fpdfsdk/fxedit/include/fxet_edit.h @@ -516,7 +516,6 @@ class CFX_Edit : public IFX_Edit { // IFX_Edit void SetFontMap(IPVT_FontMap* pFontMap) override; - void SetVTProvider(CPDF_VariableText::Provider* pProvider) override; void SetNotify(IFX_Edit_Notify* pNotify) override; void SetOprNotify(IFX_Edit_OprNotify* pOprNotify) override; IFX_Edit_Iterator* GetIterator() override; diff --git a/fpdfsdk/fxedit/include/fxet_list.h b/fpdfsdk/fxedit/include/fxet_list.h index 1f855b7747..58aa94c5b6 100644 --- a/fpdfsdk/fxedit/include/fxet_list.h +++ b/fpdfsdk/fxedit/include/fxet_list.h @@ -46,7 +46,7 @@ class CLST_Rect : public CFX_FloatRect { bottom = other_bottom; } - CLST_Rect(const CFX_FloatRect& rect) { + explicit CLST_Rect(const CFX_FloatRect& rect) { left = rect.left; top = rect.top; right = rect.right; @@ -113,33 +113,30 @@ class CLST_Rect : public CFX_FloatRect { } }; -class CFX_ListItem { +class CFX_ListItem final { public: CFX_ListItem(); - virtual ~CFX_ListItem(); + ~CFX_ListItem(); void SetFontMap(IPVT_FontMap* pFontMap); - IFX_Edit_Iterator* GetIterator() const; IFX_Edit* GetEdit() const; - public: void SetRect(const CLST_Rect& rect); void SetSelect(FX_BOOL bSelected); - void SetCaret(FX_BOOL bCaret); void SetText(const FX_WCHAR* text); void SetFontSize(FX_FLOAT fFontSize); CFX_WideString GetText() const; CLST_Rect GetRect() const; FX_BOOL IsSelected() const; - FX_BOOL IsCaret() const; FX_FLOAT GetItemHeight() const; uint16_t GetFirstChar() const; private: + IFX_Edit_Iterator* GetIterator() const; + IFX_Edit* m_pEdit; FX_BOOL m_bSelected; - FX_BOOL m_bCaret; CLST_Rect m_rcListItem; }; @@ -233,7 +230,6 @@ class CFX_List : protected CFX_ListContainer, public IFX_List { virtual void ReArrange(int32_t nItemIndex); CFX_WideString GetItemText(int32_t nIndex) const; void SetItemSelect(int32_t nItemIndex, FX_BOOL bSelected); - void SetItemCaret(int32_t nItemIndex, FX_BOOL bCaret); int32_t GetLastSelected() const; FX_WCHAR Toupper(FX_WCHAR c) const; |