summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffwidget.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-02 15:48:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-02 15:48:16 -0700
commitdb444d2063df6c574882d9263e885c4fe1134133 (patch)
tree27ce4a3f181ae0b5ad4eff6893016e7d49dfce0a /xfa/fxfa/app/xfa_ffwidget.cpp
parentad700c2c1fc3c3843dae71e5982f462e42efc987 (diff)
downloadpdfium-db444d2063df6c574882d9263e885c4fe1134133.tar.xz
Fix all the code which has duplicate variable declarations
When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2027273002
Diffstat (limited to 'xfa/fxfa/app/xfa_ffwidget.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffwidget.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp
index 2a9638e817..8e10189f8c 100644
--- a/xfa/fxfa/app/xfa_ffwidget.cpp
+++ b/xfa/fxfa/app/xfa_ffwidget.cpp
@@ -1345,9 +1345,8 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
return;
}
FX_BOOL bSameStyles = TRUE;
- int32_t i;
CXFA_Stroke stroke1 = strokes[0];
- for (i = 1; i < 8; i++) {
+ for (int32_t i = 1; i < 8; i++) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2)) {
bSameStyles = FALSE;
@@ -1357,7 +1356,7 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
}
if (bSameStyles) {
stroke1 = strokes[0];
- for (i = 2; i < 8; i += 2) {
+ for (int32_t i = 2; i < 8; i += 2) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2, XFA_STROKE_SAMESTYLE_NoPresence |
XFA_STROKE_SAMESTYLE_Corner)) {
@@ -1839,9 +1838,8 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
}
FX_BOOL bClose = FALSE;
FX_BOOL bSameStyles = TRUE;
- int32_t i;
CXFA_Stroke stroke1 = strokes[0];
- for (i = 1; i < 8; i++) {
+ for (int32_t i = 1; i < 8; i++) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2)) {
bSameStyles = FALSE;
@@ -1852,7 +1850,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
if (bSameStyles) {
stroke1 = strokes[0];
bClose = TRUE;
- for (i = 2; i < 8; i += 2) {
+ for (int32_t i = 2; i < 8; i += 2) {
CXFA_Stroke stroke2 = strokes[i];
if (!stroke1.SameStyles(stroke2, XFA_STROKE_SAMESTYLE_NoPresence |
XFA_STROKE_SAMESTYLE_Corner)) {
@@ -1874,12 +1872,12 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
FX_BOOL bStart = TRUE;
CFX_Path path;
path.Create();
- for (i = 0; i < 8; i++) {
- CXFA_Stroke stroke1 = strokes[i];
- if ((i % 1) == 0 && stroke1.GetRadius() < 0) {
+ for (int32_t i = 0; i < 8; i++) {
+ CXFA_Stroke stroke = strokes[i];
+ if ((i % 1) == 0 && stroke.GetRadius() < 0) {
FX_BOOL bEmpty = path.IsEmpty();
if (!bEmpty) {
- XFA_BOX_StrokePath(stroke1, &path, pGS, pMatrix);
+ XFA_BOX_StrokePath(stroke, &path, pGS, pMatrix);
path.Clear();
}
bStart = TRUE;
@@ -1887,9 +1885,9 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
}
XFA_BOX_GetPath(box, strokes, rtWidget, path, i, bStart, !bSameStyles);
CXFA_Stroke stroke2 = strokes[(i + 1) % 8];
- bStart = !stroke1.SameStyles(stroke2);
+ bStart = !stroke.SameStyles(stroke2);
if (bStart) {
- XFA_BOX_StrokePath(stroke1, &path, pGS, pMatrix);
+ XFA_BOX_StrokePath(stroke, &path, pGS, pMatrix);
path.Clear();
}
}