summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-14 15:50:28 -0800
committerLei Zhang <thestig@chromium.org>2015-12-14 15:50:28 -0800
commit1956a174020686f91cd3b34294e91f4560fe45aa (patch)
tree25b21d226c9031e1a0748ddcc455214185585668 /core/src/fpdfapi/fpdf_render
parent1407c979a3ba8599546468d461f5403f317bddd3 (diff)
downloadpdfium-1956a174020686f91cd3b34294e91f4560fe45aa.tar.xz
Remove FX_BSTRC.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1521563002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp42
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp45
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp27
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp3
5 files changed, 61 insertions, 72 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
index faf6afe7f6..d7c3b6e6e8 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -444,8 +444,7 @@ void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj,
if (pObj->m_Type == PDFPAGE_FORM) {
CPDF_FormObject* pFormObj = (CPDF_FormObject*)pObj;
if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
- pFormResource =
- pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ pFormResource = pFormObj->m_pForm->m_pFormDict->GetDict("Resources");
}
}
CPDF_RenderStatus status;
@@ -457,8 +456,7 @@ void CPDF_RenderStatus::DrawObjWithBackground(const CPDF_PageObject* pObj,
}
FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj,
const CFX_Matrix* pObj2Device) {
- CPDF_Dictionary* pOC =
- pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("OC"));
+ CPDF_Dictionary* pOC = pFormObj->m_pForm->m_pFormDict->GetDict("OC");
if (pOC && m_Options.m_pOCContext &&
!m_Options.m_pOCContext->CheckOCGVisible(pOC)) {
return TRUE;
@@ -467,7 +465,7 @@ FX_BOOL CPDF_RenderStatus::ProcessForm(CPDF_FormObject* pFormObj,
matrix.Concat(*pObj2Device);
CPDF_Dictionary* pResources = NULL;
if (pFormObj->m_pForm && pFormObj->m_pForm->m_pFormDict) {
- pResources = pFormObj->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ pResources = pFormObj->m_pForm->m_pFormDict->GetDict("Resources");
}
CPDF_RenderStatus status;
status.Initialize(m_pContext, m_pDevice, NULL, m_pStopObj, this, pFormObj,
@@ -731,9 +729,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
pGeneralState ? ToDictionary(pGeneralState->m_pSoftMask) : NULL;
if (pSMaskDict) {
if (pPageObj->m_Type == PDFPAGE_IMAGE &&
- ((CPDF_ImageObject*)pPageObj)
- ->m_pImage->GetDict()
- ->KeyExist(FX_BSTRC("SMask"))) {
+ ((CPDF_ImageObject*)pPageObj)->m_pImage->GetDict()->KeyExist("SMask")) {
pSMaskDict = NULL;
}
}
@@ -775,7 +771,7 @@ FX_BOOL CPDF_RenderStatus::ProcessTransparency(const CPDF_PageObject* pPageObj,
CPDF_Object* pCSObj = ((CPDF_ImageObject*)pPageObj)
->m_pImage->GetStream()
->GetDict()
- ->GetElementValue(FX_BSTRC("ColorSpace"));
+ ->GetElementValue("ColorSpace");
CPDF_ColorSpace* pColorSpace =
pDocument->LoadColorSpace(pCSObj, pPageResources);
if (pColorSpace) {
@@ -1414,7 +1410,7 @@ FX_BOOL IPDF_OCContext::CheckObjectVisible(const CPDF_PageObject* pObj) {
int nItems = pData->CountItems();
for (int i = 0; i < nItems; i++) {
CPDF_ContentMarkItem& item = pData->GetItem(i);
- if (item.GetName() == FX_BSTRC("OC") &&
+ if (item.GetName() == "OC" &&
item.GetParamType() == CPDF_ContentMarkItem::PropertiesDict) {
CPDF_Dictionary* pOCG =
ToDictionary(static_cast<CPDF_Object*>(item.GetParam()));
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 81efc956a2..1d1c392af5 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -409,19 +409,17 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() {
if (m_pRenderStatus->m_pDevice->GetDeviceClass() != FXDC_DISPLAY) {
CPDF_Object* pFilters =
m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(
- FX_BSTRC("Filter"));
+ "Filter");
if (pFilters) {
if (pFilters->IsName()) {
CFX_ByteStringC bsDecodeType = pFilters->GetConstString();
- if (bsDecodeType == FX_BSTRC("DCTDecode") ||
- bsDecodeType == FX_BSTRC("JPXDecode")) {
+ if (bsDecodeType == "DCTDecode" || bsDecodeType == "JPXDecode") {
m_Flags |= FXRENDER_IMAGE_LOSSY;
}
} else if (CPDF_Array* pArray = pFilters->AsArray()) {
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
CFX_ByteStringC bsDecodeType = pArray->GetConstString(i);
- if (bsDecodeType == FX_BSTRC("DCTDecode") ||
- bsDecodeType == FX_BSTRC("JPXDecode")) {
+ if (bsDecodeType == "DCTDecode" || bsDecodeType == "JPXDecode") {
m_Flags |= FXRENDER_IMAGE_LOSSY;
break;
}
@@ -455,7 +453,7 @@ FX_BOOL CPDF_ImageRenderer::StartRenderDIBSource() {
CPDF_Dictionary* pPageResources = pPage ? pPage->m_pPageResources : NULL;
CPDF_Object* pCSObj =
m_pImageObject->m_pImage->GetStream()->GetDict()->GetElementValue(
- FX_BSTRC("ColorSpace"));
+ "ColorSpace");
CPDF_ColorSpace* pColorSpace =
pDocument->LoadColorSpace(pCSObj, pPageResources);
if (pColorSpace) {
@@ -925,17 +923,17 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj,
m_ClipLeft = result_rect.left - image_rect.left;
m_ClipTop = result_rect.top - image_rect.top;
CPDF_Dictionary* pDict = pImageObj->m_pImage->GetDict();
- if (pDict->GetInteger(FX_BSTRC("BitsPerComponent")) != 8) {
+ if (pDict->GetInteger("BitsPerComponent") != 8) {
return FALSE;
}
- if (pDict->KeyExist(FX_BSTRC("SMask")) || pDict->KeyExist(FX_BSTRC("Mask"))) {
+ if (pDict->KeyExist("SMask") || pDict->KeyExist("Mask")) {
return FALSE;
}
- m_SrcWidth = pDict->GetInteger(FX_BSTRC("Width"));
- m_SrcHeight = pDict->GetInteger(FX_BSTRC("Height"));
+ m_SrcWidth = pDict->GetInteger("Width");
+ m_SrcHeight = pDict->GetInteger("Height");
m_pCS = NULL;
m_Bpp = 3;
- CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ CPDF_Object* pCSObj = pDict->GetElementValue("ColorSpace");
if (pCSObj == NULL) {
return FALSE;
}
@@ -956,13 +954,12 @@ FX_BOOL CPDF_QuickStretcher::Start(CPDF_ImageObject* pImageObj,
TRUE);
m_pDecoder = NULL;
if (!m_StreamAcc.GetImageDecoder().IsEmpty()) {
- if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("DCTDecode")) {
+ if (m_StreamAcc.GetImageDecoder() == "DCTDecode") {
const CPDF_Dictionary* pParam = m_StreamAcc.GetImageParam();
m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight,
- m_Bpp,
- pParam ? pParam->GetInteger(FX_BSTRC("ColorTransform"), 1) : 1);
- } else if (m_StreamAcc.GetImageDecoder() == FX_BSTRC("FlateDecode")) {
+ m_Bpp, pParam ? pParam->GetInteger("ColorTransform", 1) : 1);
+ } else if (m_StreamAcc.GetImageDecoder() == "FlateDecode") {
m_pDecoder = FPDFAPI_CreateFlateDecoder(
m_StreamAcc.GetData(), m_StreamAcc.GetSize(), m_SrcWidth, m_SrcHeight,
m_Bpp, 8, m_StreamAcc.GetImageParam());
@@ -1049,13 +1046,13 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
int width = pClipRect->right - pClipRect->left;
int height = pClipRect->bottom - pClipRect->top;
FX_BOOL bLuminosity = FALSE;
- bLuminosity = pSMaskDict->GetConstString(FX_BSTRC("S")) != FX_BSTRC("Alpha");
- CPDF_Stream* pGroup = pSMaskDict->GetStream(FX_BSTRC("G"));
+ bLuminosity = pSMaskDict->GetConstString("S") != "Alpha";
+ CPDF_Stream* pGroup = pSMaskDict->GetStream("G");
if (pGroup == NULL) {
return NULL;
}
nonstd::unique_ptr<CPDF_Function> pFunc;
- CPDF_Object* pFuncObj = pSMaskDict->GetElementValue(FX_BSTRC("TR"));
+ CPDF_Object* pFuncObj = pSMaskDict->GetElementValue("TR");
if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream()))
pFunc.reset(CPDF_Function::Load(pFuncObj));
@@ -1079,13 +1076,12 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
CPDF_Object* pCSObj = NULL;
CPDF_ColorSpace* pCS = NULL;
if (bLuminosity) {
- CPDF_Array* pBC = pSMaskDict->GetArray(FX_BSTRC("BC"));
+ CPDF_Array* pBC = pSMaskDict->GetArray("BC");
FX_ARGB back_color = 0xff000000;
if (pBC) {
CPDF_Dictionary* pDict = pGroup->GetDict();
- if (pDict && pDict->GetDict(FX_BSTRC("Group")))
- pCSObj =
- pDict->GetDict(FX_BSTRC("Group"))->GetElementValue(FX_BSTRC("CS"));
+ if (pDict && pDict->GetDict("Group"))
+ pCSObj = pDict->GetDict("Group")->GetElementValue("CS");
else
pCSObj = NULL;
pCS = m_pContext->m_pDocument->LoadColorSpace(pCSObj);
@@ -1119,7 +1115,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
}
CPDF_Dictionary* pFormResource = NULL;
if (form.m_pFormDict) {
- pFormResource = form.m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ pFormResource = form.m_pFormDict->GetDict("Resources");
}
CPDF_RenderOptions options;
options.m_ColorMode = bLuminosity ? RENDER_COLOR_NORMAL : RENDER_COLOR_ALPHA;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 675f361422..70d2340c22 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -221,8 +221,8 @@ FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc,
return FALSE;
}
m_pStream = pStream;
- m_Width = m_pDict->GetInteger(FX_BSTRC("Width"));
- m_Height = m_pDict->GetInteger(FX_BSTRC("Height"));
+ m_Width = m_pDict->GetInteger("Width");
+ m_Height = m_pDict->GetInteger("Height");
if (m_Width <= 0 || m_Height <= 0 || m_Width > kMaxImageDimension ||
m_Height > kMaxImageDimension) {
return FALSE;
@@ -341,8 +341,8 @@ int CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc,
m_pStream = pStream;
m_bStdCS = bStdCS;
m_bHasMask = bHasMask;
- m_Width = m_pDict->GetInteger(FX_BSTRC("Width"));
- m_Height = m_pDict->GetInteger(FX_BSTRC("Height"));
+ m_Width = m_pDict->GetInteger("Width");
+ m_Height = m_pDict->GetInteger("Height");
if (m_Width <= 0 || m_Height <= 0 || m_Width > kMaxImageDimension ||
m_Height > kMaxImageDimension) {
return 0;
@@ -397,7 +397,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) {
FXCODEC_STATUS ret;
if (m_Status == 1) {
const CFX_ByteString& decoder = m_pStreamAcc->GetImageDecoder();
- if (decoder == FX_BSTRC("JPXDecode")) {
+ if (decoder == "JPXDecode") {
return 0;
}
ICodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module();
@@ -405,7 +405,7 @@ int CPDF_DIBSource::ContinueLoadDIBSource(IFX_Pause* pPause) {
m_pJbig2Context = pJbig2Module->CreateJbig2Context();
if (m_pStreamAcc->GetImageParam()) {
CPDF_Stream* pGlobals =
- m_pStreamAcc->GetImageParam()->GetStream(FX_BSTRC("JBIG2Globals"));
+ m_pStreamAcc->GetImageParam()->GetStream("JBIG2Globals");
if (pGlobals) {
m_pGlobalStream = new CPDF_StreamAcc;
m_pGlobalStream->LoadAllData(pGlobals, FALSE);
@@ -487,7 +487,7 @@ bool CPDF_DIBSource::LoadColorInfo(const CPDF_Dictionary* pFormResources,
filter = pArray->GetString(pArray->GetCount() - 1);
}
- if (filter == FX_BSTRC("JPXDecode")) {
+ if (filter == "JPXDecode") {
m_bDoBpcCheck = FALSE;
return true;
}
@@ -536,7 +536,7 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode,
}
DIB_COMP_DATA* pCompData = FX_Alloc(DIB_COMP_DATA, m_nComponents);
int max_data = (1 << m_bpc) - 1;
- CPDF_Array* pDecode = m_pDict->GetArray(FX_BSTRC("Decode"));
+ CPDF_Array* pDecode = m_pDict->GetArray("Decode");
if (pDecode) {
for (FX_DWORD i = 0; i < m_nComponents; i++) {
pCompData[i].m_DecodeMin = pDecode->GetNumber(i * 2);
@@ -563,8 +563,8 @@ DIB_COMP_DATA* CPDF_DIBSource::GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode,
(pCompData[i].m_DecodeStep - pCompData[i].m_DecodeMin) / max_data;
}
}
- if (!m_pDict->KeyExist(FX_BSTRC("SMask"))) {
- CPDF_Object* pMask = m_pDict->GetElementValue(FX_BSTRC("Mask"));
+ if (!m_pDict->KeyExist("SMask")) {
+ CPDF_Object* pMask = m_pDict->GetElementValue("Mask");
if (pMask == NULL) {
return pCompData;
}
@@ -607,10 +607,10 @@ int CPDF_DIBSource::CreateDecoder() {
const uint8_t* src_data = m_pStreamAcc->GetData();
FX_DWORD src_size = m_pStreamAcc->GetSize();
const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam();
- if (decoder == FX_BSTRC("CCITTFaxDecode")) {
+ if (decoder == "CCITTFaxDecode") {
m_pDecoder = FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width, m_Height,
pParams);
- } else if (decoder == FX_BSTRC("DCTDecode")) {
+ } else if (decoder == "DCTDecode") {
m_pDecoder = CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
src_data, src_size, m_Width, m_Height, m_nComponents,
pParams ? pParams->GetInteger("ColorTransform", 1) : 1);
@@ -637,13 +637,13 @@ int CPDF_DIBSource::CreateDecoder() {
src_data, src_size, m_Width, m_Height, m_nComponents, bTransform);
}
}
- } else if (decoder == FX_BSTRC("FlateDecode")) {
+ } else if (decoder == "FlateDecode") {
m_pDecoder = FPDFAPI_CreateFlateDecoder(
src_data, src_size, m_Width, m_Height, m_nComponents, m_bpc, pParams);
- } else if (decoder == FX_BSTRC("JPXDecode")) {
+ } else if (decoder == "JPXDecode") {
LoadJpxBitmap();
return m_pCachedBitmap ? 1 : 0;
- } else if (decoder == FX_BSTRC("JBIG2Decode")) {
+ } else if (decoder == "JBIG2Decode") {
m_pCachedBitmap.reset(new CFX_DIBitmap);
if (!m_pCachedBitmap->Create(
m_Width, m_Height, m_bImageMask ? FXDIB_1bppMask : FXDIB_1bppRgb)) {
@@ -652,7 +652,7 @@ int CPDF_DIBSource::CreateDecoder() {
}
m_Status = 1;
return 2;
- } else if (decoder == FX_BSTRC("RunLengthDecode")) {
+ } else if (decoder == "RunLengthDecode") {
m_pDecoder = CPDF_ModuleMgr::Get()
->GetCodecModule()
->GetBasicModule()
@@ -760,9 +760,9 @@ void CPDF_DIBSource::LoadJpxBitmap() {
}
CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor) {
MatteColor = 0xFFFFFFFF;
- CPDF_Stream* pSoftMask = m_pDict->GetStream(FX_BSTRC("SMask"));
+ CPDF_Stream* pSoftMask = m_pDict->GetStream("SMask");
if (pSoftMask) {
- CPDF_Array* pMatte = pSoftMask->GetDict()->GetArray(FX_BSTRC("Matte"));
+ CPDF_Array* pMatte = pSoftMask->GetDict()->GetArray("Matte");
if (pMatte && m_pColorSpace &&
(FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
FX_FLOAT* pColor = FX_Alloc(FX_FLOAT, m_nComponents);
@@ -778,17 +778,16 @@ CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor) {
return LoadMaskDIB(pSoftMask);
}
- if (CPDF_Stream* pStream =
- ToStream(m_pDict->GetElementValue(FX_BSTRC("Mask"))))
+ if (CPDF_Stream* pStream = ToStream(m_pDict->GetElementValue("Mask")))
return LoadMaskDIB(pStream);
return nullptr;
}
int CPDF_DIBSource::StratLoadMask() {
m_MatteColor = 0XFFFFFFFF;
- m_pMaskStream = m_pDict->GetStream(FX_BSTRC("SMask"));
+ m_pMaskStream = m_pDict->GetStream("SMask");
if (m_pMaskStream) {
- CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArray(FX_BSTRC("Matte"));
+ CPDF_Array* pMatte = m_pMaskStream->GetDict()->GetArray("Matte");
if (pMatte != NULL && m_pColorSpace &&
(FX_DWORD)m_pColorSpace->CountComponents() <= m_nComponents) {
FX_FLOAT R, G, B;
@@ -804,7 +803,7 @@ int CPDF_DIBSource::StratLoadMask() {
return StartLoadMaskDIB();
}
- m_pMaskStream = ToStream(m_pDict->GetElementValue(FX_BSTRC("Mask")));
+ m_pMaskStream = ToStream(m_pDict->GetElementValue("Mask"));
return m_pMaskStream ? StartLoadMaskDIB() : 1;
}
int CPDF_DIBSource::ContinueLoadMaskDIB(IFX_Pause* pPause) {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 193c2ae05a..8b6c0d1fd1 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -20,7 +20,7 @@ static void DrawAxialShading(CFX_DIBitmap* pBitmap,
CPDF_ColorSpace* pCS,
int alpha) {
ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Array* pCoords = pDict->GetArray(FX_BSTRC("Coords"));
+ CPDF_Array* pCoords = pDict->GetArray("Coords");
if (pCoords == NULL) {
return;
}
@@ -29,13 +29,13 @@ static void DrawAxialShading(CFX_DIBitmap* pBitmap,
FX_FLOAT end_x = pCoords->GetNumber(2);
FX_FLOAT end_y = pCoords->GetNumber(3);
FX_FLOAT t_min = 0, t_max = 1.0f;
- CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Domain"));
+ CPDF_Array* pArray = pDict->GetArray("Domain");
if (pArray) {
t_min = pArray->GetNumber(0);
t_max = pArray->GetNumber(1);
}
FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
- pArray = pDict->GetArray(FX_BSTRC("Extend"));
+ pArray = pDict->GetArray("Extend");
if (pArray) {
bStartExtend = pArray->GetInteger(0);
bEndExtend = pArray->GetInteger(1);
@@ -111,7 +111,7 @@ static void DrawRadialShading(CFX_DIBitmap* pBitmap,
CPDF_ColorSpace* pCS,
int alpha) {
ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Array* pCoords = pDict->GetArray(FX_BSTRC("Coords"));
+ CPDF_Array* pCoords = pDict->GetArray("Coords");
if (pCoords == NULL) {
return;
}
@@ -124,13 +124,13 @@ static void DrawRadialShading(CFX_DIBitmap* pBitmap,
CFX_Matrix matrix;
matrix.SetReverse(*pObject2Bitmap);
FX_FLOAT t_min = 0, t_max = 1.0f;
- CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Domain"));
+ CPDF_Array* pArray = pDict->GetArray("Domain");
if (pArray) {
t_min = pArray->GetNumber(0);
t_max = pArray->GetNumber(1);
}
FX_BOOL bStartExtend = FALSE, bEndExtend = FALSE;
- pArray = pDict->GetArray(FX_BSTRC("Extend"));
+ pArray = pDict->GetArray("Extend");
if (pArray) {
bStartExtend = pArray->GetInteger(0);
bEndExtend = pArray->GetInteger(1);
@@ -249,7 +249,7 @@ static void DrawFuncShading(CFX_DIBitmap* pBitmap,
CPDF_ColorSpace* pCS,
int alpha) {
ASSERT(pBitmap->GetFormat() == FXDIB_Argb);
- CPDF_Array* pDomain = pDict->GetArray(FX_BSTRC("Domain"));
+ CPDF_Array* pDomain = pDict->GetArray("Domain");
FX_FLOAT xmin = 0, ymin = 0, xmax = 1.0f, ymax = 1.0f;
if (pDomain) {
xmin = pDomain->GetNumber(0);
@@ -257,7 +257,7 @@ static void DrawFuncShading(CFX_DIBitmap* pBitmap,
ymin = pDomain->GetNumber(2);
ymax = pDomain->GetNumber(3);
}
- CFX_Matrix mtDomain2Target = pDict->GetMatrix(FX_BSTRC("Matrix"));
+ CFX_Matrix mtDomain2Target = pDict->GetMatrix("Matrix");
CFX_Matrix matrix, reverse_matrix;
matrix.SetReverse(*pObject2Bitmap);
reverse_matrix.SetReverse(mtDomain2Target);
@@ -839,9 +839,9 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
}
FX_ARGB background = 0;
if (!pPattern->m_bShadingObj &&
- pPattern->m_pShadingObj->GetDict()->KeyExist(FX_BSTRC("Background"))) {
+ pPattern->m_pShadingObj->GetDict()->KeyExist("Background")) {
CPDF_Array* pBackColor =
- pPattern->m_pShadingObj->GetDict()->GetArray(FX_BSTRC("Background"));
+ pPattern->m_pShadingObj->GetDict()->GetArray("Background");
if (pBackColor &&
pBackColor->GetCount() >= (FX_DWORD)pColorSpace->CountComponents()) {
CFX_FixedBufGrow<FX_FLOAT, 16> comps(pColorSpace->CountComponents());
@@ -854,8 +854,8 @@ void CPDF_RenderStatus::DrawShading(CPDF_ShadingPattern* pPattern,
(int32_t)(B * 255));
}
}
- if (pDict->KeyExist(FX_BSTRC("BBox"))) {
- CFX_FloatRect rect = pDict->GetRect(FX_BSTRC("BBox"));
+ if (pDict->KeyExist("BBox")) {
+ CFX_FloatRect rect = pDict->GetRect("BBox");
rect.Transform(pMatrix);
clip_rect.Intersect(rect.GetOutterRect());
}
@@ -1064,8 +1064,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
}
CPDF_Dictionary* pFormResource = NULL;
if (pPattern->m_pForm->m_pFormDict) {
- pFormResource =
- pPattern->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ pFormResource = pPattern->m_pForm->m_pFormDict->GetDict("Resources");
}
for (int col = min_col; col <= max_col; col++)
for (int row = min_row; row <= max_row; row++) {
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 227a208080..3a56058295 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -411,8 +411,7 @@ FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj,
Options.m_Flags &= ~RENDER_FORCE_DOWNSAMPLE;
CPDF_Dictionary* pFormResource = NULL;
if (pType3Char->m_pForm && pType3Char->m_pForm->m_pFormDict) {
- pFormResource =
- pType3Char->m_pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ pFormResource = pType3Char->m_pForm->m_pFormDict->GetDict("Resources");
}
if (fill_alpha == 255) {
CPDF_RenderStatus status;