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

Unified Diff: xfa/fde/tto/fde_textout.cpp

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 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 | « xfa/fde/cfx_wordbreak.cpp ('k') | xfa/fgas/font/fgas_gefont.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/tto/fde_textout.cpp
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index c7d82ac0f426ea6f3168b442393b94c6616e0147..1cf92264095778423f5cf6ab063424fdc7acf1ec 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -735,16 +735,14 @@ void CFDE_TextOut::DoAlignment(const CFX_RectF& rect) {
FX_BOOL bVertical = !!(m_dwStyles & FDE_TTOSTYLE_VerticalLayout);
FX_FLOAT fLineStopS = bVertical ? rect.right() : rect.bottom();
int32_t iLines = m_ttoLines.GetSize();
- if (iLines < 1) {
+ if (iLines < 1)
return;
- }
- CFDE_TTOLine* pLine = m_ttoLines.GetPtrAt(iLines - 1);
- FDE_TTOPIECE* pPiece = pLine->GetPtrAt(0);
- if (pPiece == NULL) {
+ FDE_TTOPIECE* pFirstPiece = m_ttoLines.GetPtrAt(iLines - 1)->GetPtrAt(0);
+ if (!pFirstPiece)
return;
- }
+
FX_FLOAT fLineStopD =
- bVertical ? pPiece->rtPiece.right() : pPiece->rtPiece.bottom();
+ bVertical ? pFirstPiece->rtPiece.right() : pFirstPiece->rtPiece.bottom();
FX_FLOAT fInc = fLineStopS - fLineStopD;
if (m_iAlignment >= FDE_TTOALIGNMENT_CenterLeft &&
m_iAlignment < FDE_TTOALIGNMENT_BottomLeft) {
@@ -752,19 +750,17 @@ void CFDE_TextOut::DoAlignment(const CFX_RectF& rect) {
} else if (m_iAlignment < FDE_TTOALIGNMENT_CenterLeft) {
fInc = 0.0f;
}
- if (fInc < 1.0f) {
+ if (fInc < 1.0f)
return;
- }
for (int32_t i = 0; i < iLines; i++) {
CFDE_TTOLine* pLine = m_ttoLines.GetPtrAt(i);
int32_t iPieces = pLine->GetSize();
for (int32_t j = 0; j < iPieces; j++) {
FDE_TTOPIECE* pPiece = pLine->GetPtrAt(j);
- if (bVertical) {
+ if (bVertical)
pPiece->rtPiece.left += fInc;
- } else {
+ else
pPiece->rtPiece.top += fInc;
- }
}
}
}
« no previous file with comments | « xfa/fde/cfx_wordbreak.cpp ('k') | xfa/fgas/font/fgas_gefont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698