summaryrefslogtreecommitdiff
path: root/xfa/fwl/theme/cfwl_arrowdata.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-21 11:56:07 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-21 11:56:07 -0800
commit43170f498b8c619620c4141b2d67ef6ab9a518ca (patch)
treebdce03d265f3ae0ca0f6ee171ee1099124735d5e /xfa/fwl/theme/cfwl_arrowdata.cpp
parentac9934bfd0570526fb5b688670f32efa56648f5d (diff)
downloadpdfium-43170f498b8c619620c4141b2d67ef6ab9a518ca.tar.xz
Update SetThemeColor and SetThemeData
The SetThemeColor and SetThemeData methods are always called with a parameter of 0. This Cl removes the parameter and updates the code as needed. Review-Url: https://codereview.chromium.org/2521683002
Diffstat (limited to 'xfa/fwl/theme/cfwl_arrowdata.cpp')
-rw-r--r--xfa/fwl/theme/cfwl_arrowdata.cpp63
1 files changed, 25 insertions, 38 deletions
diff --git a/xfa/fwl/theme/cfwl_arrowdata.cpp b/xfa/fwl/theme/cfwl_arrowdata.cpp
index 51af713cbb..523a8555bf 100644
--- a/xfa/fwl/theme/cfwl_arrowdata.cpp
+++ b/xfa/fwl/theme/cfwl_arrowdata.cpp
@@ -8,6 +8,8 @@
#include <algorithm>
+#include "third_party/base/ptr_util.h"
+
namespace {
CFWL_ArrowData* g_pInstance = nullptr;
@@ -29,45 +31,30 @@ void CFWL_ArrowData::DestroyInstance() {
g_pInstance = nullptr;
}
+CFWL_ArrowData::CFWL_ArrowData() : m_pColorData(nullptr) {
+ SetColorData();
+}
+
CFWL_ArrowData::~CFWL_ArrowData() {}
-void CFWL_ArrowData::SetColorData(uint32_t dwID) {
+void CFWL_ArrowData::SetColorData() {
if (!m_pColorData)
- m_pColorData.reset(new CColorData);
-
- if (dwID) {
- m_pColorData->clrBorder[0] = ArgbEncode(255, 142, 153, 125);
- m_pColorData->clrBorder[1] = ArgbEncode(255, 157, 171, 119);
- m_pColorData->clrBorder[2] = ArgbEncode(255, 118, 131, 97);
- m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153);
- m_pColorData->clrStart[0] = ArgbEncode(255, 203, 215, 186);
- m_pColorData->clrStart[1] = ArgbEncode(255, 218, 232, 185);
- m_pColorData->clrStart[2] = ArgbEncode(255, 203, 215, 186);
- m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251);
- m_pColorData->clrEnd[0] = ArgbEncode(255, 149, 167, 117);
- m_pColorData->clrEnd[1] = ArgbEncode(255, 198, 211, 155);
- m_pColorData->clrEnd[2] = ArgbEncode(255, 149, 167, 117);
- m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236);
- m_pColorData->clrSign[0] = ArgbEncode(255, 255, 255, 255);
- m_pColorData->clrSign[1] = ArgbEncode(255, 255, 255, 255);
- m_pColorData->clrSign[2] = ArgbEncode(255, 255, 255, 255);
- m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128);
- } else {
- m_pColorData->clrBorder[0] = ArgbEncode(255, 202, 216, 249);
- m_pColorData->clrBorder[1] = ArgbEncode(255, 171, 190, 233);
- m_pColorData->clrBorder[2] = ArgbEncode(255, 135, 147, 219);
- m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153);
- m_pColorData->clrStart[0] = ArgbEncode(255, 225, 234, 254);
- m_pColorData->clrStart[1] = ArgbEncode(255, 253, 255, 255);
- m_pColorData->clrStart[2] = ArgbEncode(255, 110, 142, 241);
- m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251);
- m_pColorData->clrEnd[0] = ArgbEncode(255, 175, 204, 251);
- m_pColorData->clrEnd[1] = ArgbEncode(255, 185, 218, 251);
- m_pColorData->clrEnd[2] = ArgbEncode(255, 210, 222, 235);
- m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236);
- m_pColorData->clrSign[0] = ArgbEncode(255, 77, 97, 133);
- m_pColorData->clrSign[1] = ArgbEncode(255, 77, 97, 133);
- m_pColorData->clrSign[2] = ArgbEncode(255, 77, 97, 133);
- m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128);
- }
+ m_pColorData = pdfium::MakeUnique<CColorData>();
+
+ m_pColorData->clrBorder[0] = ArgbEncode(255, 202, 216, 249);
+ m_pColorData->clrBorder[1] = ArgbEncode(255, 171, 190, 233);
+ m_pColorData->clrBorder[2] = ArgbEncode(255, 135, 147, 219);
+ m_pColorData->clrBorder[3] = ArgbEncode(255, 172, 168, 153);
+ m_pColorData->clrStart[0] = ArgbEncode(255, 225, 234, 254);
+ m_pColorData->clrStart[1] = ArgbEncode(255, 253, 255, 255);
+ m_pColorData->clrStart[2] = ArgbEncode(255, 110, 142, 241);
+ m_pColorData->clrStart[3] = ArgbEncode(255, 254, 254, 251);
+ m_pColorData->clrEnd[0] = ArgbEncode(255, 175, 204, 251);
+ m_pColorData->clrEnd[1] = ArgbEncode(255, 185, 218, 251);
+ m_pColorData->clrEnd[2] = ArgbEncode(255, 210, 222, 235);
+ m_pColorData->clrEnd[3] = ArgbEncode(255, 243, 241, 236);
+ m_pColorData->clrSign[0] = ArgbEncode(255, 77, 97, 133);
+ m_pColorData->clrSign[1] = ArgbEncode(255, 77, 97, 133);
+ m_pColorData->clrSign[2] = ArgbEncode(255, 77, 97, 133);
+ m_pColorData->clrSign[3] = ArgbEncode(255, 128, 128, 128);
}