diff options
-rw-r--r-- | core/fpdfdoc/cpdf_variabletext.cpp | 49 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_variabletext.h | 6 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit_impl.cpp | 10 |
4 files changed, 8 insertions, 59 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index 82a8d6757b..74ea239cc6 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -192,9 +192,7 @@ CPDF_VariableText::CPDF_VariableText() m_bInitialized(false), m_pVTProvider(nullptr) {} -CPDF_VariableText::~CPDF_VariableText() { - ResetAll(); -} +CPDF_VariableText::~CPDF_VariableText() {} void CPDF_VariableText::Initialize() { if (m_bInitialized) @@ -215,11 +213,6 @@ void CPDF_VariableText::Initialize() { m_bInitialized = true; } -void CPDF_VariableText::ResetAll() { - m_bInitialized = false; - m_SectionArray.clear(); -} - CPVT_WordPlace CPDF_VariableText::InsertWord(const CPVT_WordPlace& place, uint16_t word, int32_t charset) { @@ -267,42 +260,6 @@ CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace& place) { return result; } -CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace& place, - const wchar_t* text) { - WideString swText = text; - CPVT_WordPlace wp = place; - for (int32_t i = 0, sz = swText.GetLength(); i < sz; i++) { - CPVT_WordPlace oldwp = wp; - uint16_t word = swText[i]; - switch (word) { - case 0x0D: - if (m_bMultiLine) { - if (swText[i + 1] == 0x0A) - i += 1; - - wp = InsertSection(wp); - } - break; - case 0x0A: - if (m_bMultiLine) { - if (swText[i + 1] == 0x0D) - i += 1; - - wp = InsertSection(wp); - } - break; - case 0x09: - word = 0x20; - default: - wp = InsertWord(wp, word, FX_CHARSET_Default); - break; - } - if (wp == oldwp) - break; - } - return wp; -} - CPVT_WordPlace CPDF_VariableText::DeleteWords( const CPVT_WordRange& PlaceRange) { bool bLastSecPos = @@ -1003,10 +960,6 @@ void CPDF_VariableText::SetProvider(CPDF_VariableText::Provider* pProvider) { m_pVTProvider = pProvider; } -CFX_SizeF CPDF_VariableText::GetPlateSize() const { - return CFX_SizeF(GetPlateWidth(), GetPlateHeight()); -} - CFX_PointF CPDF_VariableText::GetBTPoint() const { return CFX_PointF(m_rcPlate.left, m_rcPlate.top); } diff --git a/core/fpdfdoc/cpdf_variabletext.h b/core/fpdfdoc/cpdf_variabletext.h index bdc95d47f9..a37aa871d5 100644 --- a/core/fpdfdoc/cpdf_variabletext.h +++ b/core/fpdfdoc/cpdf_variabletext.h @@ -29,7 +29,6 @@ struct CPVT_WordInfo; class CPDF_VariableText { public: - enum class ScriptType { Normal, Super, Sub }; class Iterator { public: @@ -43,7 +42,7 @@ class CPDF_VariableText { bool GetLine(CPVT_Line& line) const; void SetAt(int32_t nWordIndex); void SetAt(const CPVT_WordPlace& place); - const CPVT_WordPlace& GetAt() const { return m_CurPos; } + const CPVT_WordPlace& GetWordPlace() const { return m_CurPos; } private: CPVT_WordPlace m_CurPos; @@ -94,13 +93,11 @@ class CPDF_VariableText { void RearrangeAll(); void RearrangePart(const CPVT_WordRange& PlaceRange); - void ResetAll(); void SetText(const WideString& text); CPVT_WordPlace InsertWord(const CPVT_WordPlace& place, uint16_t word, int32_t charset); CPVT_WordPlace InsertSection(const CPVT_WordPlace& place); - CPVT_WordPlace InsertText(const CPVT_WordPlace& place, const wchar_t* text); CPVT_WordPlace DeleteWords(const CPVT_WordRange& PlaceRange); CPVT_WordPlace DeleteWord(const CPVT_WordPlace& place); CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place); @@ -139,7 +136,6 @@ class CPDF_VariableText { float GetPlateWidth() const { return m_rcPlate.right - m_rcPlate.left; } float GetPlateHeight() const { return m_rcPlate.top - m_rcPlate.bottom; } - CFX_SizeF GetPlateSize() const; CFX_PointF GetBTPoint() const; CFX_PointF GetETPoint() const; diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index c0f9927229..1b94f7eca4 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -99,7 +99,7 @@ ByteString GenerateEditAP(IPVT_FontMap* pFontMap, pIterator->SetAt(0); while (pIterator->NextWord()) { - CPVT_WordPlace place = pIterator->GetAt(); + CPVT_WordPlace place = pIterator->GetWordPlace(); if (bContinuous) { if (place.LineCmp(oldplace) != 0) { if (sWords.tellp() > 0) { diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp index 7f6d8537d4..1b324dc2fc 100644 --- a/fpdfsdk/pwl/cpwl_edit_impl.cpp +++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp @@ -111,7 +111,7 @@ void CPWL_EditImpl_Iterator::SetAt(const CPVT_WordPlace& place) { } const CPVT_WordPlace& CPWL_EditImpl_Iterator::GetAt() const { - return m_pVTIterator->GetAt(); + return m_pVTIterator->GetWordPlace(); } CPWL_EditImpl_Provider::CPWL_EditImpl_Provider(IPVT_FontMap* pFontMap) @@ -723,9 +723,9 @@ WideString CPWL_EditImpl::GetText() const { pIterator->SetAt(0); CPVT_Word wordinfo; - CPVT_WordPlace oldplace = pIterator->GetAt(); + CPVT_WordPlace oldplace = pIterator->GetWordPlace(); while (pIterator->NextWord()) { - CPVT_WordPlace place = pIterator->GetAt(); + CPVT_WordPlace place = pIterator->GetWordPlace(); if (pIterator->GetWord(wordinfo)) swRet += wordinfo.Word; if (oldplace.nSecIndex != place.nSecIndex) @@ -749,7 +749,7 @@ WideString CPWL_EditImpl::GetRangeText(const CPVT_WordRange& range) const { CPVT_Word wordinfo; CPVT_WordPlace oldplace = wrTemp.BeginPos; while (pIterator->NextWord()) { - CPVT_WordPlace place = pIterator->GetAt(); + CPVT_WordPlace place = pIterator->GetWordPlace(); if (place > wrTemp.EndPos) break; if (pIterator->GetWord(wordinfo)) @@ -1190,7 +1190,7 @@ void CPWL_EditImpl::RefreshWordRange(const CPVT_WordRange& wr) { CPVT_WordPlace place; while (pIterator->NextWord()) { - place = pIterator->GetAt(); + place = pIterator->GetWordPlace(); if (place > wrTemp.EndPos) break; |