diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-06-30 09:49:21 -0700 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-06-30 09:49:21 -0700 |
commit | 287e11a213d3197ac3e321acf294d903b271c269 (patch) | |
tree | 28f6f9dd00331c2748d73f96d818ce04a9775e8d /fpdfsdk/src/fpdfeditpage.cpp | |
parent | ad30f609702d232f1708a0792d682c3cfaa0e235 (diff) | |
download | pdfium-287e11a213d3197ac3e321acf294d903b271c269.tar.xz |
Remove "this==NULL" and adjust corresponding callers
BUG=
R=thakis@chromium.org
Review URL: https://codereview.chromium.org/361553002
Diffstat (limited to 'fpdfsdk/src/fpdfeditpage.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfeditpage.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp index 4c9fd35108..2e84aa5dcb 100644 --- a/fpdfsdk/src/fpdfeditpage.cpp +++ b/fpdfsdk/src/fpdfeditpage.cpp @@ -102,7 +102,7 @@ DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) { CPDF_Page* pPage = (CPDF_Page*)page; - if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") + if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page")) { return -1; @@ -112,8 +112,8 @@ DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) int rotate = 0; if(pDict != NULL) { - if(pDict->KeyExist("Rotate")) - rotate = pDict->GetElement("Rotate")->GetDirect()->GetInteger() / 90; + if (pDict->KeyExist("Rotate")) + rotate = pDict->GetElement("Rotate")->GetDirect()? pDict->GetElement("Rotate")->GetDirect()->GetInteger() / 90 : 0; else { if(pDict->KeyExist("Parent")) @@ -123,7 +123,7 @@ DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) { if(pPages->KeyExist("Rotate")) { - rotate = pPages->GetElement("Rotate")->GetDirect()->GetInteger() / 90; + rotate = pPages->GetElement("Rotate")->GetDirect()? pPages->GetElement("Rotate")->GetDirect()->GetInteger() / 90 : 0; break; } else if(pPages->KeyExist("Parent")) @@ -144,7 +144,7 @@ DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT page_obj) { CPDF_Page* pPage = (CPDF_Page*)page; - if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") + if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page")) { return; @@ -199,7 +199,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page, FPDF_PAGEOBJECT pag DLLEXPORT int STDCALL FPDFPage_CountObject(FPDF_PAGE page) { CPDF_Page* pPage = (CPDF_Page*)page; - if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") + if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page")) { return -1; @@ -263,7 +263,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObje DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page) { CPDF_Page* pPage = (CPDF_Page*)page; - if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") + if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page")) { return FALSE; @@ -318,7 +318,7 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page, DLLEXPORT void STDCALL FPDFPage_SetRotation(FPDF_PAGE page, int rotate) { CPDF_Page* pPage = (CPDF_Page*)page; - if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") + if (!pPage || !pPage->m_pFormDict || !pPage->m_pFormDict->KeyExist("Type") || !pPage->m_pFormDict->GetElement("Type")->GetDirect() || pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare("Page")) { return; |