summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-21 13:55:38 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-21 13:55:38 -0400
commit1c77edb7b34e03787605b7965784cea38ef9f1d7 (patch)
tree621c8d67cb3d5fd72bceed59e2e5a39c6e037fbe /core/src/fpdfapi/fpdf_render
parent53d3ab125ef583be8cfac907b308a6551b93067a (diff)
downloadpdfium-1c77edb7b34e03787605b7965784cea38ef9f1d7.tar.xz
Add type cast definitions for CPDF_Name.
This Cl adds ToName, CPDF_Object::AsName and CPDF_Object::IsName and updates the src to use them as needed. BUG=pdfium:201 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1417823005 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index e4afdd80c2..cdf2104f82 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -406,7 +406,7 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() {
m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(
FX_BSTRC("Filter"));
if (pFilters) {
- if (pFilters->GetType() == PDFOBJ_NAME) {
+ if (pFilters->IsName()) {
CFX_ByteStringC bsDecodeType = pFilters->GetConstString();
if (bsDecodeType == FX_BSTRC("DCTDecode") ||
bsDecodeType == FX_BSTRC("JPXDecode")) {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index c3029e0091..79b4bba162 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -476,7 +476,7 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources,
CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
if (pFilter) {
CFX_ByteString filter;
- if (pFilter->GetType() == PDFOBJ_NAME) {
+ if (pFilter->IsName()) {
filter = pFilter->GetString();
if (filter == FX_BSTRC("JPXDecode")) {
m_bDoBpcCheck = FALSE;
@@ -514,7 +514,7 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources,
}
m_Family = m_pColorSpace->GetFamily();
m_nComponents = m_pColorSpace->CountComponents();
- if (m_Family == PDFCS_ICCBASED && pCSObj->GetType() == PDFOBJ_NAME) {
+ if (m_Family == PDFCS_ICCBASED && pCSObj->IsName()) {
CFX_ByteString cs = pCSObj->GetString();
if (cs == FX_BSTRC("DeviceGray")) {
m_nComponents = 1;
@@ -939,7 +939,7 @@ void CPDF_DIBSource::ValidateDictParam() {
m_bpc = m_bpc_orig;
CPDF_Object* pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
if (pFilter) {
- if (pFilter->GetType() == PDFOBJ_NAME) {
+ if (pFilter->IsName()) {
CFX_ByteString filter = pFilter->GetString();
if (filter == FX_BSTRC("CCITTFaxDecode") ||
filter == FX_BSTRC("JBIG2Decode")) {