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

Side by Side Diff: fpdfsdk/fxedit/fxet_pageobjs.cpp

Issue 2031653003: Get rid of NULLs in fpdfsdk/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@nullptr_core
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « fpdfsdk/fxedit/fxet_list.cpp ('k') | fpdfsdk/fxedit/include/fx_edit.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" 7 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h"
8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" 8 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h"
9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h" 9 #include "core/fpdfapi/fpdf_page/include/cpdf_pathobject.h"
10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h" 10 #include "core/fpdfapi/fpdf_page/include/cpdf_textobject.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 if (pIterator->GetWord(word)) { 183 if (pIterator->GetWord(word)) {
184 CFX_PathData pathUnderline; 184 CFX_PathData pathUnderline;
185 CFX_FloatRect rcUnderline = GetUnderLineRect(word); 185 CFX_FloatRect rcUnderline = GetUnderLineRect(word);
186 rcUnderline.left += ptOffset.x; 186 rcUnderline.left += ptOffset.x;
187 rcUnderline.right += ptOffset.x; 187 rcUnderline.right += ptOffset.x;
188 rcUnderline.top += ptOffset.y; 188 rcUnderline.top += ptOffset.y;
189 rcUnderline.bottom += ptOffset.y; 189 rcUnderline.bottom += ptOffset.y;
190 pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, 190 pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom,
191 rcUnderline.right, rcUnderline.top); 191 rcUnderline.right, rcUnderline.top);
192 192
193 pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, color, 0, 193 pDevice->DrawPath(&pathUnderline, pUser2Device, nullptr, color, 0,
194 FXFILL_WINDING); 194 FXFILL_WINDING);
195 } 195 }
196 } 196 }
197 } 197 }
198 198
199 pDevice->RestoreState(false); 199 pDevice->RestoreState(false);
200 } 200 }
201 201
202 void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, 202 void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
203 CFX_Matrix* pUser2Device, 203 CFX_Matrix* pUser2Device,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 word.ptWord.x + word.fWidth, 268 word.ptWord.x + word.fWidth,
269 line.ptLine.y + line.fLineAscent); 269 line.ptLine.y + line.fLineAscent);
270 rc.Intersect(rcClip); 270 rc.Intersect(rcClip);
271 pSystemHandler->OutputSelectedRect(pFFLData, rc); 271 pSystemHandler->OutputSelectedRect(pFFLData, rc);
272 } else { 272 } else {
273 CFX_PathData pathSelBK; 273 CFX_PathData pathSelBK;
274 pathSelBK.AppendRect( 274 pathSelBK.AppendRect(
275 word.ptWord.x, line.ptLine.y + line.fLineDescent, 275 word.ptWord.x, line.ptLine.y + line.fLineDescent,
276 word.ptWord.x + word.fWidth, line.ptLine.y + line.fLineAscent); 276 word.ptWord.x + word.fWidth, line.ptLine.y + line.fLineAscent);
277 277
278 pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, 278 pDevice->DrawPath(&pathSelBK, pUser2Device, nullptr, crSelBK, 0,
279 FXFILL_WINDING); 279 FXFILL_WINDING);
280 } 280 }
281 } 281 }
282 282
283 if (bContinuous) { 283 if (bContinuous) {
284 if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex || 284 if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex ||
285 crOldFill != crCurFill) { 285 crOldFill != crCurFill) {
286 if (sTextBuf.GetLength() > 0) { 286 if (sTextBuf.GetLength() > 0) {
287 DrawTextString( 287 DrawTextString(
288 pDevice, 288 pDevice,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 if (bSelect) { 380 if (bSelect) {
381 CPVT_Line line; 381 CPVT_Line line;
382 pIterator->GetLine(line); 382 pIterator->GetLine(line);
383 383
384 CFX_PathData pathSelBK; 384 CFX_PathData pathSelBK;
385 pathSelBK.AppendRect(word.ptWord.x + ptOffset.x, 385 pathSelBK.AppendRect(word.ptWord.x + ptOffset.x,
386 line.ptLine.y + line.fLineDescent + ptOffset.y, 386 line.ptLine.y + line.fLineDescent + ptOffset.y,
387 word.ptWord.x + word.fWidth + ptOffset.x, 387 word.ptWord.x + word.fWidth + ptOffset.x,
388 line.ptLine.y + line.fLineAscent + ptOffset.y); 388 line.ptLine.y + line.fLineAscent + ptOffset.y);
389 389
390 pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, 390 pDevice->DrawPath(&pathSelBK, pUser2Device, nullptr, crSelBK, 0,
391 FXFILL_WINDING); 391 FXFILL_WINDING);
392 } 392 }
393 393
394 if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || 394 if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f ||
395 word.WordProps.nHorzScale != 100 || 395 word.WordProps.nHorzScale != 100 ||
396 FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 || 396 FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 ||
397 crOld != crCurText) { 397 crOld != crCurText) {
398 if (sTextBuf.GetLength() > 0) { 398 if (sTextBuf.GetLength() > 0) {
399 DrawTextString( 399 DrawTextString(
400 pDevice, 400 pDevice,
(...skipping 11 matching lines...) Expand all
412 sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, 412 sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex,
413 word.Word, 0) 413 word.Word, 0)
414 .AsStringC(); 414 .AsStringC();
415 415
416 if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) { 416 if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) {
417 CFX_PathData pathUnderline; 417 CFX_PathData pathUnderline;
418 CFX_FloatRect rcUnderline = GetUnderLineRect(word); 418 CFX_FloatRect rcUnderline = GetUnderLineRect(word);
419 pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, 419 pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom,
420 rcUnderline.right, rcUnderline.top); 420 rcUnderline.right, rcUnderline.top);
421 421
422 pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, crCurText, 0, 422 pDevice->DrawPath(&pathUnderline, pUser2Device, nullptr, crCurText, 0,
423 FXFILL_WINDING); 423 FXFILL_WINDING);
424 } 424 }
425 425
426 if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) { 426 if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) {
427 CFX_PathData pathCrossout; 427 CFX_PathData pathCrossout;
428 CFX_FloatRect rcCrossout = GetCrossoutRect(word); 428 CFX_FloatRect rcCrossout = GetCrossoutRect(word);
429 pathCrossout.AppendRect(rcCrossout.left, rcCrossout.bottom, 429 pathCrossout.AppendRect(rcCrossout.left, rcCrossout.bottom,
430 rcCrossout.right, rcCrossout.top); 430 rcCrossout.right, rcCrossout.top);
431 431
432 pDevice->DrawPath(&pathCrossout, pUser2Device, NULL, crCurText, 0, 432 pDevice->DrawPath(&pathCrossout, pUser2Device, nullptr, crCurText, 0,
433 FXFILL_WINDING); 433 FXFILL_WINDING);
434 } 434 }
435 435
436 oldplace = place; 436 oldplace = place;
437 } 437 }
438 } 438 }
439 439
440 if (sTextBuf.GetLength() > 0) { 440 if (sTextBuf.GetLength() > 0) {
441 DrawTextString( 441 DrawTextString(
442 pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y), 442 pDevice, CFX_FloatPoint(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 CFX_FloatRect rcUnderline = GetUnderLineRect(word); 626 CFX_FloatRect rcUnderline = GetUnderLineRect(word);
627 rcUnderline.left += ptOffset.x; 627 rcUnderline.left += ptOffset.x;
628 rcUnderline.right += ptOffset.x; 628 rcUnderline.right += ptOffset.x;
629 rcUnderline.top += ptOffset.y; 629 rcUnderline.top += ptOffset.y;
630 rcUnderline.bottom += ptOffset.y; 630 rcUnderline.bottom += ptOffset.y;
631 AddRectToPageObjects(pObjectHolder, color, rcUnderline); 631 AddRectToPageObjects(pObjectHolder, color, rcUnderline);
632 } 632 }
633 } 633 }
634 } 634 }
635 } 635 }
OLDNEW
« no previous file with comments | « fpdfsdk/fxedit/fxet_list.cpp ('k') | fpdfsdk/fxedit/include/fx_edit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698