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

Unified Diff: xfa/src/fwl/src/theme/listboxtp.cpp

Issue 1636873004: XFA: Fix DOS newlines (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: All of them Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fwl/src/theme/formtp.cpp ('k') | xfa/src/fwl/src/theme/monthcalendartp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fwl/src/theme/listboxtp.cpp
diff --git a/xfa/src/fwl/src/theme/listboxtp.cpp b/xfa/src/fwl/src/theme/listboxtp.cpp
index f9e7ae6614fc29212cf7d9074e14372431feb876..4d440e4278b3874cc04149d90a114428242ab7be 100644
--- a/xfa/src/fwl/src/theme/listboxtp.cpp
+++ b/xfa/src/fwl/src/theme/listboxtp.cpp
@@ -1,96 +1,96 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/src/foxitlib.h"
-CFWL_ListBoxTP::CFWL_ListBoxTP() {}
-CFWL_ListBoxTP::~CFWL_ListBoxTP() {}
-FX_BOOL CFWL_ListBoxTP::IsValidWidget(IFWL_Widget* pWidget) {
- if (!pWidget)
- return FALSE;
- return pWidget->GetClassID() == FWL_CLASSHASH_ListBox;
-}
-FX_BOOL CFWL_ListBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) {
- if (!pParams)
- return FALSE;
- switch (pParams->m_iPart) {
- case FWL_PART_LTB_Border: {
- DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);
- break;
- }
- case FWL_PART_LTB_Edge: {
- DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(),
- &pParams->m_rtPart, &pParams->m_matrix);
- break;
- }
- case FWL_PART_LTB_Background: {
- FillSoildRect(pParams->m_pGraphics, ArgbEncode(255, 255, 255, 255),
- &pParams->m_rtPart, &pParams->m_matrix);
- if (pParams->m_pData) {
- FillSoildRect(pParams->m_pGraphics, FWLTHEME_COLOR_Background,
- (CFX_RectF*)pParams->m_pData, &pParams->m_matrix);
- }
- break;
- }
- case FWL_PART_LTB_ListItem: {
- DrawListBoxItem(pParams->m_pGraphics, pParams->m_dwStates,
- &pParams->m_rtPart, pParams->m_pData, &pParams->m_matrix);
- break;
- }
- case FWL_PART_LTB_Icon: {
- pParams->m_pGraphics->StretchImage(pParams->m_pImage, pParams->m_rtPart,
- &pParams->m_matrix);
- break;
- }
- case FWL_PART_LTB_Check: {
- FX_DWORD color = 0xFF000000;
- if (pParams->m_dwStates == FWL_PARTSTATE_LTB_Checked) {
- color = 0xFFFF0000;
- } else if (pParams->m_dwStates == FWL_PARTSTATE_LTB_UnChecked) {
- color = 0xFF0000FF;
- }
- FillSoildRect(pParams->m_pGraphics, color, &pParams->m_rtPart,
- &pParams->m_matrix);
- }
- default: {}
- }
- return TRUE;
-}
-FWL_ERR CFWL_ListBoxTP::Initialize() {
- InitTTO();
- return CFWL_WidgetTP::Initialize();
-}
-FWL_ERR CFWL_ListBoxTP::Finalize() {
- FinalizeTTO();
- return CFWL_WidgetTP::Finalize();
-}
-void CFWL_ListBoxTP::DrawListBoxItem(CFX_Graphics* pGraphics,
- FX_DWORD dwStates,
- const CFX_RectF* prtItem,
- void* pData,
- CFX_Matrix* pMatrix) {
- if (dwStates & FWL_PARTSTATE_LTB_Selected) {
- pGraphics->SaveGraphState();
- CFX_Color crFill(FWL_GetThemeColor(m_dwThemeID) == 0
- ? FWLTHEME_COLOR_BKSelected
- : FWLTHEME_COLOR_Green_BKSelected);
- pGraphics->SetFillColor(&crFill);
- CFX_RectF rt(*prtItem);
- CFX_Path path;
- path.Create();
-#if (_FX_OS_ == _FX_MACOSX_)
- path.AddRectangle(rt.left, rt.top, rt.width - 1, rt.height - 1);
-#else
- path.AddRectangle(rt.left, rt.top, rt.width, rt.height);
-#endif
- pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
- pGraphics->RestoreGraphState();
- }
- if (dwStates & FWL_PARTSTATE_LTB_Focused) {
- if (pData) {
- DrawFocus(pGraphics, (CFX_RectF*)pData, pMatrix);
- }
- }
-}
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "xfa/src/foxitlib.h"
+CFWL_ListBoxTP::CFWL_ListBoxTP() {}
+CFWL_ListBoxTP::~CFWL_ListBoxTP() {}
+FX_BOOL CFWL_ListBoxTP::IsValidWidget(IFWL_Widget* pWidget) {
+ if (!pWidget)
+ return FALSE;
+ return pWidget->GetClassID() == FWL_CLASSHASH_ListBox;
+}
+FX_BOOL CFWL_ListBoxTP::DrawBackground(CFWL_ThemeBackground* pParams) {
+ if (!pParams)
+ return FALSE;
+ switch (pParams->m_iPart) {
+ case FWL_PART_LTB_Border: {
+ DrawBorder(pParams->m_pGraphics, &pParams->m_rtPart, &pParams->m_matrix);
+ break;
+ }
+ case FWL_PART_LTB_Edge: {
+ DrawEdge(pParams->m_pGraphics, pParams->m_pWidget->GetStyles(),
+ &pParams->m_rtPart, &pParams->m_matrix);
+ break;
+ }
+ case FWL_PART_LTB_Background: {
+ FillSoildRect(pParams->m_pGraphics, ArgbEncode(255, 255, 255, 255),
+ &pParams->m_rtPart, &pParams->m_matrix);
+ if (pParams->m_pData) {
+ FillSoildRect(pParams->m_pGraphics, FWLTHEME_COLOR_Background,
+ (CFX_RectF*)pParams->m_pData, &pParams->m_matrix);
+ }
+ break;
+ }
+ case FWL_PART_LTB_ListItem: {
+ DrawListBoxItem(pParams->m_pGraphics, pParams->m_dwStates,
+ &pParams->m_rtPart, pParams->m_pData, &pParams->m_matrix);
+ break;
+ }
+ case FWL_PART_LTB_Icon: {
+ pParams->m_pGraphics->StretchImage(pParams->m_pImage, pParams->m_rtPart,
+ &pParams->m_matrix);
+ break;
+ }
+ case FWL_PART_LTB_Check: {
+ FX_DWORD color = 0xFF000000;
+ if (pParams->m_dwStates == FWL_PARTSTATE_LTB_Checked) {
+ color = 0xFFFF0000;
+ } else if (pParams->m_dwStates == FWL_PARTSTATE_LTB_UnChecked) {
+ color = 0xFF0000FF;
+ }
+ FillSoildRect(pParams->m_pGraphics, color, &pParams->m_rtPart,
+ &pParams->m_matrix);
+ }
+ default: {}
+ }
+ return TRUE;
+}
+FWL_ERR CFWL_ListBoxTP::Initialize() {
+ InitTTO();
+ return CFWL_WidgetTP::Initialize();
+}
+FWL_ERR CFWL_ListBoxTP::Finalize() {
+ FinalizeTTO();
+ return CFWL_WidgetTP::Finalize();
+}
+void CFWL_ListBoxTP::DrawListBoxItem(CFX_Graphics* pGraphics,
+ FX_DWORD dwStates,
+ const CFX_RectF* prtItem,
+ void* pData,
+ CFX_Matrix* pMatrix) {
+ if (dwStates & FWL_PARTSTATE_LTB_Selected) {
+ pGraphics->SaveGraphState();
+ CFX_Color crFill(FWL_GetThemeColor(m_dwThemeID) == 0
+ ? FWLTHEME_COLOR_BKSelected
+ : FWLTHEME_COLOR_Green_BKSelected);
+ pGraphics->SetFillColor(&crFill);
+ CFX_RectF rt(*prtItem);
+ CFX_Path path;
+ path.Create();
+#if (_FX_OS_ == _FX_MACOSX_)
+ path.AddRectangle(rt.left, rt.top, rt.width - 1, rt.height - 1);
+#else
+ path.AddRectangle(rt.left, rt.top, rt.width, rt.height);
+#endif
+ pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix);
+ pGraphics->RestoreGraphState();
+ }
+ if (dwStates & FWL_PARTSTATE_LTB_Focused) {
+ if (pData) {
+ DrawFocus(pGraphics, (CFX_RectF*)pData, pMatrix);
+ }
+ }
+}
« no previous file with comments | « xfa/src/fwl/src/theme/formtp.cpp ('k') | xfa/src/fwl/src/theme/monthcalendartp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698