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

Side by Side Diff: fpdfsdk/pdfwindow/PWL_ScrollBar.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/pdfwindow/PWL_ListBox.cpp ('k') | fpdfsdk/pdfwindow/PWL_Signature.cpp » ('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 "fpdfsdk/pdfwindow/PWL_ScrollBar.h" 7 #include "fpdfsdk/pdfwindow/PWL_ScrollBar.h"
8 8
9 #include "core/fxge/include/fx_ge.h" 9 #include "core/fxge/include/fx_ge.h"
10 #include "fpdfsdk/pdfwindow/PWL_Utils.h" 10 #include "fpdfsdk/pdfwindow/PWL_Utils.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && 266 if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
267 rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { 267 rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) {
268 CFX_PathData path; 268 CFX_PathData path;
269 269
270 path.SetPointCount(4); 270 path.SetPointCount(4);
271 path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO); 271 path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
272 path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO); 272 path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
273 path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO); 273 path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
274 path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO); 274 path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
275 275
276 pDevice->DrawPath(&path, pUser2Device, NULL, 276 pDevice->DrawPath(&path, pUser2Device, nullptr,
277 CPWL_Utils::PWLColorToFXColor( 277 CPWL_Utils::PWLColorToFXColor(
278 PWL_DEFAULT_BLACKCOLOR, nTransparancy), 278 PWL_DEFAULT_BLACKCOLOR, nTransparancy),
279 0, FXFILL_ALTERNATE); 279 0, FXFILL_ALTERNATE);
280 } 280 }
281 } break; 281 } break;
282 case PSBT_MAX: { 282 case PSBT_MAX: {
283 CFX_FloatPoint pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f, 283 CFX_FloatPoint pt1(ptCenter.x + PWL_TRIANGLE_HALFLEN * 0.5f,
284 ptCenter.y); 284 ptCenter.y);
285 CFX_FloatPoint pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, 285 CFX_FloatPoint pt2(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,
286 ptCenter.y + PWL_TRIANGLE_HALFLEN); 286 ptCenter.y + PWL_TRIANGLE_HALFLEN);
287 CFX_FloatPoint pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f, 287 CFX_FloatPoint pt3(ptCenter.x - PWL_TRIANGLE_HALFLEN * 0.5f,
288 ptCenter.y - PWL_TRIANGLE_HALFLEN); 288 ptCenter.y - PWL_TRIANGLE_HALFLEN);
289 289
290 if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 && 290 if (rectWnd.right - rectWnd.left > PWL_TRIANGLE_HALFLEN * 2 &&
291 rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) { 291 rectWnd.top - rectWnd.bottom > PWL_TRIANGLE_HALFLEN) {
292 CFX_PathData path; 292 CFX_PathData path;
293 293
294 path.SetPointCount(4); 294 path.SetPointCount(4);
295 path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO); 295 path.SetPoint(0, pt1.x, pt1.y, FXPT_MOVETO);
296 path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO); 296 path.SetPoint(1, pt2.x, pt2.y, FXPT_LINETO);
297 path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO); 297 path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO);
298 path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO); 298 path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO);
299 299
300 pDevice->DrawPath(&path, pUser2Device, NULL, 300 pDevice->DrawPath(&path, pUser2Device, nullptr,
301 CPWL_Utils::PWLColorToFXColor( 301 CPWL_Utils::PWLColorToFXColor(
302 PWL_DEFAULT_BLACKCOLOR, nTransparancy), 302 PWL_DEFAULT_BLACKCOLOR, nTransparancy),
303 0, FXFILL_ALTERNATE); 303 0, FXFILL_ALTERNATE);
304 } 304 }
305 } break; 305 } break;
306 default: 306 default:
307 break; 307 break;
308 } 308 }
309 break; 309 break;
310 case SBT_VSCROLL: 310 case SBT_VSCROLL:
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 572
573 if (CPWL_Wnd* pParent = GetParentWindow()) { 573 if (CPWL_Wnd* pParent = GetParentWindow()) {
574 pParent->OnNotify(this, PNM_MOUSEMOVE, 0, (intptr_t)&point); 574 pParent->OnNotify(this, PNM_MOUSEMOVE, 0, (intptr_t)&point);
575 } 575 }
576 576
577 return TRUE; 577 return TRUE;
578 } 578 }
579 579
580 CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType) 580 CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType)
581 : m_sbType(sbType), 581 : m_sbType(sbType),
582 m_pMinButton(NULL), 582 m_pMinButton(nullptr),
583 m_pMaxButton(NULL), 583 m_pMaxButton(nullptr),
584 m_pPosButton(NULL), 584 m_pPosButton(nullptr),
585 m_bMouseDown(FALSE), 585 m_bMouseDown(FALSE),
586 m_bMinOrMax(FALSE), 586 m_bMinOrMax(FALSE),
587 m_bNotifyForever(TRUE) {} 587 m_bNotifyForever(TRUE) {}
588 588
589 CPWL_ScrollBar::~CPWL_ScrollBar() {} 589 CPWL_ScrollBar::~CPWL_ScrollBar() {}
590 590
591 CFX_ByteString CPWL_ScrollBar::GetClassName() const { 591 CFX_ByteString CPWL_ScrollBar::GetClassName() const {
592 return "CPWL_ScrollBar"; 592 return "CPWL_ScrollBar";
593 } 593 }
594 594
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 if (m_bMinOrMax) 1191 if (m_bMinOrMax)
1192 m_sData.SubSmall(); 1192 m_sData.SubSmall();
1193 else 1193 else
1194 m_sData.AddSmall(); 1194 m_sData.AddSmall();
1195 1195
1196 if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0) { 1196 if (FXSYS_memcmp(&m_sData, &sTemp, sizeof(PWL_SCROLL_PRIVATEDATA)) != 0) {
1197 MovePosButton(TRUE); 1197 MovePosButton(TRUE);
1198 NotifyScrollWindow(); 1198 NotifyScrollWindow();
1199 } 1199 }
1200 } 1200 }
OLDNEW
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_ListBox.cpp ('k') | fpdfsdk/pdfwindow/PWL_Signature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698