diff options
Diffstat (limited to 'core/fpdfdoc')
32 files changed, 249 insertions, 253 deletions
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index f15d39d89b..a3ee70ab36 100644 --- a/core/fpdfdoc/cpdf_annot.cpp +++ b/core/fpdfdoc/cpdf_annot.cpp @@ -426,7 +426,7 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, } CPDF_Dictionary* pBS = m_pAnnotDict->GetDictFor("BS"); char style_char; - FX_FLOAT width; + float width; CPDF_Array* pDashArray = nullptr; if (!pBS) { CPDF_Array* pBorderArray = m_pAnnotDict->GetArrayFor("Border"); @@ -479,7 +479,7 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, if (dash_count % 2) { dash_count++; } - graph_state.m_DashArray = FX_Alloc(FX_FLOAT, dash_count); + graph_state.m_DashArray = FX_Alloc(float, dash_count); graph_state.m_DashCount = dash_count; size_t i; for (i = 0; i < pDashArray->GetCount(); ++i) { @@ -489,7 +489,7 @@ void CPDF_Annot::DrawBorder(CFX_RenderDevice* pDevice, graph_state.m_DashArray[i] = graph_state.m_DashArray[i - 1]; } } else { - graph_state.m_DashArray = FX_Alloc(FX_FLOAT, 2); + graph_state.m_DashArray = FX_Alloc(float, 2); graph_state.m_DashCount = 2; graph_state.m_DashArray[0] = graph_state.m_DashArray[1] = 3 * 1.0f; } diff --git a/core/fpdfdoc/cpdf_apsettings.cpp b/core/fpdfdoc/cpdf_apsettings.cpp index 9fc9c1aa06..4c44f5a13e 100644 --- a/core/fpdfdoc/cpdf_apsettings.cpp +++ b/core/fpdfdoc/cpdf_apsettings.cpp @@ -36,33 +36,32 @@ FX_ARGB CPDF_ApSettings::GetColor(int& iColorType, size_t dwCount = pEntry->GetCount(); if (dwCount == 1) { iColorType = COLORTYPE_GRAY; - FX_FLOAT g = pEntry->GetNumberAt(0) * 255; + float g = pEntry->GetNumberAt(0) * 255; return ArgbEncode(255, (int)g, (int)g, (int)g); } if (dwCount == 3) { iColorType = COLORTYPE_RGB; - FX_FLOAT r = pEntry->GetNumberAt(0) * 255; - FX_FLOAT g = pEntry->GetNumberAt(1) * 255; - FX_FLOAT b = pEntry->GetNumberAt(2) * 255; + float r = pEntry->GetNumberAt(0) * 255; + float g = pEntry->GetNumberAt(1) * 255; + float b = pEntry->GetNumberAt(2) * 255; return ArgbEncode(255, (int)r, (int)g, (int)b); } if (dwCount == 4) { iColorType = COLORTYPE_CMYK; - FX_FLOAT c = pEntry->GetNumberAt(0); - FX_FLOAT m = pEntry->GetNumberAt(1); - FX_FLOAT y = pEntry->GetNumberAt(2); - FX_FLOAT k = pEntry->GetNumberAt(3); - FX_FLOAT r = 1.0f - std::min(1.0f, c + k); - FX_FLOAT g = 1.0f - std::min(1.0f, m + k); - FX_FLOAT b = 1.0f - std::min(1.0f, y + k); + float c = pEntry->GetNumberAt(0); + float m = pEntry->GetNumberAt(1); + float y = pEntry->GetNumberAt(2); + float k = pEntry->GetNumberAt(3); + float r = 1.0f - std::min(1.0f, c + k); + float g = 1.0f - std::min(1.0f, m + k); + float b = 1.0f - std::min(1.0f, y + k); return ArgbEncode(255, (int)(r * 255), (int)(g * 255), (int)(b * 255)); } return color; } -FX_FLOAT CPDF_ApSettings::GetOriginalColor( - int index, - const CFX_ByteString& csEntry) const { +float CPDF_ApSettings::GetOriginalColor(int index, + const CFX_ByteString& csEntry) const { if (!m_pDict) return 0; @@ -71,7 +70,7 @@ FX_FLOAT CPDF_ApSettings::GetOriginalColor( } void CPDF_ApSettings::GetOriginalColor(int& iColorType, - FX_FLOAT fc[4], + float fc[4], const CFX_ByteString& csEntry) const { iColorType = COLORTYPE_TRANSPARENT; for (int i = 0; i < 4; i++) diff --git a/core/fpdfdoc/cpdf_apsettings.h b/core/fpdfdoc/cpdf_apsettings.h index ffddffdbe0..ba0b05bd2b 100644 --- a/core/fpdfdoc/cpdf_apsettings.h +++ b/core/fpdfdoc/cpdf_apsettings.h @@ -27,11 +27,11 @@ class CPDF_ApSettings { return GetColor(iColorType, "BC"); } - FX_FLOAT GetOriginalBorderColor(int index) const { + float GetOriginalBorderColor(int index) const { return GetOriginalColor(index, "BC"); } - void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) const { + void GetOriginalBorderColor(int& iColorType, float fc[4]) const { GetOriginalColor(iColorType, fc, "BC"); } @@ -39,11 +39,11 @@ class CPDF_ApSettings { return GetColor(iColorType, "BG"); } - FX_FLOAT GetOriginalBackgroundColor(int index) const { + float GetOriginalBackgroundColor(int index) const { return GetOriginalColor(index, "BG"); } - void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) const { + void GetOriginalBackgroundColor(int& iColorType, float fc[4]) const { GetOriginalColor(iColorType, fc, "BG"); } @@ -60,9 +60,9 @@ class CPDF_ApSettings { friend class CPDF_FormControl; FX_ARGB GetColor(int& iColorType, const CFX_ByteString& csEntry) const; - FX_FLOAT GetOriginalColor(int index, const CFX_ByteString& csEntry) const; + float GetOriginalColor(int index, const CFX_ByteString& csEntry) const; void GetOriginalColor(int& iColorType, - FX_FLOAT fc[4], + float fc[4], const CFX_ByteString& csEntry) const; CFX_WideString GetCaption(const CFX_ByteString& csEntry) const; diff --git a/core/fpdfdoc/cpdf_defaultappearance.cpp b/core/fpdfdoc/cpdf_defaultappearance.cpp index 19767650f3..1873c1ae58 100644 --- a/core/fpdfdoc/cpdf_defaultappearance.cpp +++ b/core/fpdfdoc/cpdf_defaultappearance.cpp @@ -37,7 +37,7 @@ CFX_ByteString CPDF_DefaultAppearance::GetFontString() { } void CPDF_DefaultAppearance::GetFont(CFX_ByteString& csFontNameTag, - FX_FLOAT& fFontSize) { + float& fFontSize) { csFontNameTag = ""; fFontSize = 0; if (m_csDA.IsEmpty()) @@ -110,7 +110,7 @@ CFX_ByteString CPDF_DefaultAppearance::GetColorString( } void CPDF_DefaultAppearance::GetColor(int& iColorType, - FX_FLOAT fc[4], + float fc[4], PaintOperation nOperation) { iColorType = COLORTYPE_TRANSPARENT; for (int c = 0; c < 4; c++) @@ -156,29 +156,29 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color, if (syntax.FindTagParamFromStart( (nOperation == PaintOperation::STROKE ? "G" : "g"), 1)) { iColorType = COLORTYPE_GRAY; - FX_FLOAT g = FX_atof(syntax.GetWord()) * 255 + 0.5f; + float g = FX_atof(syntax.GetWord()) * 255 + 0.5f; color = ArgbEncode(255, (int)g, (int)g, (int)g); return; } if (syntax.FindTagParamFromStart( (nOperation == PaintOperation::STROKE ? "RG" : "rg"), 3)) { iColorType = COLORTYPE_RGB; - FX_FLOAT r = FX_atof(syntax.GetWord()) * 255 + 0.5f; - FX_FLOAT g = FX_atof(syntax.GetWord()) * 255 + 0.5f; - FX_FLOAT b = FX_atof(syntax.GetWord()) * 255 + 0.5f; + float r = FX_atof(syntax.GetWord()) * 255 + 0.5f; + float g = FX_atof(syntax.GetWord()) * 255 + 0.5f; + float b = FX_atof(syntax.GetWord()) * 255 + 0.5f; color = ArgbEncode(255, (int)r, (int)g, (int)b); return; } if (syntax.FindTagParamFromStart( (nOperation == PaintOperation::STROKE ? "K" : "k"), 4)) { iColorType = COLORTYPE_CMYK; - FX_FLOAT c = FX_atof(syntax.GetWord()); - FX_FLOAT m = FX_atof(syntax.GetWord()); - FX_FLOAT y = FX_atof(syntax.GetWord()); - FX_FLOAT k = FX_atof(syntax.GetWord()); - FX_FLOAT r = 1.0f - std::min(1.0f, c + k); - FX_FLOAT g = 1.0f - std::min(1.0f, m + k); - FX_FLOAT b = 1.0f - std::min(1.0f, y + k); + float c = FX_atof(syntax.GetWord()); + float m = FX_atof(syntax.GetWord()); + float y = FX_atof(syntax.GetWord()); + float k = FX_atof(syntax.GetWord()); + float r = 1.0f - std::min(1.0f, c + k); + float g = 1.0f - std::min(1.0f, m + k); + float b = 1.0f - std::min(1.0f, y + k); color = ArgbEncode(255, (int)(r * 255 + 0.5f), (int)(g * 255 + 0.5f), (int)(b * 255 + 0.5f)); } @@ -216,7 +216,7 @@ CFX_Matrix CPDF_DefaultAppearance::GetTextMatrix() { if (!syntax.FindTagParamFromStart("Tm", 6)) return CFX_Matrix(); - FX_FLOAT f[6]; + float f[6]; for (int i = 0; i < 6; i++) f[i] = FX_atof(syntax.GetWord()); return CFX_Matrix(f); diff --git a/core/fpdfdoc/cpdf_defaultappearance.h b/core/fpdfdoc/cpdf_defaultappearance.h index 4fd32ebd0c..0edc18c31f 100644 --- a/core/fpdfdoc/cpdf_defaultappearance.h +++ b/core/fpdfdoc/cpdf_defaultappearance.h @@ -29,13 +29,13 @@ class CPDF_DefaultAppearance { bool HasFont(); CFX_ByteString GetFontString(); - void GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize); + void GetFont(CFX_ByteString& csFontNameTag, float& fFontSize); bool HasColor(PaintOperation nOperation = PaintOperation::FILL); CFX_ByteString GetColorString( PaintOperation nOperation = PaintOperation::FILL); void GetColor(int& iColorType, - FX_FLOAT fc[4], + float fc[4], PaintOperation nOperation = PaintOperation::FILL); void GetColor(FX_ARGB& color, int& iColorType, diff --git a/core/fpdfdoc/cpdf_dest.cpp b/core/fpdfdoc/cpdf_dest.cpp index 11264f729d..ca380be957 100644 --- a/core/fpdfdoc/cpdf_dest.cpp +++ b/core/fpdfdoc/cpdf_dest.cpp @@ -113,7 +113,7 @@ bool CPDF_Dest::GetXYZ(bool* pHasX, return true; } -FX_FLOAT CPDF_Dest::GetParam(int index) { +float CPDF_Dest::GetParam(int index) { CPDF_Array* pArray = ToArray(m_pObj); return pArray ? pArray->GetNumberAt(2 + index) : 0; } diff --git a/core/fpdfdoc/cpdf_dest.h b/core/fpdfdoc/cpdf_dest.h index 527d1dcf8b..47559495a4 100644 --- a/core/fpdfdoc/cpdf_dest.h +++ b/core/fpdfdoc/cpdf_dest.h @@ -23,7 +23,7 @@ class CPDF_Dest { int GetPageIndex(CPDF_Document* pDoc); uint32_t GetPageObjNum(); int GetZoomMode(); - FX_FLOAT GetParam(int index); + float GetParam(int index); bool GetXYZ(bool* pHasX, bool* pHasY, diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp index 0a5363ed96..b8a11cc204 100644 --- a/core/fpdfdoc/cpdf_formcontrol.cpp +++ b/core/fpdfdoc/cpdf_formcontrol.cpp @@ -216,13 +216,13 @@ FX_ARGB CPDF_FormControl::GetColor(int& iColorType, return GetMK().GetColor(iColorType, csEntry); } -FX_FLOAT CPDF_FormControl::GetOriginalColor(int index, - const CFX_ByteString& csEntry) { +float CPDF_FormControl::GetOriginalColor(int index, + const CFX_ByteString& csEntry) { return GetMK().GetOriginalColor(index, csEntry); } void CPDF_FormControl::GetOriginalColor(int& iColorType, - FX_FLOAT fc[4], + float fc[4], const CFX_ByteString& csEntry) { GetMK().GetOriginalColor(iColorType, fc, csEntry); } @@ -282,7 +282,7 @@ CPDF_DefaultAppearance CPDF_FormControl::GetDefaultAppearance() { CPDF_Font* CPDF_FormControl::GetDefaultControlFont() { CPDF_DefaultAppearance cDA = GetDefaultAppearance(); CFX_ByteString csFontNameTag; - FX_FLOAT fFontSize; + float fFontSize; cDA.GetFont(csFontNameTag, fFontSize); if (csFontNameTag.IsEmpty()) return nullptr; diff --git a/core/fpdfdoc/cpdf_formcontrol.h b/core/fpdfdoc/cpdf_formcontrol.h index c0dad39098..fff77fb32d 100644 --- a/core/fpdfdoc/cpdf_formcontrol.h +++ b/core/fpdfdoc/cpdf_formcontrol.h @@ -72,11 +72,11 @@ class CPDF_FormControl { FX_ARGB GetBorderColor(int& iColorType) { return GetColor(iColorType, "BC"); } - FX_FLOAT GetOriginalBorderColor(int index) { + float GetOriginalBorderColor(int index) { return GetOriginalColor(index, "BC"); } - void GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4]) { + void GetOriginalBorderColor(int& iColorType, float fc[4]) { GetOriginalColor(iColorType, fc, "BC"); } @@ -84,11 +84,11 @@ class CPDF_FormControl { return GetColor(iColorType, "BG"); } - FX_FLOAT GetOriginalBackgroundColor(int index) { + float GetOriginalBackgroundColor(int index) { return GetOriginalColor(index, "BG"); } - void GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4]) { + void GetOriginalBackgroundColor(int& iColorType, float fc[4]) { GetOriginalColor(iColorType, fc, "BG"); } @@ -117,9 +117,9 @@ class CPDF_FormControl { void SetOnStateName(const CFX_ByteString& csOn); void CheckControl(bool bChecked); FX_ARGB GetColor(int& iColorType, const CFX_ByteString& csEntry); - FX_FLOAT GetOriginalColor(int index, const CFX_ByteString& csEntry); + float GetOriginalColor(int index, const CFX_ByteString& csEntry); void GetOriginalColor(int& iColorType, - FX_FLOAT fc[4], + float fc[4], const CFX_ByteString& csEntry); CFX_WideString GetCaption(const CFX_ByteString& csEntry); diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h index 0cb0a481c2..35eaca4866 100644 --- a/core/fpdfdoc/cpdf_formfield.h +++ b/core/fpdfdoc/cpdf_formfield.h @@ -125,7 +125,7 @@ class CPDF_FormField { bool bNotify = false); #endif // PDF_ENABLE_XFA - FX_FLOAT GetFontSize() const { return m_FontSize; } + float GetFontSize() const { return m_FontSize; } CPDF_Font* GetFont() const { return m_pFont; } private: @@ -160,7 +160,7 @@ class CPDF_FormField { CPDF_InterForm* const m_pForm; CPDF_Dictionary* m_pDict; std::vector<CPDF_FormControl*> m_ControlList; // Owned by InterForm parent. - FX_FLOAT m_FontSize; + float m_FontSize; CPDF_Font* m_pFont; }; diff --git a/core/fpdfdoc/cpdf_iconfit.cpp b/core/fpdfdoc/cpdf_iconfit.cpp index aedb785912..0f05d7de35 100644 --- a/core/fpdfdoc/cpdf_iconfit.cpp +++ b/core/fpdfdoc/cpdf_iconfit.cpp @@ -28,7 +28,7 @@ bool CPDF_IconFit::IsProportionalScale() { return m_pDict ? m_pDict->GetStringFor("S", "P") != "A" : true; } -void CPDF_IconFit::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) { +void CPDF_IconFit::GetIconPosition(float& fLeft, float& fBottom) { fLeft = fBottom = 0.5; if (!m_pDict) return; diff --git a/core/fpdfdoc/cpdf_iconfit.h b/core/fpdfdoc/cpdf_iconfit.h index 37df48d43e..6e3b8cf50a 100644 --- a/core/fpdfdoc/cpdf_iconfit.h +++ b/core/fpdfdoc/cpdf_iconfit.h @@ -19,7 +19,7 @@ class CPDF_IconFit { ScaleMethod GetScaleMethod(); bool IsProportionalScale(); - void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom); + void GetIconPosition(float& fLeft, float& fBottom); bool GetFittingBounds(); const CPDF_Dictionary* GetDict() const { return m_pDict; } diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp index aa393f7657..5dabf8db0c 100644 --- a/core/fpdfdoc/cpdf_variabletext.cpp +++ b/core/fpdfdoc/cpdf_variabletext.cpp @@ -773,7 +773,7 @@ const CFX_FloatRect& CPDF_VariableText::GetPlateRect() const { return m_rcPlate; } -FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo) { +float CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo) { return GetFontSize(); } @@ -781,66 +781,64 @@ int32_t CPDF_VariableText::GetWordFontIndex(const CPVT_WordInfo& WordInfo) { return WordInfo.nFontIndex; } -FX_FLOAT CPDF_VariableText::GetWordWidth(int32_t nFontIndex, - uint16_t Word, - uint16_t SubWord, - FX_FLOAT fCharSpace, - int32_t nHorzScale, - FX_FLOAT fFontSize, - FX_FLOAT fWordTail) { +float CPDF_VariableText::GetWordWidth(int32_t nFontIndex, + uint16_t Word, + uint16_t SubWord, + float fCharSpace, + int32_t nHorzScale, + float fFontSize, + float fWordTail) { return (GetCharWidth(nFontIndex, Word, SubWord) * fFontSize * kFontScale + fCharSpace) * nHorzScale * kScalePercent + fWordTail; } -FX_FLOAT CPDF_VariableText::GetWordWidth(const CPVT_WordInfo& WordInfo) { +float CPDF_VariableText::GetWordWidth(const CPVT_WordInfo& WordInfo) { return GetWordWidth(GetWordFontIndex(WordInfo), WordInfo.Word, GetSubWord(), GetCharSpace(WordInfo), GetHorzScale(WordInfo), GetWordFontSize(WordInfo), WordInfo.fWordTail); } -FX_FLOAT CPDF_VariableText::GetLineAscent(const CPVT_SectionInfo& SecInfo) { +float CPDF_VariableText::GetLineAscent(const CPVT_SectionInfo& SecInfo) { return GetFontAscent(GetDefaultFontIndex(), GetFontSize()); } -FX_FLOAT CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo& SecInfo) { +float CPDF_VariableText::GetLineDescent(const CPVT_SectionInfo& SecInfo) { return GetFontDescent(GetDefaultFontIndex(), GetFontSize()); } -FX_FLOAT CPDF_VariableText::GetFontAscent(int32_t nFontIndex, - FX_FLOAT fFontSize) { - return (FX_FLOAT)GetTypeAscent(nFontIndex) * fFontSize * kFontScale; +float CPDF_VariableText::GetFontAscent(int32_t nFontIndex, float fFontSize) { + return (float)GetTypeAscent(nFontIndex) * fFontSize * kFontScale; } -FX_FLOAT CPDF_VariableText::GetFontDescent(int32_t nFontIndex, - FX_FLOAT fFontSize) { - return (FX_FLOAT)GetTypeDescent(nFontIndex) * fFontSize * kFontScale; +float CPDF_VariableText::GetFontDescent(int32_t nFontIndex, float fFontSize) { + return (float)GetTypeDescent(nFontIndex) * fFontSize * kFontScale; } -FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo& WordInfo, - FX_FLOAT fFontSize) { +float CPDF_VariableText::GetWordAscent(const CPVT_WordInfo& WordInfo, + float fFontSize) { return GetFontAscent(GetWordFontIndex(WordInfo), fFontSize); } -FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo& WordInfo, - FX_FLOAT fFontSize) { +float CPDF_VariableText::GetWordDescent(const CPVT_WordInfo& WordInfo, + float fFontSize) { return GetFontDescent(GetWordFontIndex(WordInfo), fFontSize); } -FX_FLOAT CPDF_VariableText::GetWordAscent(const CPVT_WordInfo& WordInfo) { +float CPDF_VariableText::GetWordAscent(const CPVT_WordInfo& WordInfo) { return GetFontAscent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo)); } -FX_FLOAT CPDF_VariableText::GetWordDescent(const CPVT_WordInfo& WordInfo) { +float CPDF_VariableText::GetWordDescent(const CPVT_WordInfo& WordInfo) { return GetFontDescent(GetWordFontIndex(WordInfo), GetWordFontSize(WordInfo)); } -FX_FLOAT CPDF_VariableText::GetLineLeading(const CPVT_SectionInfo& SecInfo) { +float CPDF_VariableText::GetLineLeading(const CPVT_SectionInfo& SecInfo) { return m_fLineLeading; } -FX_FLOAT CPDF_VariableText::GetLineIndent(const CPVT_SectionInfo& SecInfo) { +float CPDF_VariableText::GetLineIndent(const CPVT_SectionInfo& SecInfo) { return 0.0f; } @@ -848,7 +846,7 @@ int32_t CPDF_VariableText::GetAlignment(const CPVT_SectionInfo& SecInfo) { return m_nAlignment; } -FX_FLOAT CPDF_VariableText::GetCharSpace(const CPVT_WordInfo& WordInfo) { +float CPDF_VariableText::GetCharSpace(const CPVT_WordInfo& WordInfo) { return m_fCharSpace; } @@ -979,7 +977,7 @@ CPVT_FloatRect CPDF_VariableText::Rearrange(const CPVT_WordRange& PlaceRange) { return rcRet; } -FX_FLOAT CPDF_VariableText::GetAutoFontSize() { +float CPDF_VariableText::GetAutoFontSize() { int32_t nTotal = sizeof(gFontSizeSteps) / sizeof(uint8_t); if (IsMultiLine()) nTotal /= 4; @@ -1002,10 +1000,10 @@ FX_FLOAT CPDF_VariableText::GetAutoFontSize() { continue; } } - return (FX_FLOAT)gFontSizeSteps[nMid]; + return (float)gFontSizeSteps[nMid]; } -bool CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) const { +bool CPDF_VariableText::IsBigger(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)) { @@ -1024,8 +1022,8 @@ bool CPDF_VariableText::IsBigger(FX_FLOAT fFontSize) const { CPVT_FloatRect CPDF_VariableText::RearrangeSections( const CPVT_WordRange& PlaceRange) { CPVT_WordPlace place; - FX_FLOAT fPosY = 0; - FX_FLOAT fOldHeight; + float fPosY = 0; + float fOldHeight; int32_t nSSecIndex = PlaceRange.BeginPos.nSecIndex; int32_t nESecIndex = PlaceRange.EndPos.nSecIndex; CPVT_FloatRect rcRet; diff --git a/core/fpdfdoc/cpdf_variabletext.h b/core/fpdfdoc/cpdf_variabletext.h index 3bec89abec..59fe12402a 100644 --- a/core/fpdfdoc/cpdf_variabletext.h +++ b/core/fpdfdoc/cpdf_variabletext.h @@ -93,10 +93,10 @@ class CPDF_VariableText { void SetAlignment(int32_t nFormat) { m_nAlignment = nFormat; } void SetPasswordChar(uint16_t wSubWord) { m_wSubWord = wSubWord; } void SetLimitChar(int32_t nLimitChar) { m_nLimitChar = nLimitChar; } - void SetCharSpace(FX_FLOAT fCharSpace) { m_fCharSpace = fCharSpace; } + void SetCharSpace(float fCharSpace) { m_fCharSpace = fCharSpace; } void SetMultiLine(bool bMultiLine) { m_bMultiLine = bMultiLine; } void SetAutoReturn(bool bAuto) { m_bLimitWidth = bAuto; } - void SetFontSize(FX_FLOAT fFontSize) { m_fFontSize = fFontSize; } + void SetFontSize(float fFontSize) { m_fFontSize = fFontSize; } void SetCharArray(int32_t nCharArray) { m_nCharArray = nCharArray; } void SetAutoFontSize(bool bAuto) { m_bAutoFontSize = bAuto; } void Initialize(); @@ -120,14 +120,14 @@ class CPDF_VariableText { CPVT_WordPlace BackSpaceWord(const CPVT_WordPlace& place); int32_t GetTotalWords() const; - FX_FLOAT GetFontSize() const { return m_fFontSize; } + float GetFontSize() const { return m_fFontSize; } int32_t GetAlignment() const { return m_nAlignment; } uint16_t GetPasswordChar() const { return GetSubWord(); } int32_t GetCharArray() const { return m_nCharArray; } int32_t GetLimitChar() const { return m_nLimitChar; } bool IsMultiLine() const { return m_bMultiLine; } int32_t GetHorzScale() const { return m_nHorzScale; } - FX_FLOAT GetCharSpace() const { return m_fCharSpace; } + float GetCharSpace() const { return m_fCharSpace; } CPVT_WordPlace GetBeginWordPlace() const; CPVT_WordPlace GetEndWordPlace() const; CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace& place) const; @@ -149,8 +149,8 @@ class CPDF_VariableText { uint16_t GetSubWord() const { return m_wSubWord; } - FX_FLOAT GetPlateWidth() const { return m_rcPlate.right - m_rcPlate.left; } - FX_FLOAT GetPlateHeight() const { return m_rcPlate.top - m_rcPlate.bottom; } + 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; @@ -181,28 +181,28 @@ class CPDF_VariableText { bool SetWordInfo(const CPVT_WordPlace& place, const CPVT_WordInfo& wordinfo); bool GetLineInfo(const CPVT_WordPlace& place, CPVT_LineInfo& lineinfo); bool GetSectionInfo(const CPVT_WordPlace& place, CPVT_SectionInfo& secinfo); - FX_FLOAT GetWordFontSize(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetWordWidth(int32_t nFontIndex, - uint16_t Word, - uint16_t SubWord, - FX_FLOAT fCharSpace, - int32_t nHorzScale, - FX_FLOAT fFontSize, - FX_FLOAT fWordTail); - FX_FLOAT GetWordWidth(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); - FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo, FX_FLOAT fFontSize); - FX_FLOAT GetWordAscent(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetWordDescent(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetLineAscent(const CPVT_SectionInfo& SecInfo); - FX_FLOAT GetLineDescent(const CPVT_SectionInfo& SecInfo); - FX_FLOAT GetFontAscent(int32_t nFontIndex, FX_FLOAT fFontSize); - FX_FLOAT GetFontDescent(int32_t nFontIndex, FX_FLOAT fFontSize); + float GetWordFontSize(const CPVT_WordInfo& WordInfo); + float GetWordWidth(int32_t nFontIndex, + uint16_t Word, + uint16_t SubWord, + float fCharSpace, + int32_t nHorzScale, + float fFontSize, + float fWordTail); + float GetWordWidth(const CPVT_WordInfo& WordInfo); + float GetWordAscent(const CPVT_WordInfo& WordInfo, float fFontSize); + float GetWordDescent(const CPVT_WordInfo& WordInfo, float fFontSize); + float GetWordAscent(const CPVT_WordInfo& WordInfo); + float GetWordDescent(const CPVT_WordInfo& WordInfo); + float GetLineAscent(const CPVT_SectionInfo& SecInfo); + float GetLineDescent(const CPVT_SectionInfo& SecInfo); + float GetFontAscent(int32_t nFontIndex, float fFontSize); + float GetFontDescent(int32_t nFontIndex, float fFontSize); int32_t GetWordFontIndex(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetCharSpace(const CPVT_WordInfo& WordInfo); + float GetCharSpace(const CPVT_WordInfo& WordInfo); int32_t GetHorzScale(const CPVT_WordInfo& WordInfo); - FX_FLOAT GetLineLeading(const CPVT_SectionInfo& SecInfo); - FX_FLOAT GetLineIndent(const CPVT_SectionInfo& SecInfo); + float GetLineLeading(const CPVT_SectionInfo& SecInfo); + float GetLineIndent(const CPVT_SectionInfo& SecInfo); int32_t GetAlignment(const CPVT_SectionInfo& SecInfo); void ClearSectionRightWords(const CPVT_WordPlace& place); @@ -215,8 +215,8 @@ class CPDF_VariableText { CPVT_WordPlace ClearRightWord(const CPVT_WordPlace& place); CPVT_FloatRect Rearrange(const CPVT_WordRange& PlaceRange); - FX_FLOAT GetAutoFontSize(); - bool IsBigger(FX_FLOAT fFontSize) const; + float GetAutoFontSize(); + bool IsBigger(float fFontSize) const; CPVT_FloatRect RearrangeSections(const CPVT_WordRange& PlaceRange); void ResetSectionArray(); @@ -228,11 +228,11 @@ class CPDF_VariableText { bool m_bLimitWidth; bool m_bAutoFontSize; int32_t m_nAlignment; - FX_FLOAT m_fLineLeading; - FX_FLOAT m_fCharSpace; + float m_fLineLeading; + float m_fCharSpace; int32_t m_nHorzScale; uint16_t m_wSubWord; - FX_FLOAT m_fFontSize; + float m_fFontSize; bool m_bInitial; CPDF_VariableText::Provider* m_pVTProvider; std::unique_ptr<CPDF_VariableText::Iterator> m_pVTIterator; diff --git a/core/fpdfdoc/cpvt_color.cpp b/core/fpdfdoc/cpvt_color.cpp index e0e6a26db7..584a85aaec 100644 --- a/core/fpdfdoc/cpvt_color.cpp +++ b/core/fpdfdoc/cpvt_color.cpp @@ -15,16 +15,16 @@ CPVT_Color CPVT_Color::ParseColor(const CFX_ByteString& str) { return CPVT_Color(CPVT_Color::kGray, FX_atof(syntax.GetWord())); if (syntax.FindTagParamFromStart("rg", 3)) { - FX_FLOAT f1 = FX_atof(syntax.GetWord()); - FX_FLOAT f2 = FX_atof(syntax.GetWord()); - FX_FLOAT f3 = FX_atof(syntax.GetWord()); + float f1 = FX_atof(syntax.GetWord()); + float f2 = FX_atof(syntax.GetWord()); + float f3 = FX_atof(syntax.GetWord()); return CPVT_Color(CPVT_Color::kRGB, f1, f2, f3); } if (syntax.FindTagParamFromStart("k", 4)) { - FX_FLOAT f1 = FX_atof(syntax.GetWord()); - FX_FLOAT f2 = FX_atof(syntax.GetWord()); - FX_FLOAT f3 = FX_atof(syntax.GetWord()); - FX_FLOAT f4 = FX_atof(syntax.GetWord()); + float f1 = FX_atof(syntax.GetWord()); + float f2 = FX_atof(syntax.GetWord()); + float f3 = FX_atof(syntax.GetWord()); + float f4 = FX_atof(syntax.GetWord()); return CPVT_Color(CPVT_Color::kCMYK, f1, f2, f3, f4); } return CPVT_Color(CPVT_Color::kTransparent); diff --git a/core/fpdfdoc/cpvt_color.h b/core/fpdfdoc/cpvt_color.h index 4d4942dbf9..2db3b8310e 100644 --- a/core/fpdfdoc/cpvt_color.h +++ b/core/fpdfdoc/cpvt_color.h @@ -15,10 +15,10 @@ struct CPVT_Color { enum Type { kTransparent = 0, kGray, kRGB, kCMYK }; CPVT_Color(Type type = kTransparent, - FX_FLOAT color1 = 0.0f, - FX_FLOAT color2 = 0.0f, - FX_FLOAT color3 = 0.0f, - FX_FLOAT color4 = 0.0f) + float color1 = 0.0f, + float color2 = 0.0f, + float color3 = 0.0f, + float color4 = 0.0f) : nColorType(type), fColor1(color1), fColor2(color2), @@ -26,10 +26,10 @@ struct CPVT_Color { fColor4(color4) {} Type nColorType; - FX_FLOAT fColor1; - FX_FLOAT fColor2; - FX_FLOAT fColor3; - FX_FLOAT fColor4; + float fColor1; + float fColor2; + float fColor3; + float fColor4; static CPVT_Color ParseColor(const CFX_ByteString& str); static CPVT_Color ParseColor(const CPDF_Array& array); diff --git a/core/fpdfdoc/cpvt_floatrect.h b/core/fpdfdoc/cpvt_floatrect.h index 6fc4b8ebce..a8b32dc7e5 100644 --- a/core/fpdfdoc/cpvt_floatrect.h +++ b/core/fpdfdoc/cpvt_floatrect.h @@ -13,10 +13,10 @@ class CPVT_FloatRect : public CFX_FloatRect { public: CPVT_FloatRect() { left = top = right = bottom = 0.0f; } - CPVT_FloatRect(FX_FLOAT other_left, - FX_FLOAT other_top, - FX_FLOAT other_right, - FX_FLOAT other_bottom) { + CPVT_FloatRect(float other_left, + float other_top, + float other_right, + float other_bottom) { left = other_left; top = other_top; right = other_right; @@ -32,7 +32,7 @@ class CPVT_FloatRect : public CFX_FloatRect { void Default() { left = top = right = bottom = 0.0f; } - FX_FLOAT Height() const { + float Height() const { if (top > bottom) return top - bottom; return bottom - top; diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 15515151bc..7e895e5850 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -54,7 +54,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc, if (sFontName.IsEmpty()) return false; - FX_FLOAT fFontSize = FX_atof(syntax.GetWord()); + float fFontSize = FX_atof(syntax.GetWord()); CPVT_Color crText = CPVT_Color::ParseColor(DA); CPDF_Dictionary* pDRDict = pFormDict->GetDictFor("DR"); if (!pDRDict) @@ -109,7 +109,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc, } BorderStyle nBorderStyle = BorderStyle::SOLID; - FX_FLOAT fBorderWidth = 1; + float fBorderWidth = 1; CPVT_Dash dsBorder(3, 0, 0); CPVT_Color crLeftTop, crRightBottom; if (CPDF_Dictionary* pBSDict = pAnnotDict->GetDictFor("BS")) { @@ -353,7 +353,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc, int32_t nTop = pTi ? pTi->GetInteger() : 0; CFX_ByteTextBuf sBody; if (pOpts) { - FX_FLOAT fy = rcBody.top; + float fy = rcBody.top; for (size_t i = nTop, sz = pOpts->GetCount(); i < sz; i++) { if (IsFloatSmaller(fy, rcBody.bottom)) break; @@ -384,7 +384,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc, vt.Initialize(); vt.SetText(swItem); vt.RearrangeAll(); - FX_FLOAT fItemHeight = vt.GetContentRect().Height(); + float fItemHeight = vt.GetContentRect().Height(); if (bSelected) { CFX_FloatRect rcItem = CFX_FloatRect( rcBody.left, fy - fItemHeight, rcBody.right, fy); @@ -463,7 +463,7 @@ CFX_ByteString GetColorStringWithDefault(CPDF_Array* pColor, return CPVT_GenerateAP::GenerateColorAP(crDefaultColor, nOperation); } -FX_FLOAT GetBorderWidth(const CPDF_Dictionary& pAnnotDict) { +float GetBorderWidth(const CPDF_Dictionary& pAnnotDict) { if (CPDF_Dictionary* pBorderStyleDict = pAnnotDict.GetDictFor("BS")) { if (pBorderStyleDict->KeyExist("W")) return pBorderStyleDict->GetNumberFor("W"); @@ -552,7 +552,7 @@ std::unique_ptr<CPDF_Dictionary> GenerateExtGStateDict( pdfium::MakeUnique<CPDF_Dictionary>(pAnnotDict.GetByteStringPool()); pGSDict->SetNewFor<CPDF_String>("Type", "ExtGState", false); - FX_FLOAT fOpacity = + float fOpacity = pAnnotDict.KeyExist("CA") ? pAnnotDict.GetNumberFor("CA") : 1; pGSDict->SetNewFor<CPDF_Number>("CA", fOpacity); pGSDict->SetNewFor<CPDF_Number>("ca", fOpacity); @@ -630,11 +630,11 @@ CFX_ByteString GenerateTextSymbolAP(const CFX_FloatRect& rect) { sAppStream << CPVT_GenerateAP::GenerateColorAP( CPVT_Color(CPVT_Color::kRGB, 0, 0, 0), PaintOperation::STROKE); - const FX_FLOAT fBorderWidth = 1; + const float fBorderWidth = 1; sAppStream << fBorderWidth << " w\n"; - const FX_FLOAT fHalfWidth = fBorderWidth / 2; - const FX_FLOAT fTipDelta = 4; + const float fHalfWidth = fBorderWidth / 2; + const float fTipDelta = 4; CFX_FloatRect outerRect1 = rect; outerRect1.Deflate(fHalfWidth, fHalfWidth); @@ -644,7 +644,7 @@ CFX_ByteString GenerateTextSymbolAP(const CFX_FloatRect& rect) { outerRect2.left += fTipDelta; outerRect2.right = outerRect2.left + fTipDelta; outerRect2.top = outerRect2.bottom - fTipDelta; - FX_FLOAT outerRect2Middle = (outerRect2.left + outerRect2.right) / 2; + float outerRect2Middle = (outerRect2.left + outerRect2.right) / 2; // Draw outer boxes. sAppStream << outerRect1.left << " " << outerRect1.bottom << " m\n" @@ -658,8 +658,8 @@ CFX_ByteString GenerateTextSymbolAP(const CFX_FloatRect& rect) { // Draw inner lines. CFX_FloatRect lineRect = outerRect1; - const FX_FLOAT fXDelta = 2; - const FX_FLOAT fYDelta = (lineRect.top - lineRect.bottom) / 4; + const float fXDelta = 2; + const float fYDelta = (lineRect.top - lineRect.bottom) / 4; lineRect.left += fXDelta; lineRect.right -= fXDelta; @@ -744,7 +744,7 @@ bool CPVT_GenerateAP::GenerateCircleAP(CPDF_Document* pDoc, CPVT_Color(CPVT_Color::kRGB, 0, 0, 0), PaintOperation::STROKE); - FX_FLOAT fBorderWidth = GetBorderWidth(*pAnnotDict); + float fBorderWidth = GetBorderWidth(*pAnnotDict); bool bIsStrokeRect = fBorderWidth > 0; if (bIsStrokeRect) { @@ -762,15 +762,15 @@ bool CPVT_GenerateAP::GenerateCircleAP(CPDF_Document* pDoc, rect.Deflate(fBorderWidth / 2, fBorderWidth / 2); } - const FX_FLOAT fMiddleX = (rect.left + rect.right) / 2; - const FX_FLOAT fMiddleY = (rect.top + rect.bottom) / 2; + const float fMiddleX = (rect.left + rect.right) / 2; + const float fMiddleY = (rect.top + rect.bottom) / 2; // |fL| is precalculated approximate value of 4 * tan((3.14 / 2) / 4) / 3, // where |fL| * radius is a good approximation of control points for // arc with 90 degrees. - const FX_FLOAT fL = 0.5523f; - const FX_FLOAT fDeltaX = fL * rect.Width() / 2.0; - const FX_FLOAT fDeltaY = fL * rect.Height() / 2.0; + const float fL = 0.5523f; + const float fDeltaX = fL * rect.Width() / 2.0; + const float fDeltaY = fL * rect.Height() / 2.0; // Starting point sAppStream << fMiddleX << " " << rect.top << " m\n"; @@ -833,7 +833,7 @@ bool CPVT_GenerateAP::GenerateHighlightAP(CPDF_Document* pDoc, bool CPVT_GenerateAP::GenerateInkAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) { - FX_FLOAT fBorderWidth = GetBorderWidth(*pAnnotDict); + float fBorderWidth = GetBorderWidth(*pAnnotDict); bool bIsStroke = fBorderWidth > 0; if (!bIsStroke) @@ -892,7 +892,7 @@ bool CPVT_GenerateAP::GenerateTextAP(CPDF_Document* pDoc, sAppStream << "/" << sExtGSDictName << " gs "; CFX_FloatRect rect = pAnnotDict->GetRectFor("Rect"); - const FX_FLOAT fNoteLength = 20; + const float fNoteLength = 20; CFX_FloatRect noteRect(rect.left, rect.bottom, rect.left + fNoteLength, rect.bottom + fNoteLength); pAnnotDict->SetRectFor("Rect", noteRect); @@ -921,7 +921,7 @@ bool CPVT_GenerateAP::GenerateUnderlineAP(CPDF_Document* pDoc, CFX_FloatRect rect = CPDF_Annot::RectFromQuadPoints(pAnnotDict); rect.Normalize(); - FX_FLOAT fLineWidth = 1.0; + float fLineWidth = 1.0; sAppStream << fLineWidth << " w " << rect.left << " " << rect.bottom + fLineWidth << " m " << rect.right << " " << rect.bottom + fLineWidth << " l S\n"; @@ -946,7 +946,7 @@ bool CPVT_GenerateAP::GeneratePopupAP(CPDF_Document* pDoc, sAppStream << GenerateColorAP(CPVT_Color(CPVT_Color::kRGB, 0, 0, 0), PaintOperation::STROKE); - const FX_FLOAT fBorderWidth = 1; + const float fBorderWidth = 1; sAppStream << fBorderWidth << " w\n"; CFX_FloatRect rect = pAnnotDict->GetRectFor("Rect"); @@ -988,7 +988,7 @@ bool CPVT_GenerateAP::GenerateSquareAP(CPDF_Document* pDoc, CPVT_Color(CPVT_Color::kRGB, 0, 0, 0), PaintOperation::STROKE); - FX_FLOAT fBorderWidth = GetBorderWidth(*pAnnotDict); + float fBorderWidth = GetBorderWidth(*pAnnotDict); bool bIsStrokeRect = fBorderWidth > 0; if (bIsStrokeRect) { @@ -1034,16 +1034,16 @@ bool CPVT_GenerateAP::GenerateSquigglyAP(CPDF_Document* pDoc, CFX_FloatRect rect = CPDF_Annot::RectFromQuadPoints(pAnnotDict); rect.Normalize(); - FX_FLOAT fLineWidth = 1.0; + float fLineWidth = 1.0; sAppStream << fLineWidth << " w "; - const FX_FLOAT fDelta = 2.0; - const FX_FLOAT fTop = rect.bottom + fDelta; - const FX_FLOAT fBottom = rect.bottom; + const float fDelta = 2.0; + const float fTop = rect.bottom + fDelta; + const float fBottom = rect.bottom; sAppStream << rect.left << " " << fTop << " m "; - FX_FLOAT fX = rect.left + fDelta; + float fX = rect.left + fDelta; bool isUpwards = false; while (fX < rect.right) { @@ -1053,7 +1053,7 @@ bool CPVT_GenerateAP::GenerateSquigglyAP(CPDF_Document* pDoc, isUpwards = !isUpwards; } - FX_FLOAT fRemainder = rect.right - (fX - fDelta); + float fRemainder = rect.right - (fX - fDelta); if (isUpwards) sAppStream << rect.right << " " << fBottom + fRemainder << " l "; else @@ -1083,8 +1083,8 @@ bool CPVT_GenerateAP::GenerateStrikeOutAP(CPDF_Document* pDoc, CFX_FloatRect rect = CPDF_Annot::RectFromQuadPoints(pAnnotDict); rect.Normalize(); - FX_FLOAT fLineWidth = 1.0; - FX_FLOAT fY = (rect.top + rect.bottom) / 2; + float fLineWidth = 1.0; + float fY = (rect.top + rect.bottom) / 2; sAppStream << fLineWidth << " w " << rect.left << " " << fY << " m " << rect.right << " " << fY << " l S\n"; @@ -1184,7 +1184,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( // Static. CFX_ByteString CPVT_GenerateAP::GenerateBorderAP( const CFX_FloatRect& rect, - FX_FLOAT fWidth, + float fWidth, const CPVT_Color& color, const CPVT_Color& crLeftTop, const CPVT_Color& crRightBottom, @@ -1192,12 +1192,12 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP( const CPVT_Dash& dash) { CFX_ByteTextBuf sAppStream; CFX_ByteString sColor; - FX_FLOAT fLeft = rect.left; - FX_FLOAT fRight = rect.right; - FX_FLOAT fTop = rect.top; - FX_FLOAT fBottom = rect.bottom; + float fLeft = rect.left; + float fRight = rect.right; + float fTop = rect.top; + float fBottom = rect.bottom; if (fWidth > 0.0f) { - FX_FLOAT fHalfWidth = fWidth / 2.0f; + float fHalfWidth = fWidth / 2.0f; switch (nStyle) { default: case BorderStyle::SOLID: @@ -1355,7 +1355,7 @@ CFX_ByteString CPVT_GenerateAP::GetWordRenderString( // Static. CFX_ByteString CPVT_GenerateAP::GetFontSetString(IPVT_FontMap* pFontMap, int32_t nFontIndex, - FX_FLOAT fFontSize) { + float fFontSize) { CFX_ByteTextBuf sRet; if (pFontMap) { CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex); diff --git a/core/fpdfdoc/cpvt_generateap.h b/core/fpdfdoc/cpvt_generateap.h index 62a84531ee..c558636255 100644 --- a/core/fpdfdoc/cpvt_generateap.h +++ b/core/fpdfdoc/cpvt_generateap.h @@ -52,7 +52,7 @@ class CPVT_GenerateAP { bool bContinuous, uint16_t SubWord); static CFX_ByteString GenerateBorderAP(const CFX_FloatRect& rect, - FX_FLOAT fWidth, + float fWidth, const CPVT_Color& color, const CPVT_Color& crLeftTop, const CPVT_Color& crRightBottom, @@ -68,7 +68,7 @@ class CPVT_GenerateAP { static CFX_ByteString GetWordRenderString(const CFX_ByteString& strWords); static CFX_ByteString GetFontSetString(IPVT_FontMap* pFontMap, int32_t nFontIndex, - FX_FLOAT fFontSize); + float fFontSize); }; #endif // CORE_FPDFDOC_CPVT_GENERATEAP_H_ diff --git a/core/fpdfdoc/cpvt_line.h b/core/fpdfdoc/cpvt_line.h index 47c3e84d6a..087034d3d5 100644 --- a/core/fpdfdoc/cpvt_line.h +++ b/core/fpdfdoc/cpvt_line.h @@ -18,9 +18,9 @@ class CPVT_Line { CPVT_WordPlace lineplace; CPVT_WordPlace lineEnd; CFX_PointF ptLine; - FX_FLOAT fLineWidth; - FX_FLOAT fLineAscent; - FX_FLOAT fLineDescent; + float fLineWidth; + float fLineAscent; + float fLineDescent; }; inline CPVT_Line::CPVT_Line() diff --git a/core/fpdfdoc/cpvt_lineinfo.h b/core/fpdfdoc/cpvt_lineinfo.h index 8fb10de250..96a3234380 100644 --- a/core/fpdfdoc/cpvt_lineinfo.h +++ b/core/fpdfdoc/cpvt_lineinfo.h @@ -16,11 +16,11 @@ class CPVT_LineInfo { int32_t nTotalWord; int32_t nBeginWordIndex; int32_t nEndWordIndex; - FX_FLOAT fLineX; - FX_FLOAT fLineY; - FX_FLOAT fLineWidth; - FX_FLOAT fLineAscent; - FX_FLOAT fLineDescent; + float fLineX; + float fLineY; + float fLineWidth; + float fLineAscent; + float fLineDescent; }; inline CPVT_LineInfo::CPVT_LineInfo() diff --git a/core/fpdfdoc/cpvt_secprops.h b/core/fpdfdoc/cpvt_secprops.h index d1c4b589f1..93829f9b00 100644 --- a/core/fpdfdoc/cpvt_secprops.h +++ b/core/fpdfdoc/cpvt_secprops.h @@ -12,7 +12,7 @@ struct CPVT_SecProps { CPVT_SecProps() : fLineLeading(0.0f), fLineIndent(0.0f), nAlignment(0) {} - CPVT_SecProps(FX_FLOAT lineLeading, FX_FLOAT lineIndent, int32_t alignment) + CPVT_SecProps(float lineLeading, float lineIndent, int32_t alignment) : fLineLeading(lineLeading), fLineIndent(lineIndent), nAlignment(alignment) {} @@ -22,8 +22,8 @@ struct CPVT_SecProps { fLineIndent(other.fLineIndent), nAlignment(other.nAlignment) {} - FX_FLOAT fLineLeading; - FX_FLOAT fLineIndent; + float fLineLeading; + float fLineIndent; int32_t nAlignment; }; diff --git a/core/fpdfdoc/cpvt_word.h b/core/fpdfdoc/cpvt_word.h index 540f0416ad..28e192467b 100644 --- a/core/fpdfdoc/cpvt_word.h +++ b/core/fpdfdoc/cpvt_word.h @@ -19,11 +19,11 @@ class CPVT_Word { int32_t nCharset; CPVT_WordPlace WordPlace; CFX_PointF ptWord; - FX_FLOAT fAscent; - FX_FLOAT fDescent; - FX_FLOAT fWidth; + float fAscent; + float fDescent; + float fWidth; int32_t nFontIndex; - FX_FLOAT fFontSize; + float fFontSize; CPVT_WordProps WordProps; }; diff --git a/core/fpdfdoc/cpvt_wordinfo.h b/core/fpdfdoc/cpvt_wordinfo.h index 861534b0a5..00f5a45e70 100644 --- a/core/fpdfdoc/cpvt_wordinfo.h +++ b/core/fpdfdoc/cpvt_wordinfo.h @@ -25,9 +25,9 @@ struct CPVT_WordInfo { uint16_t Word; int32_t nCharset; - FX_FLOAT fWordX; - FX_FLOAT fWordY; - FX_FLOAT fWordTail; + float fWordX; + float fWordY; + float fWordTail; int32_t nFontIndex; std::unique_ptr<CPVT_WordProps> pWordProps; }; diff --git a/core/fpdfdoc/cpvt_wordprops.h b/core/fpdfdoc/cpvt_wordprops.h index 2b7084116a..2d0e5d51b3 100644 --- a/core/fpdfdoc/cpvt_wordprops.h +++ b/core/fpdfdoc/cpvt_wordprops.h @@ -22,12 +22,12 @@ struct CPVT_WordProps { nHorzScale(0) {} CPVT_WordProps(int32_t fontIndex, - FX_FLOAT fontSize, + float fontSize, FX_COLORREF wordColor = 0, CPDF_VariableText::ScriptType scriptType = CPDF_VariableText::ScriptType::Normal, int32_t wordStyle = 0, - FX_FLOAT charSpace = 0, + float charSpace = 0, int32_t horzScale = 100) : nFontIndex(fontIndex), fFontSize(fontSize), @@ -47,11 +47,11 @@ struct CPVT_WordProps { nHorzScale(other.nHorzScale) {} int32_t nFontIndex; - FX_FLOAT fFontSize; + float fFontSize; FX_COLORREF dwWordColor; CPDF_VariableText::ScriptType nScriptType; int32_t nWordStyle; - FX_FLOAT fCharSpace; + float fCharSpace; int32_t nHorzScale; }; diff --git a/core/fpdfdoc/csection.cpp b/core/fpdfdoc/csection.cpp index 490ef1b230..ce78418dc5 100644 --- a/core/fpdfdoc/csection.cpp +++ b/core/fpdfdoc/csection.cpp @@ -65,7 +65,7 @@ CPVT_FloatRect CSection::Rearrange() { return CTypeset(this).Typeset(); } -CFX_SizeF CSection::GetSectionSize(FX_FLOAT fFontSize) { +CFX_SizeF CSection::GetSectionSize(float fFontSize) { return CTypeset(this).GetEditSize(fFontSize); } @@ -154,8 +154,8 @@ CPVT_WordPlace CSection::SearchWordPlace(const CFX_PointF& point) const { int32_t nLeft = 0; int32_t nRight = m_LineArray.GetSize() - 1; int32_t nMid = m_LineArray.GetSize() / 2; - FX_FLOAT fTop = 0; - FX_FLOAT fBottom = 0; + float fTop = 0; + float fBottom = 0; while (nLeft <= nRight) { if (CLine* pLine = m_LineArray.GetAt(nMid)) { fTop = pLine->m_LineInfo.fLineY - pLine->m_LineInfo.fLineAscent - @@ -195,7 +195,7 @@ CPVT_WordPlace CSection::SearchWordPlace(const CFX_PointF& point) const { } CPVT_WordPlace CSection::SearchWordPlace( - FX_FLOAT fx, + float fx, const CPVT_WordPlace& lineplace) const { if (CLine* pLine = m_LineArray.GetAt(lineplace.nLineIndex)) { return SearchWordPlace( @@ -206,7 +206,7 @@ CPVT_WordPlace CSection::SearchWordPlace( return GetBeginWordPlace(); } -CPVT_WordPlace CSection::SearchWordPlace(FX_FLOAT fx, +CPVT_WordPlace CSection::SearchWordPlace(float fx, const CPVT_WordRange& range) const { CPVT_WordPlace wordplace = range.BeginPos; wordplace.nWordIndex = -1; diff --git a/core/fpdfdoc/csection.h b/core/fpdfdoc/csection.h index a2ac43b102..b82409dc6f 100644 --- a/core/fpdfdoc/csection.h +++ b/core/fpdfdoc/csection.h @@ -33,17 +33,16 @@ class CSection final { void ClearWords(const CPVT_WordRange& PlaceRange); void ClearWord(const CPVT_WordPlace& place); CPVT_FloatRect Rearrange(); - CFX_SizeF GetSectionSize(FX_FLOAT fFontSize); + CFX_SizeF GetSectionSize(float fFontSize); CPVT_WordPlace GetBeginWordPlace() const; CPVT_WordPlace GetEndWordPlace() const; CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace& place) const; CPVT_WordPlace GetNextWordPlace(const CPVT_WordPlace& place) const; void UpdateWordPlace(CPVT_WordPlace& place) const; CPVT_WordPlace SearchWordPlace(const CFX_PointF& point) const; - CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, + CPVT_WordPlace SearchWordPlace(float fx, const CPVT_WordPlace& lineplace) const; - CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, - const CPVT_WordRange& range) const; + CPVT_WordPlace SearchWordPlace(float fx, const CPVT_WordRange& range) const; CPVT_WordPlace SecPlace; CPVT_SectionInfo m_SecInfo; diff --git a/core/fpdfdoc/ctypeset.cpp b/core/fpdfdoc/ctypeset.cpp index 452143e682..6cfaff5cc8 100644 --- a/core/fpdfdoc/ctypeset.cpp +++ b/core/fpdfdoc/ctypeset.cpp @@ -180,16 +180,16 @@ CTypeset::~CTypeset() {} CPVT_FloatRect CTypeset::CharArray() { ASSERT(m_pSection); - FX_FLOAT fLineAscent = + float fLineAscent = m_pVT->GetFontAscent(m_pVT->GetDefaultFontIndex(), m_pVT->GetFontSize()); - FX_FLOAT fLineDescent = + float fLineDescent = m_pVT->GetFontDescent(m_pVT->GetDefaultFontIndex(), m_pVT->GetFontSize()); m_rcRet.Default(); - FX_FLOAT x = 0.0f, y = 0.0f; - FX_FLOAT fNextWidth; + float x = 0.0f, y = 0.0f; + float fNextWidth; int32_t nStart = 0; - FX_FLOAT fNodeWidth = m_pVT->GetPlateWidth() / - (m_pVT->m_nCharArray <= 0 ? 1 : m_pVT->m_nCharArray); + float fNodeWidth = m_pVT->GetPlateWidth() / + (m_pVT->m_nCharArray <= 0 ? 1 : m_pVT->m_nCharArray); if (CLine* pLine = m_pSection->m_LineArray.GetAt(0)) { x = 0.0f; y += m_pVT->GetLineLeading(m_pSection->m_SecInfo); @@ -221,11 +221,11 @@ CPVT_FloatRect CTypeset::CharArray() { } if (CPVT_WordInfo* pWord = m_pSection->m_WordArray.GetAt(w)) { pWord->fWordTail = 0; - FX_FLOAT fWordWidth = m_pVT->GetWordWidth(*pWord); - FX_FLOAT fWordAscent = m_pVT->GetWordAscent(*pWord); - FX_FLOAT fWordDescent = m_pVT->GetWordDescent(*pWord); - x = (FX_FLOAT)(fNodeWidth * (w + nStart + 0.5) - - fWordWidth * VARIABLETEXT_HALF); + float fWordWidth = m_pVT->GetWordWidth(*pWord); + float fWordAscent = m_pVT->GetWordAscent(*pWord); + float fWordDescent = m_pVT->GetWordDescent(*pWord); + x = (float)(fNodeWidth * (w + nStart + 0.5) - + fWordWidth * VARIABLETEXT_HALF); pWord->fWordX = x; pWord->fWordY = y; if (w == 0) { @@ -255,7 +255,7 @@ CPVT_FloatRect CTypeset::CharArray() { return m_rcRet = CPVT_FloatRect(0, 0, x, y); } -CFX_SizeF CTypeset::GetEditSize(FX_FLOAT fFontSize) { +CFX_SizeF CTypeset::GetEditSize(float fFontSize) { ASSERT(m_pSection); ASSERT(m_pVT); SplitLines(false, fFontSize); @@ -271,22 +271,22 @@ CPVT_FloatRect CTypeset::Typeset() { return m_rcRet; } -void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize) { +void CTypeset::SplitLines(bool bTypeset, float fFontSize) { ASSERT(m_pVT); ASSERT(m_pSection); int32_t nLineHead = 0; int32_t nLineTail = 0; - FX_FLOAT fMaxX = 0.0f, fMaxY = 0.0f; - FX_FLOAT fLineWidth = 0.0f, fBackupLineWidth = 0.0f; - FX_FLOAT fLineAscent = 0.0f, fBackupLineAscent = 0.0f; - FX_FLOAT fLineDescent = 0.0f, fBackupLineDescent = 0.0f; + float fMaxX = 0.0f, fMaxY = 0.0f; + float fLineWidth = 0.0f, fBackupLineWidth = 0.0f; + float fLineAscent = 0.0f, fBackupLineAscent = 0.0f; + float fLineDescent = 0.0f, fBackupLineDescent = 0.0f; int32_t nWordStartPos = 0; bool bFullWord = false; int32_t nLineFullWordIndex = 0; int32_t nCharIndex = 0; CPVT_LineInfo line; - FX_FLOAT fWordWidth = 0; - FX_FLOAT fTypesetWidth = std::max( + float fWordWidth = 0; + float fTypesetWidth = std::max( m_pVT->GetPlateWidth() - m_pVT->GetLineIndent(m_pSection->m_SecInfo), 0.0f); int32_t nTotalWords = m_pSection->m_WordArray.GetSize(); @@ -420,10 +420,10 @@ void CTypeset::SplitLines(bool bTypeset, FX_FLOAT fFontSize) { void CTypeset::OutputLines() { ASSERT(m_pVT); ASSERT(m_pSection); - FX_FLOAT fMinX = 0.0f, fMinY = 0.0f, fMaxX = 0.0f, fMaxY = 0.0f; - FX_FLOAT fPosX = 0.0f, fPosY = 0.0f; - FX_FLOAT fLineIndent = m_pVT->GetLineIndent(m_pSection->m_SecInfo); - FX_FLOAT fTypesetWidth = std::max(m_pVT->GetPlateWidth() - fLineIndent, 0.0f); + float fMinX = 0.0f, fMinY = 0.0f, fMaxX = 0.0f, fMaxY = 0.0f; + float fPosX = 0.0f, fPosY = 0.0f; + float fLineIndent = m_pVT->GetLineIndent(m_pSection->m_SecInfo); + float fTypesetWidth = std::max(m_pVT->GetPlateWidth() - fLineIndent, 0.0f); switch (m_pVT->GetAlignment(m_pSection->m_SecInfo)) { default: case 0: diff --git a/core/fpdfdoc/ctypeset.h b/core/fpdfdoc/ctypeset.h index 4161c03b42..f769fe1311 100644 --- a/core/fpdfdoc/ctypeset.h +++ b/core/fpdfdoc/ctypeset.h @@ -18,12 +18,12 @@ class CTypeset final { explicit CTypeset(CSection* pSection); ~CTypeset(); - CFX_SizeF GetEditSize(FX_FLOAT fFontSize); + CFX_SizeF GetEditSize(float fFontSize); CPVT_FloatRect Typeset(); CPVT_FloatRect CharArray(); private: - void SplitLines(bool bTypeset, FX_FLOAT fFontSize); + void SplitLines(bool bTypeset, float fFontSize); void OutputLines(); CPVT_FloatRect m_rcRet; diff --git a/core/fpdfdoc/doc_tagged.cpp b/core/fpdfdoc/doc_tagged.cpp index af5cf85938..418fab411a 100644 --- a/core/fpdfdoc/doc_tagged.cpp +++ b/core/fpdfdoc/doc_tagged.cpp @@ -291,7 +291,7 @@ void CPDF_StructElement::LoadKid(uint32_t PageObjNum, } static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, const CFX_ByteStringC& owner, - FX_FLOAT nLevel = 0.0F) { + float nLevel = 0.0F) { if (nLevel > nMaxRecursion) return nullptr; if (!pAttrs) @@ -317,7 +317,7 @@ static CPDF_Dictionary* FindAttrDict(CPDF_Object* pAttrs, CPDF_Object* CPDF_StructElement::GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable, - FX_FLOAT fLevel) { + float fLevel) { if (fLevel > nMaxRecursion) { return nullptr; } @@ -400,11 +400,11 @@ FX_ARGB CPDF_StructElement::GetColor(const CFX_ByteStringC& owner, ((int)(pArray->GetNumberAt(1) * 255) << 8) | (int)(pArray->GetNumberAt(2) * 255); } -FX_FLOAT CPDF_StructElement::GetNumber(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - FX_FLOAT default_value, - bool bInheritable, - int subindex) { +float CPDF_StructElement::GetNumber(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + float default_value, + bool bInheritable, + int subindex) { CPDF_Object* pAttr = GetAttr(owner, name, bInheritable, subindex); return ToNumber(pAttr) ? pAttr->GetNumber() : default_value; } diff --git a/core/fpdfdoc/fpdf_tagged.h b/core/fpdfdoc/fpdf_tagged.h index fbbb49f856..5e7b1827c5 100644 --- a/core/fpdfdoc/fpdf_tagged.h +++ b/core/fpdfdoc/fpdf_tagged.h @@ -42,7 +42,7 @@ class IPDF_StructElement { virtual CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable = false, - FX_FLOAT fLevel = 0.0F) = 0; + float fLevel = 0.0F) = 0; virtual CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, @@ -56,11 +56,11 @@ class IPDF_StructElement { bool bInheritable = false, int subindex = -1) = 0; - virtual FX_FLOAT GetNumber(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - FX_FLOAT default_value, - bool bInheritable = false, - int subindex = -1) = 0; + virtual float GetNumber(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + float default_value, + bool bInheritable = false, + int subindex = -1) = 0; virtual int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, diff --git a/core/fpdfdoc/tagged_int.h b/core/fpdfdoc/tagged_int.h index ce246023df..cafcbd42aa 100644 --- a/core/fpdfdoc/tagged_int.h +++ b/core/fpdfdoc/tagged_int.h @@ -73,7 +73,7 @@ class CPDF_StructElement final : public CFX_Retainable, CPDF_Object* GetAttr(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, bool bInheritable = false, - FX_FLOAT fLevel = 0.0F) override; + float fLevel = 0.0F) override; CFX_ByteString GetName(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, const CFX_ByteStringC& default_value, @@ -84,11 +84,11 @@ class CPDF_StructElement final : public CFX_Retainable, FX_ARGB default_value, bool bInheritable = false, int subindex = -1) override; - FX_FLOAT GetNumber(const CFX_ByteStringC& owner, - const CFX_ByteStringC& name, - FX_FLOAT default_value, - bool bInheritable = false, - int subindex = -1) override; + float GetNumber(const CFX_ByteStringC& owner, + const CFX_ByteStringC& name, + float default_value, + bool bInheritable = false, + int subindex = -1) override; int GetInteger(const CFX_ByteStringC& owner, const CFX_ByteStringC& name, int default_value, |