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

Side by Side Diff: core/src/fpdfdoc/doc_annot.cpp

Issue 1529553003: Merge to XFA: Get rid of most instance of 'foo != NULL' (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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 // 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/include/fpdfapi/fpdf_pageobj.h" 7 #include "core/include/fpdfapi/fpdf_pageobj.h"
8 #include "core/include/fpdfdoc/fpdf_doc.h" 8 #include "core/include/fpdfdoc/fpdf_doc.h"
9 #include "third_party/base/nonstd_unique_ptr.h" 9 #include "third_party/base/nonstd_unique_ptr.h"
10 10
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 CFX_ByteString style = pBS->GetString("S"); 297 CFX_ByteString style = pBS->GetString("S");
298 pDashArray = pBS->GetArray("D"); 298 pDashArray = pBS->GetArray("D");
299 style_char = style[1]; 299 style_char = style[1];
300 width = pBS->GetNumber("W"); 300 width = pBS->GetNumber("W");
301 } 301 }
302 if (width <= 0) { 302 if (width <= 0) {
303 return; 303 return;
304 } 304 }
305 CPDF_Array* pColor = m_pAnnotDict->GetArray("C"); 305 CPDF_Array* pColor = m_pAnnotDict->GetArray("C");
306 FX_DWORD argb = 0xff000000; 306 FX_DWORD argb = 0xff000000;
307 if (pColor != NULL) { 307 if (pColor) {
308 int R = (int32_t)(pColor->GetNumber(0) * 255); 308 int R = (int32_t)(pColor->GetNumber(0) * 255);
309 int G = (int32_t)(pColor->GetNumber(1) * 255); 309 int G = (int32_t)(pColor->GetNumber(1) * 255);
310 int B = (int32_t)(pColor->GetNumber(2) * 255); 310 int B = (int32_t)(pColor->GetNumber(2) * 255);
311 argb = ArgbEncode(0xff, R, G, B); 311 argb = ArgbEncode(0xff, R, G, B);
312 } 312 }
313 CPDF_GraphStateData graph_state; 313 CPDF_GraphStateData graph_state;
314 graph_state.m_LineWidth = width; 314 graph_state.m_LineWidth = width;
315 if (style_char == 'D') { 315 if (style_char == 'D') {
316 if (pDashArray) { 316 if (pDashArray) {
317 FX_DWORD dash_count = pDashArray->GetCount(); 317 FX_DWORD dash_count = pDashArray->GetCount();
(...skipping 20 matching lines...) Expand all
338 CPDF_PathData path; 338 CPDF_PathData path;
339 width /= 2; 339 width /= 2;
340 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width, 340 path.AppendRect(rect.left + width, rect.bottom + width, rect.right - width,
341 rect.top - width); 341 rect.top - width);
342 int fill_type = 0; 342 int fill_type = 0;
343 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) { 343 if (pOptions && (pOptions->m_Flags & RENDER_NOPATHSMOOTH)) {
344 fill_type |= FXFILL_NOPATHSMOOTH; 344 fill_type |= FXFILL_NOPATHSMOOTH;
345 } 345 }
346 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type); 346 pDevice->DrawPath(&path, pUser2Device, &graph_state, argb, argb, fill_type);
347 } 347 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698