Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: fpdfsdk/src/pdfwindow/PWL_Edit.cpp

Issue 1142713005: Remove FX_Alloc() null checks now that it can't return NULL. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix missing FX_Alloc2D, check overflow on add, remove unused enum. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/fsdk_baseform.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/pdfwindow/PWL_Edit.cpp
diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
index f704a67731f247226fe187bd7c8777db0484f528..678da68b498824bafb02177153b05f01c149efb8 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp
@@ -426,17 +426,15 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser
gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
CFX_PathData path;
- if (!path.SetPointCount(nCharArraySafe.ValueOrDie())) {
- return;
- }
-
+ path.SetPointCount(nCharArraySafe.ValueOrDie());
+
for (FX_INT32 i=0; i<nCharArray-1; i++)
- {
- path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
+ {
+ path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
rcClient.bottom, FXPT_MOVETO);
path.SetPoint(i*2+1, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
- rcClient.top, FXPT_LINETO);
- }
+ rcClient.top, FXPT_LINETO);
+ }
if (path.GetPointCount() > 0)
pDevice->DrawPath(&path, pUser2Device, &gsd,0,
CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE);
@@ -453,19 +451,17 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser
gsd.m_DashPhase = (FX_FLOAT)GetBorderDash().nPhase;
CFX_PathData path;
- if (!path.SetPointCount(nCharArraySafe.ValueOrDie())) {
- return;
- }
-
+ path.SetPointCount(nCharArraySafe.ValueOrDie());
+
for (FX_INT32 i=0; i<nCharArray-1; i++)
- {
- path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
+ {
+ path.SetPoint(i*2, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
rcClient.bottom, FXPT_MOVETO);
path.SetPoint(i*2+1, rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*(i+1),
- rcClient.top, FXPT_LINETO);
- }
+ rcClient.top, FXPT_LINETO);
+ }
if (path.GetPointCount() > 0)
- pDevice->DrawPath(&path, pUser2Device, &gsd,0,
+ pDevice->DrawPath(&path, pUser2Device, &gsd,0,
CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE);
}
break;
« no previous file with comments | « fpdfsdk/src/fsdk_baseform.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698