summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-12-09 16:39:40 -0800
committerTom Sepez <tsepez@chromium.org>2015-12-09 16:39:40 -0800
commitbd573f126f93acc2034be2df1c6f571670f76c35 (patch)
treebeeea3b9370bb7490ed5933dadbef857cb8df23d /core/src/fpdfapi/fpdf_page
parente021e084717b8cc43f8a0667ad9d1a807dfe381c (diff)
downloadpdfium-bd573f126f93acc2034be2df1c6f571670f76c35.tar.xz
Merge to XFA: Get rid of most uses of CFX_PtrArray.
Original Review URL: https://codereview.chromium.org/1518593002 . (cherry picked from commit 035359cd8ddb555fa33b6133db4fd405e4660712) R=thestig@chromium.org TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1513103002 .
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: