summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fffield.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-23 17:02:23 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-23 17:02:23 +0000
commit6aec70bc09cb65b169fe6ca1af65e8929aeea43a (patch)
tree34d55cf15cba0fe71e87a896184ecdc891d4752f /xfa/fxfa/cxfa_fffield.cpp
parentd49254bc9323883deba14d27026ec2bb9af096fa (diff)
downloadpdfium-6aec70bc09cb65b169fe6ca1af65e8929aeea43a.tar.xz
Cleanup CXFA_WidgetDatachromium/3277
This CL cleans up return values, out-params and changes simple methods to boolean checks where possible in CXFA_WidgetData. Change-Id: I29daa67993730f3e9d61cb6fdf918a886cc9120e Reviewed-on: https://pdfium-review.googlesource.com/19230 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_fffield.cpp')
-rw-r--r--xfa/fxfa/cxfa_fffield.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/xfa/fxfa/cxfa_fffield.cpp b/xfa/fxfa/cxfa_fffield.cpp
index 70b11640ec..1f4cf56c1d 100644
--- a/xfa/fxfa/cxfa_fffield.cpp
+++ b/xfa/fxfa/cxfa_fffield.cpp
@@ -188,9 +188,8 @@ void CXFA_FFField::CapPlacement() {
XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
float fCapReserve = 0;
CXFA_CaptionData captionData = m_pDataAcc->GetCaptionData();
- if (captionData.HasValidNode() &&
- captionData.GetPresence() != XFA_ATTRIBUTEENUM_Hidden) {
- iCapPlacement = (XFA_ATTRIBUTEENUM)captionData.GetPlacementType();
+ if (captionData.HasValidNode() && !captionData.IsHidden()) {
+ iCapPlacement = captionData.GetPlacementType();
if (iCapPlacement == XFA_ATTRIBUTEENUM_Top && GetPrev()) {
m_rtCaption.Reset();
} else if (iCapPlacement == XFA_ATTRIBUTEENUM_Bottom && GetNext()) {
@@ -604,10 +603,8 @@ void CXFA_FFField::RenderCaption(CXFA_Graphics* pGS, CFX_Matrix* pMatrix) {
return;
CXFA_CaptionData captionData = m_pDataAcc->GetCaptionData();
- if (!captionData.HasValidNode() ||
- captionData.GetPresence() != XFA_ATTRIBUTEENUM_Visible) {
+ if (!captionData.HasValidNode() || !captionData.IsVisible())
return;
- }
if (!pCapTextLayout->IsLoaded())
pCapTextLayout->Layout(CFX_SizeF(m_rtCaption.width, m_rtCaption.height));