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

Side by Side Diff: xfa/fwl/theme/cfwl_widgettp.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@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 unified diff | Download patch
« no previous file with comments | « xfa/fwl/theme/cfwl_scrollbartp.cpp ('k') | xfa/fxbarcode/BC_BufferedImageLuminanceSource.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 "xfa/fwl/theme/cfwl_widgettp.h" 7 #include "xfa/fwl/theme/cfwl_widgettp.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 CFWL_FontManager::DestroyInstance(); 734 CFWL_FontManager::DestroyInstance();
735 } 735 }
736 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID) { 736 uint32_t FWL_GetThemeLayout(uint32_t dwThemeID) {
737 return 0xffff0000 & dwThemeID; 737 return 0xffff0000 & dwThemeID;
738 } 738 }
739 uint32_t FWL_GetThemeColor(uint32_t dwThemeID) { 739 uint32_t FWL_GetThemeColor(uint32_t dwThemeID) {
740 return 0x0000ffff & dwThemeID; 740 return 0x0000ffff & dwThemeID;
741 } 741 }
742 742
743 CFWL_ArrowData* CFWL_ArrowData::m_pInstance = NULL; 743 CFWL_ArrowData* CFWL_ArrowData::m_pInstance = NULL;
744
744 CFWL_ArrowData* CFWL_ArrowData::GetInstance() { 745 CFWL_ArrowData* CFWL_ArrowData::GetInstance() {
745 if (!m_pInstance) { 746 if (!m_pInstance)
746 m_pInstance = new CFWL_ArrowData; 747 m_pInstance = new CFWL_ArrowData;
747 }
748 return m_pInstance; 748 return m_pInstance;
749 } 749 }
750
750 FX_BOOL CFWL_ArrowData::IsInstance() { 751 FX_BOOL CFWL_ArrowData::IsInstance() {
751 return (m_pInstance != NULL); 752 return !!m_pInstance;
752 } 753 }
754
753 void CFWL_ArrowData::DestroyInstance() { 755 void CFWL_ArrowData::DestroyInstance() {
754 if (m_pInstance) { 756 delete m_pInstance;
755 delete m_pInstance; 757 m_pInstance = nullptr;
756 m_pInstance = NULL;
757 }
758 } 758 }
759
759 CFWL_ArrowData::~CFWL_ArrowData() { 760 CFWL_ArrowData::~CFWL_ArrowData() {
760 if (m_pColorData) { 761 delete m_pColorData;
761 delete m_pColorData;
762 m_pColorData = NULL;
763 }
764 } 762 }
763
765 void CFWL_ArrowData::SetColorData(uint32_t dwID) { 764 void CFWL_ArrowData::SetColorData(uint32_t dwID) {
766 if (!m_pColorData) { 765 if (!m_pColorData) {
767 m_pColorData = new CColorData; 766 m_pColorData = new CColorData;
768 } 767 }
769 if (dwID) { 768 if (dwID) {
770 m_pColorData->clrBorder[0] = ArgbEncode(255, 142, 153, 125); 769 m_pColorData->clrBorder[0] = ArgbEncode(255, 142, 153, 125);
771 m_pColorData->clrBorder[1] = ArgbEncode(255, 157, 171, 119); 770 m_pColorData->clrBorder[1] = ArgbEncode(255, 157, 171, 119);
772 m_pColorData->clrBorder[2] = ArgbEncode(255, 118, 131, 97); 771 m_pColorData->clrBorder[2] = ArgbEncode(255, 118, 131, 97);
773 m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153); 772 m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153);
774 m_pColorData->clrStart[0] = ArgbEncode(255, 203, 215, 186); 773 m_pColorData->clrStart[0] = ArgbEncode(255, 203, 215, 186);
(...skipping 20 matching lines...) Expand all
795 m_pColorData->clrEnd[0] = ArgbEncode(255, 175, 204, 251); 794 m_pColorData->clrEnd[0] = ArgbEncode(255, 175, 204, 251);
796 m_pColorData->clrEnd[1] = ArgbEncode(255, 185, 218, 251); 795 m_pColorData->clrEnd[1] = ArgbEncode(255, 185, 218, 251);
797 m_pColorData->clrEnd[2] = ArgbEncode(255, 210, 222, 235); 796 m_pColorData->clrEnd[2] = ArgbEncode(255, 210, 222, 235);
798 m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236); 797 m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236);
799 m_pColorData->clrSign[0] = ArgbEncode(255, 77, 97, 133); 798 m_pColorData->clrSign[0] = ArgbEncode(255, 77, 97, 133);
800 m_pColorData->clrSign[1] = ArgbEncode(255, 77, 97, 133); 799 m_pColorData->clrSign[1] = ArgbEncode(255, 77, 97, 133);
801 m_pColorData->clrSign[2] = ArgbEncode(255, 77, 97, 133); 800 m_pColorData->clrSign[2] = ArgbEncode(255, 77, 97, 133);
802 m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128); 801 m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128);
803 } 802 }
804 } 803 }
OLDNEW
« no previous file with comments | « xfa/fwl/theme/cfwl_scrollbartp.cpp ('k') | xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698