diff options
author | thestig <thestig@chromium.org> | 2016-05-12 21:56:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-12 21:56:43 -0700 |
commit | 594b20b485046c954b68734e63e8d2c93fbe4ef5 (patch) | |
tree | c20f6447c239d49848fea421fd497f23e41edbe3 /core | |
parent | f6d9a61af218b7acc1161ae231b16765ca10b526 (diff) | |
download | pdfium-594b20b485046c954b68734e63e8d2c93fbe4ef5.tar.xz |
Fix some misc nits.
These were left over from after I broke a big "things that never return
NULL" CL up into smaller ones.
Review-Url: https://codereview.chromium.org/1960043003
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(); |