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

Unified Diff: xfa/fwl/core/fwl_widgetmgrimp.cpp

Issue 1946213003: Remove CLASSHASH defines in favour of an enum class. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: xfa/fwl/core/fwl_widgetmgrimp.cpp
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp
index 02b63862e50bae575557e5967e89b8563d44dd8d..8334e3c4a2f4c68c581a381eeecfc3dfa24a31a5 100644
--- a/xfa/fwl/core/fwl_widgetmgrimp.cpp
+++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp
@@ -515,25 +515,13 @@ IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent,
int32_t CFWL_WidgetMgr::CountRadioButtonGroup(IFWL_Widget* pFirst) {
int32_t iRet = 0;
IFWL_Widget* pChild = pFirst;
- while (pChild) {
- if ((pChild->GetStyles() & FWL_WGTSTYLE_Group) &&
- pChild->GetClassID() == 3811304691) {
- iRet++;
- }
+ while (pChild)
pChild = GetWidget(pChild, FWL_WGTRELATION_NextSibling);
- }
return iRet;
}
IFWL_Widget* CFWL_WidgetMgr::GetSiblingRadioButton(IFWL_Widget* pWidget,
FX_BOOL bNext) {
- while ((pWidget = GetWidget(pWidget, bNext ? FWL_WGTRELATION_NextSibling
- : FWL_WGTRELATION_PriorSibling)) !=
- NULL) {
- if (pWidget->GetClassID() == 3811304691) {
- return pWidget;
- }
- }
- return NULL;
+ return nullptr;
}
IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader(
IFWL_Widget* pRadioButton) {
@@ -547,10 +535,6 @@ IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader(
}
}
pNext = GetWidget(pRadioButton, FWL_WGTRELATION_LastSibling);
- if ((pNext->GetStyles() & FWL_WGTSTYLE_Group) &&
- pNext->GetClassID() == 3811304691) {
- return pNext;
- }
while ((pNext = GetSiblingRadioButton(pNext, FALSE)) && pNext &&
pNext != pRadioButton) {
if (pNext->GetStyles() & FWL_WGTSTYLE_Group) {
@@ -558,10 +542,6 @@ IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader(
}
}
pNext = GetWidget(pRadioButton, FWL_WGTRELATION_FirstSibling);
- if (pNext && (pNext->GetStyles() == FWL_WGTSTYLE_Group) &&
- pNext->GetClassID() == 3811304691) {
- return pNext;
- }
return GetSiblingRadioButton(pNext, TRUE);
}
void CFWL_WidgetMgr::GetSameGroupRadioButton(
@@ -573,9 +553,6 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(
}
int32_t iGroup = CountRadioButtonGroup(pFirst);
if (iGroup < 2) {
- if (pFirst->GetClassID() == 3811304691) {
- group.Add(pFirst);
- }
IFWL_Widget* pNext = pFirst;
while ((pNext = GetSiblingRadioButton(pNext, TRUE)) != NULL) {
group.Add(pNext);
@@ -586,24 +563,19 @@ void CFWL_WidgetMgr::GetSameGroupRadioButton(
do {
group.Add(pNext);
pNext = GetSiblingRadioButton(pNext, TRUE);
- if (!pNext) {
- if (pFirst->GetClassID() == 3811304691) {
- pNext = pFirst;
- } else {
- pNext = GetSiblingRadioButton(pFirst, TRUE);
- }
- }
+ if (!pNext)
+ pNext = GetSiblingRadioButton(pFirst, TRUE);
} while (pNext && ((pNext->GetStyles() & FWL_WGTSTYLE_Group) == 0));
}
IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) {
- if ((pParent->GetClassID() == 3521614244) &&
+ if ((pParent->GetClassID() == FWL_Type::PushButton) &&
(pParent->GetStates() & (1 << (FWL_WGTSTATE_MAX + 2)))) {
return pParent;
}
IFWL_Widget* child =
FWL_GetWidgetMgr()->GetWidget(pParent, FWL_WGTRELATION_FirstChild);
while (child) {
- if ((child->GetClassID() == 3521614244) &&
+ if ((child->GetClassID() == FWL_Type::PushButton) &&
(child->GetStates() & (1 << (FWL_WGTSTATE_MAX + 2)))) {
return child;
}
@@ -883,25 +855,14 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget,
pWidget->GetWidgetRect(rtWidget);
rtWidget.left = rtWidget.top = 0;
pMatrix->TransformRect(rtWidget);
- if (!rtWidget.IntersectWith(rtDirty)) {
+ if (!rtWidget.IntersectWith(rtDirty))
return FALSE;
- }
+
IFWL_Widget* pChild =
FWL_GetWidgetMgr()->GetWidget(pWidget, FWL_WGTRELATION_FirstChild);
- if (!pChild) {
+ if (!pChild)
return TRUE;
- }
- if (pChild->GetClassID() == 3150298670) {
- CFX_RectF rtTemp;
- pChild->GetWidgetRect(rtTemp);
- if (rtTemp.width >= rtWidget.width && rtTemp.height >= rtWidget.height) {
- pChild =
- FWL_GetWidgetMgr()->GetWidget(pChild, FWL_WGTRELATION_FirstChild);
- if (!pChild) {
- return TRUE;
- }
- }
- }
+
CFX_RectF rtChilds;
rtChilds.Empty();
FX_BOOL bChildIntersectWithDirty = FALSE;

Powered by Google App Engine
This is Rietveld 408576698