diff options
author | thestig <thestig@chromium.org> | 2016-05-11 12:59:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-11 12:59:42 -0700 |
commit | cac1571474399a6b0271dde998970544543c921f (patch) | |
tree | 3227520be91865abb831c482e4795c87ab583fde /core/fpdfdoc/cpdf_variabletext.cpp | |
parent | 821d59e1d66b67af970c59b7681828b1b82858b6 (diff) | |
download | pdfium-cac1571474399a6b0271dde998970544543c921f.tar.xz |
Remove CPVT_Size and CPVT_FloatRange.chromium/2734
- CPVT_Size is the same as CFX_SizeF
- CPVT_FloatRange is unused.
Review-Url: https://codereview.chromium.org/1961333002
Diffstat (limited to 'core/fpdfdoc/cpdf_variabletext.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_variabletext.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index 3c71ed8786..118efa6a10 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -4,10 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include "core/fpdfdoc/include/cpdf_variabletext.h" + #include "core/fpdfapi/fpdf_font/include/cpdf_font.h" #include "core/fpdfdoc/cpvt_wordinfo.h" #include "core/fpdfdoc/csection.h" -#include "core/fpdfdoc/include/cpdf_variabletext.h" #include "core/fpdfdoc/include/cpvt_section.h" #include "core/fpdfdoc/include/cpvt_word.h" #include "core/fpdfdoc/include/ipvt_fontmap.h" @@ -70,11 +71,8 @@ int32_t CPDF_VariableText::Provider::GetWordFontIndex(uint16_t word, } FX_BOOL CPDF_VariableText::Provider::IsLatinWord(uint16_t word) { - if ((word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) || - word == 0x2D || word == 0x27) { - return TRUE; - } - return FALSE; + return (word >= 0x61 && word <= 0x7A) || (word >= 0x41 && word <= 0x5A) || + word == 0x2D || word == 0x27; } int32_t CPDF_VariableText::Provider::GetDefaultFontIndex() { @@ -1051,22 +1049,20 @@ FX_FLOAT CPDF_VariableText::GetAutoFontSize() { return (FX_FLOAT)gFontSizeSteps[nMid]; } -FX_BOOL CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) { - FX_BOOL bBigger = FALSE; - CPVT_Size szTotal; +bool CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) const { + CFX_SizeF szTotal; for (int32_t s = 0, sz = m_SectionArray.GetSize(); s < sz; s++) { if (CSection* pSection = m_SectionArray.GetAt(s)) { - CPVT_Size size = pSection->GetSectionSize(fFontSize); + CFX_SizeF size = pSection->GetSectionSize(fFontSize); szTotal.x = std::max(size.x, szTotal.x); szTotal.y += size.y; if (IsFloatBigger(szTotal.x, GetPlateWidth()) || IsFloatBigger(szTotal.y, GetPlateHeight())) { - bBigger = TRUE; - break; + return true; } } } - return bBigger; + return false; } CPVT_FloatRect CPDF_VariableText::RearrangeSections( |