Replace |CPDF_StreamContentParser::m_DefFontSize| with a constant.
It is alway set to 0.
Change-Id: If0919dccf068700656287e0d74c6d860eff33fee
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/61590
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 8885760..83ed23d 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -269,7 +269,6 @@
m_ParamStartPos(0),
m_ParamCount(0),
m_pCurStates(pdfium::MakeUnique<CPDF_AllStates>()),
- m_DefFontSize(0),
m_PathStartX(0.0f),
m_PathStartY(0.0f),
m_PathCurrentX(0.0f),
@@ -1125,8 +1124,10 @@
void CPDF_StreamContentParser::Handle_SetFont() {
float fs = GetNumber(0);
- if (fs == 0)
- fs = m_DefFontSize;
+ if (fs == 0) {
+ constexpr float kDefaultFontSize = 0.0f;
+ fs = kDefaultFontSize;
+ }
m_pCurStates->m_TextState.SetFontSize(fs);
RetainPtr<CPDF_Font> pFont = FindFont(GetString(1));
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index cd47938..ae05968 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.h
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.h
@@ -217,7 +217,6 @@
std::stack<std::unique_ptr<CPDF_ContentMarks>> m_ContentMarksStack;
std::vector<std::unique_ptr<CPDF_TextObject>> m_ClipTextList;
UnownedPtr<CPDF_TextObject> m_pLastTextObject;
- float m_DefFontSize;
std::vector<FX_PATHPOINT> m_PathPoints;
float m_PathStartX;
float m_PathStartY;