summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_page/pageint.h4
2 files changed, 6 insertions, 8 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 163b6e9d53..a2d4988f92 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -80,7 +80,7 @@ CPDF_StreamContentParser::CPDF_StreamContentParser(
CPDF_StreamContentParser::~CPDF_StreamContentParser() {
ClearAllParams();
for (int i = 0; i < m_StateStack.GetSize(); ++i) {
- delete (CPDF_AllStates*)m_StateStack[i];
+ delete m_StateStack[i];
}
FX_Free(m_pPathPoints);
if (m_pLastImageDict) {
@@ -819,12 +819,10 @@ void CPDF_StreamContentParser::Handle_EndText() {
}
if (m_pCurStates->m_TextState.GetObject()->m_TextMode < 4) {
for (int i = 0; i < count; i++) {
- CPDF_TextObject* pText = (CPDF_TextObject*)m_ClipTextList.GetAt(i);
- delete pText;
+ delete m_ClipTextList.GetAt(i);
}
} else {
- m_pCurStates->m_ClipPath.AppendTexts(
- (CPDF_TextObject**)m_ClipTextList.GetData(), count);
+ m_pCurStates->m_ClipPath.AppendTexts(m_ClipTextList.GetData(), count);
}
m_ClipTextList.RemoveAll();
}
@@ -950,7 +948,7 @@ void CPDF_StreamContentParser::Handle_RestoreGraphState() {
if (size == 0) {
return;
}
- CPDF_AllStates* pStates = (CPDF_AllStates*)m_StateStack.GetAt(size - 1);
+ CPDF_AllStates* pStates = m_StateStack.GetAt(size - 1);
m_pCurStates->Copy(*pStates);
delete pStates;
m_StateStack.RemoveAt(size - 1);
diff --git a/core/src/fpdfapi/fpdf_page/pageint.h b/core/src/fpdfapi/fpdf_page/pageint.h
index 96c70c2245..208a09b8d8 100644
--- a/core/src/fpdfapi/fpdf_page/pageint.h
+++ b/core/src/fpdfapi/fpdf_page/pageint.h
@@ -321,7 +321,7 @@ class CPDF_StreamContentParser {
CPDF_StreamParser* m_pSyntax;
nonstd::unique_ptr<CPDF_AllStates> m_pCurStates;
CPDF_ContentMark m_CurContentMark;
- CFX_PtrArray m_ClipTextList;
+ CFX_ArrayTemplate<CPDF_TextObject*> m_ClipTextList;
CPDF_TextObject* m_pLastTextObject;
FX_FLOAT m_DefFontSize;
int m_CompatCount;
@@ -344,7 +344,7 @@ class CPDF_StreamContentParser {
FX_BOOL m_bColored;
FX_FLOAT m_Type3Data[6];
FX_BOOL m_bResourceMissing;
- CFX_PtrArray m_StateStack;
+ CFX_ArrayTemplate<CPDF_AllStates*> m_StateStack;
};
class CPDF_ContentParser {
public: