summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp13
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.h8
2 files changed, 10 insertions, 11 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 9e9c450c7d..3bd40d5b7c 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -256,14 +256,12 @@ CPDF_StreamContentParser::CPDF_StreamContentParser(
m_ParamStartPos(0),
m_ParamCount(0),
m_pCurStates(pdfium::MakeUnique<CPDF_AllStates>()),
- m_pLastTextObject(nullptr),
m_DefFontSize(0),
m_PathStartX(0.0f),
m_PathStartY(0.0f),
m_PathCurrentX(0.0f),
m_PathCurrentY(0.0f),
m_PathClipType(0),
- m_pLastImage(nullptr),
m_bColored(false),
m_bResourceMissing(false) {
if (pmtContentToUser)
@@ -412,12 +410,12 @@ float CPDF_StreamContentParser::GetNumber(uint32_t index) {
}
ContentParam& param = m_ParamBuf[real_index];
if (param.m_Type == ContentParam::NUMBER) {
- return param.m_Number.m_bInteger ? (float)param.m_Number.m_Integer
- : param.m_Number.m_Float;
+ return param.m_Number.m_bInteger
+ ? static_cast<float>(param.m_Number.m_Integer)
+ : param.m_Number.m_Float;
}
- if (param.m_Type == 0 && param.m_pObject) {
+ if (param.m_Type == 0 && param.m_pObject)
return param.m_pObject->GetNumber();
- }
return 0;
}
@@ -1619,7 +1617,8 @@ void CPDF_StreamContentParser::ParsePathObject() {
int value;
bool bInteger = FX_atonum(m_pSyntax->GetWord(), &value);
- params[nParams++] = bInteger ? (float)value : *(float*)&value;
+ params[nParams++] = bInteger ? static_cast<float>(value)
+ : *reinterpret_cast<float*>(&value);
break;
}
default:
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index e905c937b3..de4a92fc99 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.h
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.h
@@ -194,11 +194,11 @@ class CPDF_StreamContentParser {
void Handle_Invalid();
UnownedPtr<CPDF_Document> const m_pDocument;
- UnownedPtr<CPDF_Dictionary> m_pPageResources;
- UnownedPtr<CPDF_Dictionary> m_pParentResources;
+ UnownedPtr<CPDF_Dictionary> const m_pPageResources;
+ UnownedPtr<CPDF_Dictionary> const m_pParentResources;
UnownedPtr<CPDF_Dictionary> m_pResources;
- UnownedPtr<CPDF_PageObjectHolder> m_pObjectHolder;
- UnownedPtr<std::set<const uint8_t*>> m_ParsedSet;
+ UnownedPtr<CPDF_PageObjectHolder> const m_pObjectHolder;
+ UnownedPtr<std::set<const uint8_t*>> const m_ParsedSet;
CFX_Matrix m_mtContentToUser;
const CFX_FloatRect m_BBox;
ContentParam m_ParamBuf[kParamBufSize];