summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-14 16:58:33 -0800
committerLei Zhang <thestig@chromium.org>2015-12-14 16:58:33 -0800
commitd983b09c3ae29a97cba8e9ec9c6351545f6087ee (patch)
tree5641a4bc6eddaa8069904c29c3e3897043411646 /core/src/fpdfapi/fpdf_page
parentf86d3f946e2f1977c7eaea01dcb9d7ecb3064cd1 (diff)
downloadpdfium-d983b09c3ae29a97cba8e9ec9c6351545f6087ee.tar.xz
Merge to XFA: Remove FX_BSTRC.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1521563002 . (cherry picked from commit 1956a174020686f91cd3b34294e91f4560fe45aa) Review URL: https://codereview.chromium.org/1526823002 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp20
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp37
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp28
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp36
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp15
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp11
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp53
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp64
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp31
9 files changed, 141 insertions, 154 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 45b796ce86..f37dd770ca 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -761,18 +761,18 @@ void CPDF_PageObjects::LoadTransInfo() {
if (m_pFormDict == NULL) {
return;
}
- CPDF_Dictionary* pGroup = m_pFormDict->GetDict(FX_BSTRC("Group"));
+ CPDF_Dictionary* pGroup = m_pFormDict->GetDict("Group");
if (pGroup == NULL) {
return;
}
- if (pGroup->GetString(FX_BSTRC("S")) != FX_BSTRC("Transparency")) {
+ if (pGroup->GetString("S") != "Transparency") {
return;
}
m_Transparency |= PDFTRANS_GROUP;
- if (pGroup->GetInteger(FX_BSTRC("I"))) {
+ if (pGroup->GetInteger("I")) {
m_Transparency |= PDFTRANS_ISOLATED;
}
- if (pGroup->GetInteger(FX_BSTRC("K"))) {
+ if (pGroup->GetInteger("K")) {
m_Transparency |= PDFTRANS_KNOCKOUT;
}
}
@@ -805,10 +805,10 @@ void CPDF_Page::Load(CPDF_Document* pDocument,
m_pPageResources = m_pResources = NULL;
return;
}
- CPDF_Object* pageAttr = GetPageAttr(FX_BSTRC("Resources"));
+ CPDF_Object* pageAttr = GetPageAttr("Resources");
m_pResources = pageAttr ? pageAttr->GetDict() : NULL;
m_pPageResources = m_pResources;
- CPDF_Object* pRotate = GetPageAttr(FX_BSTRC("Rotate"));
+ CPDF_Object* pRotate = GetPageAttr("Rotate");
int rotate = 0;
if (pRotate) {
rotate = pRotate->GetInteger() / 90 % 4;
@@ -816,7 +816,7 @@ void CPDF_Page::Load(CPDF_Document* pDocument,
if (rotate < 0) {
rotate += 4;
}
- CPDF_Array* pMediaBox = ToArray(GetPageAttr(FX_BSTRC("MediaBox")));
+ CPDF_Array* pMediaBox = ToArray(GetPageAttr("MediaBox"));
CFX_FloatRect mediabox;
if (pMediaBox) {
mediabox = pMediaBox->GetRect();
@@ -826,7 +826,7 @@ void CPDF_Page::Load(CPDF_Document* pDocument,
mediabox = CFX_FloatRect(0, 0, 612, 792);
}
- CPDF_Array* pCropBox = ToArray(GetPageAttr(FX_BSTRC("CropBox")));
+ CPDF_Array* pCropBox = ToArray(GetPageAttr("CropBox"));
if (pCropBox) {
m_BBox = pCropBox->GetRect();
m_BBox.Normalize();
@@ -889,7 +889,7 @@ CPDF_Object* FPDFAPI_GetPageAttr(CPDF_Dictionary* pPageDict,
if (pObj) {
return pObj;
}
- CPDF_Dictionary* pParent = pPageDict->GetDict(FX_BSTRC("Parent"));
+ CPDF_Dictionary* pParent = pPageDict->GetDict("Parent");
if (!pParent || pParent == pPageDict) {
return NULL;
}
@@ -910,7 +910,7 @@ CPDF_Form::CPDF_Form(CPDF_Document* pDoc,
m_pDocument = pDoc;
m_pFormStream = pFormStream;
m_pFormDict = pFormStream ? pFormStream->GetDict() : NULL;
- m_pResources = m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ m_pResources = m_pFormDict->GetDict("Resources");
m_pPageResources = pPageResources;
if (m_pResources == NULL) {
m_pResources = pParentResources;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index 934d102564..8deeb66deb 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -332,16 +332,16 @@ FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
if (!pDict)
return FALSE;
- CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
+ CPDF_Array* pParam = pDict->GetArray("WhitePoint");
int i;
for (i = 0; i < 3; i++) {
m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
- pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
+ pParam = pDict->GetArray("BlackPoint");
for (i = 0; i < 3; i++) {
m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
- m_Gamma = pDict->GetNumber(FX_BSTRC("Gamma"));
+ m_Gamma = pDict->GetNumber("Gamma");
if (m_Gamma == 0) {
m_Gamma = 1.0f;
}
@@ -408,16 +408,16 @@ FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
if (!pDict)
return FALSE;
- CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
+ CPDF_Array* pParam = pDict->GetArray("WhitePoint");
int i;
for (i = 0; i < 3; i++) {
m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
- pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
+ pParam = pDict->GetArray("BlackPoint");
for (i = 0; i < 3; i++) {
m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
- pParam = pDict->GetArray(FX_BSTRC("Gamma"));
+ pParam = pDict->GetArray("Gamma");
if (pParam) {
m_bGamma = TRUE;
for (i = 0; i < 3; i++) {
@@ -426,7 +426,7 @@ FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
} else {
m_bGamma = FALSE;
}
- pParam = pDict->GetArray(FX_BSTRC("Matrix"));
+ pParam = pDict->GetArray("Matrix");
if (pParam) {
m_bMatrix = TRUE;
for (i = 0; i < 9; i++) {
@@ -528,16 +528,16 @@ FX_BOOL CPDF_LabCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
if (!pDict) {
return FALSE;
}
- CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
+ CPDF_Array* pParam = pDict->GetArray("WhitePoint");
int i;
for (i = 0; i < 3; i++) {
m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
- pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
+ pParam = pDict->GetArray("BlackPoint");
for (i = 0; i < 3; i++) {
m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
- pParam = pDict->GetArray(FX_BSTRC("Range"));
+ pParam = pDict->GetArray("Range");
const FX_FLOAT def_ranges[4] = {-100 * 1.0f, 100 * 1.0f, -100 * 1.0f,
100 * 1.0f};
for (i = 0; i < 4; i++) {
@@ -701,7 +701,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Dictionary* pDict = pStream->GetDict();
if (m_pProfile->m_pTransform == NULL) { // No valid ICC profile or using sRGB
CPDF_Object* pAlterCSObj =
- pDict ? pDict->GetElementValue(FX_BSTRC("Alternate")) : NULL;
+ pDict ? pDict->GetElementValue("Alternate") : NULL;
if (pAlterCSObj) {
CPDF_ColorSpace* pAlterCS = CPDF_ColorSpace::Load(pDoc, pAlterCSObj);
if (pAlterCS) {
@@ -712,8 +712,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
m_bOwn = TRUE;
} else { // No valid alternative colorspace
pAlterCS->ReleaseCS();
- int32_t nDictComponents =
- pDict ? pDict->GetInteger(FX_BSTRC("N")) : 0;
+ int32_t nDictComponents = pDict ? pDict->GetInteger("N") : 0;
if (nDictComponents != 1 && nDictComponents != 3 &&
nDictComponents != 4) {
return FALSE;
@@ -741,7 +740,7 @@ FX_BOOL CPDF_ICCBasedCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
}
}
}
- CPDF_Array* pRanges = pDict->GetArray(FX_BSTRC("Range"));
+ CPDF_Array* pRanges = pDict->GetArray("Range");
m_pRanges = FX_Alloc2D(FX_FLOAT, m_nComponents, 2);
for (int i = 0; i < m_nComponents * 2; i++) {
if (pRanges) {
@@ -1049,7 +1048,7 @@ void CPDF_SeparationCS::GetDefaultValue(int iComponent,
}
FX_BOOL CPDF_SeparationCS::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CFX_ByteString name = pArray->GetString(1);
- if (name == FX_BSTRC("None")) {
+ if (name == "None") {
m_Type = None;
} else {
m_Type = Colorant;
@@ -1189,16 +1188,16 @@ CPDF_ColorSpace* CPDF_ColorSpace::GetStockCS(int family) {
;
}
CPDF_ColorSpace* _CSFromName(const CFX_ByteString& name) {
- if (name == FX_BSTRC("DeviceRGB") || name == FX_BSTRC("RGB")) {
+ if (name == "DeviceRGB" || name == "RGB") {
return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
}
- if (name == FX_BSTRC("DeviceGray") || name == FX_BSTRC("G")) {
+ if (name == "DeviceGray" || name == "G") {
return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
}
- if (name == FX_BSTRC("DeviceCMYK") || name == FX_BSTRC("CMYK")) {
+ if (name == "DeviceCMYK" || name == "CMYK") {
return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
}
- if (name == FX_BSTRC("Pattern")) {
+ if (name == "Pattern") {
return CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
}
return NULL;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 44d1dc47b6..0199809a45 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -263,7 +263,7 @@ CPDF_Font* CPDF_DocPageData::GetStandardFont(const CFX_ByteStringC& fontName,
continue;
if (pFont->GetFontType() != PDFFONT_TYPE1)
continue;
- if (pFont->GetFontDict()->KeyExist(FX_BSTRC("Widths")))
+ if (pFont->GetFontDict()->KeyExist("Widths"))
continue;
CPDF_Type1Font* pT1Font = pFont->GetType1Font();
@@ -274,11 +274,11 @@ CPDF_Font* CPDF_DocPageData::GetStandardFont(const CFX_ByteStringC& fontName,
}
CPDF_Dictionary* pDict = new CPDF_Dictionary;
- pDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("Font"));
- pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Type1"));
- pDict->SetAtName(FX_BSTRC("BaseFont"), fontName);
+ pDict->SetAtName("Type", "Font");
+ pDict->SetAtName("Subtype", "Type1");
+ pDict->SetAtName("BaseFont", fontName);
if (pEncoding) {
- pDict->SetAt(FX_BSTRC("Encoding"), pEncoding->Realize());
+ pDict->SetAt("Encoding", pEncoding->Realize());
}
m_pPDFDoc->AddIndirectObject(pDict);
CPDF_Font* pFont = CPDF_Font::CreateFontF(m_pPDFDoc, pDict);
@@ -317,7 +317,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(
CFX_ByteString name = pCSObj->GetConstString();
CPDF_ColorSpace* pCS = _CSFromName(name);
if (!pCS && pResources) {
- CPDF_Dictionary* pList = pResources->GetDict(FX_BSTRC("ColorSpace"));
+ CPDF_Dictionary* pList = pResources->GetDict("ColorSpace");
if (pList) {
pCSObj = pList->GetElementValue(name);
return GetColorSpace(pCSObj, nullptr);
@@ -326,20 +326,20 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpace(
if (!pCS || !pResources)
return pCS;
- CPDF_Dictionary* pColorSpaces = pResources->GetDict(FX_BSTRC("ColorSpace"));
+ CPDF_Dictionary* pColorSpaces = pResources->GetDict("ColorSpace");
if (!pColorSpaces)
return pCS;
CPDF_Object* pDefaultCS = nullptr;
switch (pCS->GetFamily()) {
case PDFCS_DEVICERGB:
- pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultRGB"));
+ pDefaultCS = pColorSpaces->GetElementValue("DefaultRGB");
break;
case PDFCS_DEVICEGRAY:
- pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultGray"));
+ pDefaultCS = pColorSpaces->GetElementValue("DefaultGray");
break;
case PDFCS_DEVICECMYK:
- pDefaultCS = pColorSpaces->GetElementValue(FX_BSTRC("DefaultCMYK"));
+ pDefaultCS = pColorSpaces->GetElementValue("DefaultCMYK");
break;
}
return pDefaultCS ? GetColorSpace(pDefaultCS, nullptr) : pCS;
@@ -423,7 +423,7 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj,
} else {
CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : nullptr;
if (pDict) {
- int type = pDict->GetInteger(FX_BSTRC("PatternType"));
+ int type = pDict->GetInteger("PatternType");
if (type == 1) {
pPattern = new CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
} else if (type == 2) {
@@ -553,9 +553,9 @@ CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(
return it->second->AddRef();
CPDF_Dictionary* pFontDict = pFontStream->GetDict();
- int32_t org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) +
- pFontDict->GetInteger(FX_BSTRC("Length2")) +
- pFontDict->GetInteger(FX_BSTRC("Length3"));
+ int32_t org_size = pFontDict->GetInteger("Length1") +
+ pFontDict->GetInteger("Length2") +
+ pFontDict->GetInteger("Length3");
if (org_size < 0)
org_size = 0;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
index 81d31a7eae..5f9d038626 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -177,7 +177,7 @@ const struct _PDF_PSOpName {
FX_BOOL CPDF_PSEngine::Parse(const FX_CHAR* string, int size) {
CPDF_SimpleParser parser((uint8_t*)string, size);
CFX_ByteStringC word = parser.GetWord();
- if (word != FX_BSTRC("{")) {
+ if (word != "{") {
return FALSE;
}
return m_MainProc.Parse(parser);
@@ -188,10 +188,10 @@ FX_BOOL CPDF_PSProc::Parse(CPDF_SimpleParser& parser) {
if (word.IsEmpty()) {
return FALSE;
}
- if (word == FX_BSTRC("}")) {
+ if (word == "}") {
return TRUE;
}
- if (word == FX_BSTRC("{")) {
+ if (word == "{") {
CPDF_PSProc* pProc = new CPDF_PSProc;
m_Operators.Add((void*)PSOP_PROC);
m_Operators.Add(pProc);
@@ -500,10 +500,10 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
return false;
CPDF_Dictionary* pDict = pStream->GetDict();
- CPDF_Array* pSize = pDict->GetArray(FX_BSTRC("Size"));
- CPDF_Array* pEncode = pDict->GetArray(FX_BSTRC("Encode"));
- CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
- m_nBitsPerSample = pDict->GetInteger(FX_BSTRC("BitsPerSample"));
+ CPDF_Array* pSize = pDict->GetArray("Size");
+ CPDF_Array* pEncode = pDict->GetArray("Encode");
+ CPDF_Array* pDecode = pDict->GetArray("Decode");
+ m_nBitsPerSample = pDict->GetInteger("BitsPerSample");
if (m_nBitsPerSample > 32) {
return FALSE;
}
@@ -515,7 +515,7 @@ FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
for (int i = 0; i < m_nInputs; i++) {
m_pEncodeInfo[i].sizes = pSize ? pSize->GetInteger(i) : 0;
if (!pSize && i == 0) {
- m_pEncodeInfo[i].sizes = pDict->GetInteger(FX_BSTRC("Size"));
+ m_pEncodeInfo[i].sizes = pDict->GetInteger("Size");
}
nTotalSampleBits *= m_pEncodeInfo[i].sizes;
if (pEncode) {
@@ -686,21 +686,21 @@ FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) {
if (pDict == NULL) {
return FALSE;
}
- CPDF_Array* pArray0 = pDict->GetArray(FX_BSTRC("C0"));
+ CPDF_Array* pArray0 = pDict->GetArray("C0");
if (m_nOutputs == 0) {
m_nOutputs = 1;
if (pArray0) {
m_nOutputs = pArray0->GetCount();
}
}
- CPDF_Array* pArray1 = pDict->GetArray(FX_BSTRC("C1"));
+ CPDF_Array* pArray1 = pDict->GetArray("C1");
m_pBeginValues = FX_Alloc2D(FX_FLOAT, m_nOutputs, 2);
m_pEndValues = FX_Alloc2D(FX_FLOAT, m_nOutputs, 2);
for (int i = 0; i < m_nOutputs; i++) {
m_pBeginValues[i] = pArray0 ? pArray0->GetFloat(i) : 0.0f;
m_pEndValues[i] = pArray1 ? pArray1->GetFloat(i) : 1.0f;
}
- m_Exponent = pDict->GetFloat(FX_BSTRC("N"));
+ m_Exponent = pDict->GetFloat("N");
m_nOrigOutputs = m_nOutputs;
if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
return FALSE;
@@ -754,7 +754,7 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
if (m_nInputs != kRequiredNumInputs) {
return FALSE;
}
- CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Functions"));
+ CPDF_Array* pArray = pDict->GetArray("Functions");
if (!pArray) {
return FALSE;
}
@@ -788,7 +788,7 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
}
m_pBounds = FX_Alloc(FX_FLOAT, nSubs + 1);
m_pBounds[0] = m_pDomains[0];
- pArray = pDict->GetArray(FX_BSTRC("Bounds"));
+ pArray = pDict->GetArray("Bounds");
if (!pArray) {
return FALSE;
}
@@ -797,7 +797,7 @@ FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj) {
}
m_pBounds[nSubs] = m_pDomains[1];
m_pEncode = FX_Alloc2D(FX_FLOAT, nSubs, 2);
- pArray = pDict->GetArray(FX_BSTRC("Encode"));
+ pArray = pDict->GetArray("Encode");
if (!pArray) {
return FALSE;
}
@@ -829,9 +829,9 @@ CPDF_Function* CPDF_Function::Load(CPDF_Object* pFuncObj) {
CPDF_Function* pFunc = NULL;
int type;
if (CPDF_Stream* pStream = pFuncObj->AsStream()) {
- type = pStream->GetDict()->GetInteger(FX_BSTRC("FunctionType"));
+ type = pStream->GetDict()->GetInteger("FunctionType");
} else if (CPDF_Dictionary* pDict = pFuncObj->AsDictionary()) {
- type = pDict->GetInteger(FX_BSTRC("FunctionType"));
+ type = pDict->GetInteger("FunctionType");
} else {
return NULL;
}
@@ -864,7 +864,7 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
CPDF_Stream* pStream = pObj->AsStream();
CPDF_Dictionary* pDict = pStream ? pStream->GetDict() : pObj->AsDictionary();
- CPDF_Array* pDomains = pDict->GetArray(FX_BSTRC("Domain"));
+ CPDF_Array* pDomains = pDict->GetArray("Domain");
if (!pDomains)
return FALSE;
@@ -876,7 +876,7 @@ FX_BOOL CPDF_Function::Init(CPDF_Object* pObj) {
for (int i = 0; i < m_nInputs * 2; i++) {
m_pDomains[i] = pDomains->GetFloat(i);
}
- CPDF_Array* pRanges = pDict->GetArray(FX_BSTRC("Range"));
+ CPDF_Array* pRanges = pDict->GetArray("Range");
m_nOutputs = 0;
if (pRanges) {
m_nOutputs = pRanges->GetCount() / 2;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index 3852a4852a..63f957a838 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -507,7 +507,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
break;
}
case FXBSTR_ID('T', 'R', 0, 0):
- if (pGS->KeyExist(FX_BSTRC("TR2"))) {
+ if (pGS->KeyExist("TR2")) {
continue;
}
case FXBSTR_ID('T', 'R', '2', 0):
@@ -542,7 +542,7 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
break;
case FXBSTR_ID('O', 'P', 0, 0):
pGeneralState->m_StrokeOP = pObject->GetInteger();
- if (!pGS->KeyExist(FX_BSTRC("op"))) {
+ if (!pGS->KeyExist("op")) {
pGeneralState->m_FillOP = pObject->GetInteger();
}
break;
@@ -553,14 +553,14 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
pGeneralState->m_OPMode = pObject->GetInteger();
break;
case FXBSTR_ID('B', 'G', 0, 0):
- if (pGS->KeyExist(FX_BSTRC("BG2"))) {
+ if (pGS->KeyExist("BG2")) {
continue;
}
case FXBSTR_ID('B', 'G', '2', 0):
pGeneralState->m_pBG = pObject;
break;
case FXBSTR_ID('U', 'C', 'R', 0):
- if (pGS->KeyExist(FX_BSTRC("UCR2"))) {
+ if (pGS->KeyExist("UCR2")) {
continue;
}
case FXBSTR_ID('U', 'C', 'R', '2'):
@@ -608,8 +608,7 @@ CPDF_ContentMarkItem::~CPDF_ContentMarkItem() {
FX_BOOL CPDF_ContentMarkItem::HasMCID() const {
if (m_pParam &&
(m_ParamType == DirectDict || m_ParamType == PropertiesDict)) {
- return ToDictionary(static_cast<CPDF_Object*>(m_pParam))
- ->KeyExist(FX_BSTRC("MCID"));
+ return ToDictionary(static_cast<CPDF_Object*>(m_pParam))->KeyExist("MCID");
}
return FALSE;
}
@@ -626,8 +625,8 @@ int CPDF_ContentMarkData::GetMCID() const {
type == CPDF_ContentMarkItem::DirectDict) {
CPDF_Dictionary* pDict =
ToDictionary(static_cast<CPDF_Object*>(m_Marks[i].GetParam()));
- if (pDict->KeyExist(FX_BSTRC("MCID"))) {
- return pDict->GetInteger(FX_BSTRC("MCID"));
+ if (pDict->KeyExist("MCID")) {
+ return pDict->GetInteger("MCID");
}
}
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
index 775bd91d16..edcb3cab2d 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_image.cpp
@@ -88,11 +88,10 @@ FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline) {
if (m_bInline) {
m_pInlineDict = ToDictionary(pDict->Clone());
}
- m_pOC = pDict->GetDict(FX_BSTRC("OC"));
- m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) ||
- pDict->GetInteger(FX_BSTRC("ImageMask"));
- m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate"));
- m_Height = pDict->GetInteger(FX_BSTRC("Height"));
- m_Width = pDict->GetInteger(FX_BSTRC("Width"));
+ m_pOC = pDict->GetDict("OC");
+ m_bIsMask = !pDict->KeyExist("ColorSpace") || pDict->GetInteger("ImageMask");
+ m_bInterpolate = pDict->GetInteger("Interpolate");
+ m_Height = pDict->GetInteger("Height");
+ m_Width = pDict->GetInteger("Width");
return TRUE;
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 21fddead33..1df0c605e4 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -415,7 +415,7 @@ void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary() {
}
FX_BOOL bDirect = TRUE;
if (pProperty->IsName()) {
- pProperty = FindResourceObj(FX_BSTRC("Properties"), pProperty->GetString());
+ pProperty = FindResourceObj("Properties", pProperty->GetString());
if (!pProperty)
return;
bDirect = FALSE;
@@ -680,9 +680,9 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject() {
if (!m_pResources)
return;
- CPDF_Dictionary* pList = m_pResources->GetDict(FX_BSTRC("XObject"));
+ CPDF_Dictionary* pList = m_pResources->GetDict("XObject");
if (!pList && m_pPageResources && m_pResources != m_pPageResources)
- pList = m_pPageResources->GetDict(FX_BSTRC("XObject"));
+ pList = m_pPageResources->GetDict("XObject");
if (!pList)
return;
CPDF_Reference* pRes = ToReference(pList->GetElement(name));
@@ -694,24 +694,23 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject() {
return;
}
- CPDF_Stream* pXObject = ToStream(FindResourceObj(FX_BSTRC("XObject"), name));
+ CPDF_Stream* pXObject = ToStream(FindResourceObj("XObject", name));
if (!pXObject) {
m_bResourceMissing = TRUE;
return;
}
- CFX_ByteStringC type =
- pXObject->GetDict()
- ? pXObject->GetDict()->GetConstString(FX_BSTRC("Subtype"))
- : CFX_ByteStringC();
- if (type == FX_BSTRC("Image")) {
+ CFX_ByteStringC type = pXObject->GetDict()
+ ? pXObject->GetDict()->GetConstString("Subtype")
+ : CFX_ByteStringC();
+ if (type == "Image") {
if (m_Options.m_bTextOnly) {
return;
}
CPDF_ImageObject* pObj = AddImage(pXObject, NULL, FALSE);
m_LastImageName = name;
m_pLastImage = pObj->m_pImage;
- } else if (type == FX_BSTRC("Form")) {
+ } else if (type == "Form") {
AddForm(pXObject);
} else {
return;
@@ -719,15 +718,14 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject() {
}
void CPDF_StreamContentParser::AddForm(CPDF_Stream* pStream) {
if (!m_Options.m_bSeparateForm) {
- CPDF_Dictionary* pResources =
- pStream->GetDict()->GetDict(FX_BSTRC("Resources"));
- CFX_Matrix form_matrix = pStream->GetDict()->GetMatrix(FX_BSTRC("Matrix"));
+ CPDF_Dictionary* pResources = pStream->GetDict()->GetDict("Resources");
+ CFX_Matrix form_matrix = pStream->GetDict()->GetMatrix("Matrix");
form_matrix.Concat(m_pCurStates->m_CTM);
- CPDF_Array* pBBox = pStream->GetDict()->GetArray(FX_BSTRC("BBox"));
+ CPDF_Array* pBBox = pStream->GetDict()->GetArray("BBox");
CFX_FloatRect form_bbox;
CPDF_Path ClipPath;
if (pBBox) {
- form_bbox = pStream->GetDict()->GetRect(FX_BSTRC("BBox"));
+ form_bbox = pStream->GetDict()->GetRect("BBox");
ClipPath.New();
ClipPath.AppendRect(form_bbox.left, form_bbox.bottom, form_bbox.right,
form_bbox.top);
@@ -860,8 +858,7 @@ void CPDF_StreamContentParser::Handle_SetGray_Stroke() {
}
void CPDF_StreamContentParser::Handle_SetExtendGraphState() {
CFX_ByteString name = GetString(0);
- CPDF_Dictionary* pGS =
- ToDictionary(FindResourceObj(FX_BSTRC("ExtGState"), name));
+ CPDF_Dictionary* pGS = ToDictionary(FindResourceObj("ExtGState", name));
if (!pGS) {
m_bResourceMissing = TRUE;
return;
@@ -1192,11 +1189,10 @@ CPDF_Object* CPDF_StreamContentParser::FindResourceObj(
return pRes;
}
CPDF_Font* CPDF_StreamContentParser::FindFont(const CFX_ByteString& name) {
- CPDF_Dictionary* pFontDict =
- ToDictionary(FindResourceObj(FX_BSTRC("Font"), name));
+ CPDF_Dictionary* pFontDict = ToDictionary(FindResourceObj("Font", name));
if (!pFontDict) {
m_bResourceMissing = TRUE;
- return CPDF_Font::GetStockFont(m_pDocument, FX_BSTRC("Helvetica"));
+ return CPDF_Font::GetStockFont(m_pDocument, "Helvetica");
}
CPDF_Font* pFont = m_pDocument->LoadFont(pFontDict);
@@ -1208,26 +1204,25 @@ CPDF_Font* CPDF_StreamContentParser::FindFont(const CFX_ByteString& name) {
}
CPDF_ColorSpace* CPDF_StreamContentParser::FindColorSpace(
const CFX_ByteString& name) {
- if (name == FX_BSTRC("Pattern")) {
+ if (name == "Pattern") {
return CPDF_ColorSpace::GetStockCS(PDFCS_PATTERN);
}
- if (name == FX_BSTRC("DeviceGray") || name == FX_BSTRC("DeviceCMYK") ||
- name == FX_BSTRC("DeviceRGB")) {
+ if (name == "DeviceGray" || name == "DeviceCMYK" || name == "DeviceRGB") {
CFX_ByteString defname = "Default";
defname += name.Mid(7);
- CPDF_Object* pDefObj = FindResourceObj(FX_BSTRC("ColorSpace"), defname);
+ CPDF_Object* pDefObj = FindResourceObj("ColorSpace", defname);
if (pDefObj == NULL) {
- if (name == FX_BSTRC("DeviceGray")) {
+ if (name == "DeviceGray") {
return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICEGRAY);
}
- if (name == FX_BSTRC("DeviceRGB")) {
+ if (name == "DeviceRGB") {
return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB);
}
return CPDF_ColorSpace::GetStockCS(PDFCS_DEVICECMYK);
}
return m_pDocument->LoadColorSpace(pDefObj);
}
- CPDF_Object* pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
+ CPDF_Object* pCSObj = FindResourceObj("ColorSpace", name);
if (pCSObj == NULL) {
m_bResourceMissing = TRUE;
return NULL;
@@ -1236,8 +1231,8 @@ CPDF_ColorSpace* CPDF_StreamContentParser::FindColorSpace(
}
CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name,
FX_BOOL bShading) {
- CPDF_Object* pPattern = FindResourceObj(
- bShading ? FX_BSTRC("Shading") : FX_BSTRC("Pattern"), name);
+ CPDF_Object* pPattern =
+ FindResourceObj(bShading ? "Shading" : "Pattern", name);
if (!pPattern || (!pPattern->IsDictionary() && !pPattern->IsStream())) {
m_bResourceMissing = TRUE;
return NULL;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index d862225ec6..0bf044101c 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -81,7 +81,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
if (type == CPDF_StreamParser::Keyword) {
CFX_ByteString bsKeyword(m_pSyntax->GetWordBuf(),
m_pSyntax->GetWordSize());
- if (bsKeyword != FX_BSTRC("ID")) {
+ if (bsKeyword != "ID") {
m_pSyntax->SetPos(savePos);
pDict->Release();
return;
@@ -104,16 +104,15 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
}
_PDF_ReplaceAbbr(pDict);
CPDF_Object* pCSObj = NULL;
- if (pDict->KeyExist(FX_BSTRC("ColorSpace"))) {
- pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ if (pDict->KeyExist("ColorSpace")) {
+ pCSObj = pDict->GetElementValue("ColorSpace");
if (pCSObj->IsName()) {
CFX_ByteString name = pCSObj->GetString();
- if (name != FX_BSTRC("DeviceRGB") && name != FX_BSTRC("DeviceGray") &&
- name != FX_BSTRC("DeviceCMYK")) {
- pCSObj = FindResourceObj(FX_BSTRC("ColorSpace"), name);
+ if (name != "DeviceRGB" && name != "DeviceGray" && name != "DeviceCMYK") {
+ pCSObj = FindResourceObj("ColorSpace", name);
if (pCSObj && !pCSObj->GetObjNum()) {
pCSObj = pCSObj->Clone();
- pDict->SetAt(FX_BSTRC("ColorSpace"), pCSObj);
+ pDict->SetAt("ColorSpace", pCSObj);
}
}
}
@@ -141,7 +140,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() {
}
return;
}
- pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
+ pDict->SetAtName("Subtype", "Image");
CPDF_ImageObject* pImgObj = AddImage(pStream, NULL, TRUE);
if (!pImgObj) {
if (pStream) {
@@ -290,33 +289,33 @@ FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf,
CPDF_Dictionary* pParam,
uint8_t*& dest_buf,
FX_DWORD& dest_size) {
- if (decoder == FX_BSTRC("CCITTFaxDecode") || decoder == FX_BSTRC("CCF")) {
+ if (decoder == "CCITTFaxDecode" || decoder == "CCF") {
ICodec_ScanlineDecoder* pDecoder =
FPDFAPI_CreateFaxDecoder(src_buf, limit, width, height, pParam);
return _DecodeAllScanlines(pDecoder, dest_buf, dest_size);
}
- if (decoder == FX_BSTRC("ASCII85Decode") || decoder == FX_BSTRC("A85")) {
+ if (decoder == "ASCII85Decode" || decoder == "A85") {
return A85Decode(src_buf, limit, dest_buf, dest_size);
}
- if (decoder == FX_BSTRC("ASCIIHexDecode") || decoder == FX_BSTRC("AHx")) {
+ if (decoder == "ASCIIHexDecode" || decoder == "AHx") {
return HexDecode(src_buf, limit, dest_buf, dest_size);
}
- if (decoder == FX_BSTRC("FlateDecode") || decoder == FX_BSTRC("Fl")) {
+ if (decoder == "FlateDecode" || decoder == "Fl") {
return FPDFAPI_FlateOrLZWDecode(FALSE, src_buf, limit, pParam, dest_size,
dest_buf, dest_size);
}
- if (decoder == FX_BSTRC("LZWDecode") || decoder == FX_BSTRC("LZW")) {
+ if (decoder == "LZWDecode" || decoder == "LZW") {
return FPDFAPI_FlateOrLZWDecode(TRUE, src_buf, limit, pParam, 0, dest_buf,
dest_size);
}
- if (decoder == FX_BSTRC("DCTDecode") || decoder == FX_BSTRC("DCT")) {
+ if (decoder == "DCTDecode" || decoder == "DCT") {
ICodec_ScanlineDecoder* pDecoder =
CPDF_ModuleMgr::Get()->GetJpegModule()->CreateDecoder(
src_buf, limit, width, height, 0,
- pParam ? pParam->GetInteger(FX_BSTRC("ColorTransform"), 1) : 1);
+ pParam ? pParam->GetInteger("ColorTransform", 1) : 1);
return _DecodeAllScanlines(pDecoder, dest_buf, dest_size);
}
- if (decoder == FX_BSTRC("RunLengthDecode") || decoder == FX_BSTRC("RL")) {
+ if (decoder == "RunLengthDecode" || decoder == "RL") {
return RunLengthDecode(src_buf, limit, dest_buf, dest_size);
}
dest_size = 0;
@@ -335,23 +334,23 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
CFX_ByteString Decoder;
CPDF_Dictionary* pParam = nullptr;
- CPDF_Object* pFilter = pDict->GetElementValue(FX_BSTRC("Filter"));
+ CPDF_Object* pFilter = pDict->GetElementValue("Filter");
if (pFilter) {
if (CPDF_Array* pArray = pFilter->AsArray()) {
Decoder = pArray->GetString(0);
- CPDF_Array* pParams = pDict->GetArray(FX_BSTRC("DecodeParms"));
+ CPDF_Array* pParams = pDict->GetArray("DecodeParms");
if (pParams)
pParam = pParams->GetDict(0);
} else {
Decoder = pFilter->GetString();
- pParam = pDict->GetDict(FX_BSTRC("DecodeParms"));
+ pParam = pDict->GetDict("DecodeParms");
}
}
- FX_DWORD width = pDict->GetInteger(FX_BSTRC("Width"));
- FX_DWORD height = pDict->GetInteger(FX_BSTRC("Height"));
+ FX_DWORD width = pDict->GetInteger("Width");
+ FX_DWORD height = pDict->GetInteger("Height");
FX_DWORD OrigSize = 0;
if (pCSObj != NULL) {
- FX_DWORD bpc = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
+ FX_DWORD bpc = pDict->GetInteger("BitsPerComponent");
FX_DWORD nComponents = 1;
CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj);
if (pCS == NULL) {
@@ -409,12 +408,12 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
dwStreamSize = dwDestSize;
if (CPDF_Array* pArray = pFilter->AsArray()) {
pArray->RemoveAt(0);
- CPDF_Array* pParams = pDict->GetArray(FX_BSTRC("DecodeParms"));
+ CPDF_Array* pParams = pDict->GetArray("DecodeParms");
if (pParams)
pParams->RemoveAt(0);
} else {
- pDict->RemoveAt(FX_BSTRC("Filter"));
- pDict->RemoveAt(FX_BSTRC("DecodeParms"));
+ pDict->RemoveAt("Filter");
+ pDict->RemoveAt("DecodeParms");
}
} else {
FX_Free(pData);
@@ -443,7 +442,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
m_Pos += dwStreamSize;
}
}
- pDict->SetAtInteger(FX_BSTRC("Length"), (int)dwStreamSize);
+ pDict->SetAtInteger("Length", (int)dwStreamSize);
return new CPDF_Stream(pData, dwStreamSize, pDict);
}
@@ -938,8 +937,7 @@ void CPDF_ContentParser::Start(CPDF_Page* pPage, CPDF_ParseOptions* pOptions) {
m_Status = ToBeContinued;
m_InternalStage = PAGEPARSE_STAGE_GETCONTENT;
m_CurrentOffset = 0;
- CPDF_Object* pContent =
- pPage->m_pFormDict->GetElementValue(FX_BSTRC("Contents"));
+ CPDF_Object* pContent = pPage->m_pFormDict->GetElementValue("Contents");
if (pContent == NULL) {
m_Status = Done;
return;
@@ -969,11 +967,11 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
m_pType3Char = pType3Char;
m_pObjects = pForm;
m_bForm = TRUE;
- CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrix(FX_BSTRC("Matrix"));
+ CFX_Matrix form_matrix = pForm->m_pFormDict->GetMatrix("Matrix");
if (pGraphicStates) {
form_matrix.Concat(pGraphicStates->m_CTM);
}
- CPDF_Array* pBBox = pForm->m_pFormDict->GetArray(FX_BSTRC("BBox"));
+ CPDF_Array* pBBox = pForm->m_pFormDict->GetArray("BBox");
CFX_FloatRect form_bbox;
CPDF_Path ClipPath;
if (pBBox) {
@@ -990,8 +988,7 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
form_bbox.Transform(pParentMatrix);
}
}
- CPDF_Dictionary* pResources =
- pForm->m_pFormDict->GetDict(FX_BSTRC("Resources"));
+ CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDict("Resources");
m_pParser = new CPDF_StreamContentParser(
pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources,
pParentMatrix, pForm, pResources, &form_bbox, pOptions, pGraphicStates,
@@ -1058,8 +1055,7 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) {
m_InternalStage = PAGEPARSE_STAGE_PARSE;
m_CurrentOffset = 0;
} else {
- CPDF_Array* pContent =
- m_pObjects->m_pFormDict->GetArray(FX_BSTRC("Contents"));
+ CPDF_Array* pContent = m_pObjects->m_pFormDict->GetArray("Contents");
m_pStreamArray[m_CurrentOffset] = new CPDF_StreamAcc;
CPDF_Stream* pStreamObj = ToStream(
pContent ? pContent->GetElementValue(m_CurrentOffset) : nullptr);
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index 77e375bcc0..e1a7493a2f 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -45,8 +45,8 @@ CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc,
m_pDocument = pDoc;
CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
ASSERT(pDict != NULL);
- m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
- m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
+ m_Pattern2Form = pDict->GetMatrix("Matrix");
+ m_bColored = pDict->GetInteger("PaintType") == 1;
if (parentMatrix) {
m_Pattern2Form.Concat(*parentMatrix);
}
@@ -64,9 +64,9 @@ FX_BOOL CPDF_TilingPattern::Load() {
if (!pDict)
return FALSE;
- m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
- m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("XStep")));
- m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber(FX_BSTRC("YStep")));
+ m_bColored = pDict->GetInteger("PaintType") == 1;
+ m_XStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber("XStep"));
+ m_YStep = (FX_FLOAT)FXSYS_fabs(pDict->GetNumber("YStep"));
CPDF_Stream* pStream = m_pPatternObj->AsStream();
if (!pStream)
@@ -74,7 +74,7 @@ FX_BOOL CPDF_TilingPattern::Load() {
m_pForm = new CPDF_Form(m_pDocument, NULL, pStream);
m_pForm->ParseContent(NULL, &m_ParentMatrix, NULL, NULL);
- m_BBox = pDict->GetRect(FX_BSTRC("BBox"));
+ m_BBox = pDict->GetRect("BBox");
return TRUE;
}
CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc,
@@ -89,8 +89,8 @@ CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc,
if (!bShading) {
CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
ASSERT(pDict != NULL);
- m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
- m_pShadingObj = pDict->GetElementValue(FX_BSTRC("Shading"));
+ m_Pattern2Form = pDict->GetMatrix("Matrix");
+ m_pShadingObj = pDict->GetElementValue("Shading");
if (parentMatrix) {
m_Pattern2Form.Concat(*parentMatrix);
}
@@ -137,7 +137,7 @@ FX_BOOL CPDF_ShadingPattern::Load() {
delete m_pFunctions[i];
m_nFuncs = 0;
}
- CPDF_Object* pFunc = pShadingDict->GetElementValue(FX_BSTRC("Function"));
+ CPDF_Object* pFunc = pShadingDict->GetElementValue("Function");
if (pFunc) {
if (CPDF_Array* pArray = pFunc->AsArray()) {
m_nFuncs = std::min<int>(pArray->GetCount(), 4);
@@ -150,7 +150,7 @@ FX_BOOL CPDF_ShadingPattern::Load() {
m_nFuncs = 1;
}
}
- CPDF_Object* pCSObj = pShadingDict->GetElementValue(FX_BSTRC("ColorSpace"));
+ CPDF_Object* pCSObj = pShadingDict->GetElementValue("ColorSpace");
if (pCSObj == NULL) {
return FALSE;
}
@@ -160,8 +160,7 @@ FX_BOOL CPDF_ShadingPattern::Load() {
m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray());
}
- m_ShadingType =
- ToShadingType(pShadingDict->GetInteger(FX_BSTRC("ShadingType")));
+ m_ShadingType = ToShadingType(pShadingDict->GetInteger("ShadingType"));
// We expect to have a stream if our shading type is a mesh.
if (IsMeshShading() && !ToStream(m_pShadingObj))
@@ -183,9 +182,9 @@ FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream,
m_nFuncs = nFuncs;
m_pCS = pCS;
CPDF_Dictionary* pDict = pShadingStream->GetDict();
- m_nCoordBits = pDict->GetInteger(FX_BSTRC("BitsPerCoordinate"));
- m_nCompBits = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
- m_nFlagBits = pDict->GetInteger(FX_BSTRC("BitsPerFlag"));
+ m_nCoordBits = pDict->GetInteger("BitsPerCoordinate");
+ m_nCompBits = pDict->GetInteger("BitsPerComponent");
+ m_nFlagBits = pDict->GetInteger("BitsPerFlag");
if (!m_nCoordBits || !m_nCompBits) {
return FALSE;
}
@@ -199,7 +198,7 @@ FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream,
}
m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1;
m_CompMax = (1 << m_nCompBits) - 1;
- CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
+ CPDF_Array* pDecode = pDict->GetArray("Decode");
if (pDecode == NULL || pDecode->GetCount() != 4 + m_nComps * 2) {
return FALSE;
}