summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_widgetdata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-03 15:46:55 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-03 21:10:00 +0000
commitc635c93c974db1c55032c36e81e98f3d214a249f (patch)
tree145a60ec7a1d43755e85e36890f73ba0e4625361 /xfa/fxfa/parser/cxfa_widgetdata.cpp
parent3cdcfeb04b5c496199d8c88ebd2402c3db4413ab (diff)
downloadpdfium-c635c93c974db1c55032c36e81e98f3d214a249f.tar.xz
Remove the ::GetCapacity methods.
The GetCapacity methods return a void* because they return different types of internal class memory based on what the calling parameter was. This is confusing and makes it difficult to tell when then enum values can be removed. This CL removes GetCapacity and adds methods as needed to get the real values. Change-Id: I64c2edc858220624880e27f4ed49c2dae080f462 Reviewed-on: https://pdfium-review.googlesource.com/2137 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_widgetdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp27
1 files changed, 13 insertions, 14 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 48a26aafad..80c50b781e 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -399,29 +399,27 @@ bool CXFA_WidgetData::GetMaxHeight(FX_FLOAT& fMaxHeight) {
return TryMeasure(XFA_ATTRIBUTE_MaxH, fMaxHeight);
}
-CXFA_Border CXFA_WidgetData::GetUIBorder(bool bModified) {
+CXFA_Border CXFA_WidgetData::GetUIBorder() {
CXFA_Node* pUIChild = GetUIChild();
- return CXFA_Border(
- pUIChild ? pUIChild->GetProperty(0, XFA_Element::Border, bModified)
- : nullptr);
+ return CXFA_Border(pUIChild
+ ? pUIChild->GetProperty(0, XFA_Element::Border, false)
+ : nullptr);
}
-CXFA_Margin CXFA_WidgetData::GetUIMargin(bool bModified) {
+CFX_RectF CXFA_WidgetData::GetUIMargin() {
+ CFX_RectF rtUIMargin;
+ rtUIMargin.Reset();
+
CXFA_Node* pUIChild = GetUIChild();
- return CXFA_Margin(
- pUIChild ? pUIChild->GetProperty(0, XFA_Element::Margin, bModified)
+ CXFA_Margin mgUI = CXFA_Margin(
+ pUIChild ? pUIChild->GetProperty(0, XFA_Element::Margin, false)
: nullptr);
-}
-
-void CXFA_WidgetData::GetUIMargin(CFX_RectF& rtUIMargin) {
- rtUIMargin.Reset();
- CXFA_Margin mgUI = GetUIMargin();
if (!mgUI)
- return;
+ return rtUIMargin;
CXFA_Border border = GetUIBorder();
if (border && border.GetPresence() != XFA_ATTRIBUTEENUM_Visible)
- return;
+ return rtUIMargin;
FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset;
bool bLeft = mgUI.GetLeftInset(fLeftInset);
@@ -446,6 +444,7 @@ void CXFA_WidgetData::GetUIMargin(CFX_RectF& rtUIMargin) {
}
}
rtUIMargin.Set(fLeftInset, fTopInset, fRightInset, fBottomInset);
+ return rtUIMargin;
}
int32_t CXFA_WidgetData::GetButtonHighlight() {