summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-06-28 18:26:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-28 18:26:15 +0000
commit3edb80670ddd20857cfba97110f64d610a5b29eb (patch)
tree8c8ba347408c894661a8dc6b72ab07d80b7b0d0c
parent35ab1bd0328a244cc2f6dcde2822c8117738b01d (diff)
downloadpdfium-3edb80670ddd20857cfba97110f64d610a5b29eb.tar.xz
Remove redundant FPDF_PAGEOBJECT null-ness checks.
CPDFTextObjectFromFPDFPageObject() will take the FPDF_PAGEOBJECT and performs the same check anyway. Change-Id: I6535ab749d5a3222c6f2e6fba648f7ee515d3ddc Reviewed-on: https://pdfium-review.googlesource.com/36372 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--fpdfsdk/fpdf_edittext.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/fpdfsdk/fpdf_edittext.cpp b/fpdfsdk/fpdf_edittext.cpp
index e339c24129..3115e2a16e 100644
--- a/fpdfsdk/fpdf_edittext.cpp
+++ b/fpdfsdk/fpdf_edittext.cpp
@@ -493,7 +493,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetMatrix(FPDF_PAGEOBJECT text,
double* d,
double* e,
double* f) {
- if (!text || !a || !b || !c || !d || !e || !f)
+ if (!a || !b || !c || !d || !e || !f)
return false;
CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text);
@@ -512,14 +512,8 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_GetMatrix(FPDF_PAGEOBJECT text,
}
FPDF_EXPORT double FPDF_CALLCONV FPDFTextObj_GetFontSize(FPDF_PAGEOBJECT text) {
- if (!text)
- return 0;
-
CPDF_TextObject* pTextObj = CPDFTextObjectFromFPDFPageObject(text);
- if (!pTextObj)
- return 0;
-
- return pTextObj->GetFontSize();
+ return pTextObj ? pTextObj->GetFontSize() : 0;
}
FPDF_EXPORT void FPDF_CALLCONV FPDFFont_Close(FPDF_FONT font) {