diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/fpdfdoc/cpdf_variabletext.cpp | 5 | ||||
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 8 | ||||
-rw-r--r-- | core/fpdfdoc/include/cpdf_variabletext.h | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index 118efa6a10..a8b9c3c778 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -1112,9 +1112,8 @@ int32_t CPDF_VariableText::GetCharWidth(int32_t nFontIndex, int32_t nWordStyle) { if (!m_pVTProvider) return 0; - if (SubWord > 0) - return m_pVTProvider->GetCharWidth(nFontIndex, SubWord, nWordStyle); - return m_pVTProvider->GetCharWidth(nFontIndex, Word, nWordStyle); + uint16_t word = SubWord ? SubWord : Word; + return m_pVTProvider->GetCharWidth(nFontIndex, word, nWordStyle); } int32_t CPDF_VariableText::GetTypeAscent(int32_t nFontIndex) { diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 7fcd90969e..2fc0644bcc 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -504,9 +504,13 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( const CFX_FloatPoint& ptOffset, FX_BOOL bContinuous, uint16_t SubWord) { - CFX_ByteTextBuf sEditStream, sLineStream, sWords; - CFX_FloatPoint ptOld(0.0f, 0.0f), ptNew(0.0f, 0.0f); + CFX_ByteTextBuf sEditStream; + CFX_ByteTextBuf sLineStream; + CFX_ByteTextBuf sWords; + CFX_FloatPoint ptOld(0.0f, 0.0f); + CFX_FloatPoint ptNew(0.0f, 0.0f); int32_t nCurFontIndex = -1; + pIterator->SetAt(0); CPVT_WordPlace oldplace; diff --git a/core/fpdfdoc/include/cpdf_variabletext.h b/core/fpdfdoc/include/cpdf_variabletext.h index 30bff84811..faa5036469 100644 --- a/core/fpdfdoc/include/cpdf_variabletext.h +++ b/core/fpdfdoc/include/cpdf_variabletext.h @@ -77,7 +77,7 @@ class CPDF_VariableText : private CPDF_EditContainer { virtual int32_t GetDefaultFontIndex(); private: - IPVT_FontMap* m_pFontMap; + IPVT_FontMap* const m_pFontMap; }; CPDF_VariableText(); |