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

Side by Side Diff: Source/core/rendering/InlineTextBox.cpp

Issue 101763008: Fix some problems reported by clang static analyzer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Dirk Mueller (mueller@kde.org) 3 * (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 RenderText* textObj = textRenderer(); 205 RenderText* textObj = textRenderer();
206 LayoutUnit selTop = selectionTop(); 206 LayoutUnit selTop = selectionTop();
207 LayoutUnit selHeight = selectionHeight(); 207 LayoutUnit selHeight = selectionHeight();
208 RenderStyle* styleToUse = textObj->style(isFirstLineStyle()); 208 RenderStyle* styleToUse = textObj->style(isFirstLineStyle());
209 const Font& font = styleToUse->font(); 209 const Font& font = styleToUse->font();
210 210
211 StringBuilder charactersWithHyphen; 211 StringBuilder charactersWithHyphen;
212 bool respectHyphen = ePos == m_len && hasHyphen(); 212 bool respectHyphen = ePos == m_len && hasHyphen();
213 TextRun textRun = constructTextRun(styleToUse, font, respectHyphen ? &charac tersWithHyphen : 0); 213 TextRun textRun = constructTextRun(styleToUse, font, respectHyphen ? &charac tersWithHyphen : 0);
214 if (respectHyphen)
215 endPos = textRun.length();
216 214
217 FloatPoint startingPoint = FloatPoint(logicalLeft(), selTop); 215 FloatPoint startingPoint = FloatPoint(logicalLeft(), selTop);
218 LayoutRect r; 216 LayoutRect r;
219 if (sPos || ePos != static_cast<int>(m_len)) 217 if (sPos || ePos != static_cast<int>(m_len))
220 r = enclosingIntRect(font.selectionRectForText(textRun, startingPoint, s elHeight, sPos, ePos)); 218 r = enclosingIntRect(font.selectionRectForText(textRun, startingPoint, s elHeight, sPos, ePos));
221 else // Avoid computing the font width when the entire line box is selected as an optimization. 219 else // Avoid computing the font width when the entire line box is selected as an optimization.
222 r = enclosingIntRect(FloatRect(startingPoint, FloatSize(m_logicalWidth, selHeight))); 220 r = enclosingIntRect(FloatRect(startingPoint, FloatSize(m_logicalWidth, selHeight)));
223 221
224 LayoutUnit logicalWidth = r.width(); 222 LayoutUnit logicalWidth = r.width();
225 if (r.x() > logicalRight()) 223 if (r.x() > logicalRight())
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1557 printedCharacters = fprintf(stderr, "\t%s %p", obj->renderName(), obj); 1555 printedCharacters = fprintf(stderr, "\t%s %p", obj->renderName(), obj);
1558 const int rendererCharacterOffset = 24; 1556 const int rendererCharacterOffset = 24;
1559 for (; printedCharacters < rendererCharacterOffset; printedCharacters++) 1557 for (; printedCharacters < rendererCharacterOffset; printedCharacters++)
1560 fputc(' ', stderr); 1558 fputc(' ', stderr);
1561 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata()); 1559 fprintf(stderr, "(%d,%d) \"%s\"\n", start(), start() + len(), value.utf8().d ata());
1562 } 1560 }
1563 1561
1564 #endif 1562 #endif
1565 1563
1566 } // namespace WebCore 1564 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/CompositedLayerMapping.cpp ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698