Remove default value from CJX_Node::{Set|Try}Measure
This CL removes the default values from {Set|Try}Measure and inlines
into the call sites.
Change-Id: I2356b92d419203cc1cdbea865b6e04b728430f5a
Reviewed-on: https://pdfium-review.googlesource.com/17551
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index 12b151c..a492a32 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -106,10 +106,8 @@
bool TryMeasure(XFA_ATTRIBUTE eAttr,
CXFA_Measurement& mValue,
- bool bUseDefault = true) const;
- bool SetMeasure(XFA_ATTRIBUTE eAttr,
- CXFA_Measurement mValue,
- bool bNotify = false);
+ bool bUseDefault) const;
+ bool SetMeasure(XFA_ATTRIBUTE eAttr, CXFA_Measurement mValue, bool bNotify);
CXFA_Measurement GetMeasure(XFA_ATTRIBUTE eAttr) const;
bool SetUserData(void* pKey,
diff --git a/xfa/fxfa/parser/cxfa_caption.cpp b/xfa/fxfa/parser/cxfa_caption.cpp
index 5348a45..ccfe606 100644
--- a/xfa/fxfa/parser/cxfa_caption.cpp
+++ b/xfa/fxfa/parser/cxfa_caption.cpp
@@ -25,7 +25,7 @@
float CXFA_Caption::GetReserve() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_Reserve, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_Reserve, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
diff --git a/xfa/fxfa/parser/cxfa_data.cpp b/xfa/fxfa/parser/cxfa_data.cpp
index 37817c3..c54f9b1 100644
--- a/xfa/fxfa/parser/cxfa_data.cpp
+++ b/xfa/fxfa/parser/cxfa_data.cpp
@@ -78,5 +78,5 @@
bool CXFA_Data::SetMeasure(XFA_ATTRIBUTE eAttr, float fValue) {
CXFA_Measurement ms(fValue, XFA_UNIT_Pt);
- return m_pNode->JSNode()->SetMeasure(eAttr, ms);
+ return m_pNode->JSNode()->SetMeasure(eAttr, ms, false);
}
diff --git a/xfa/fxfa/parser/cxfa_font.cpp b/xfa/fxfa/parser/cxfa_font.cpp
index 209a3c6..2674ac5 100644
--- a/xfa/fxfa/parser/cxfa_font.cpp
+++ b/xfa/fxfa/parser/cxfa_font.cpp
@@ -64,7 +64,7 @@
float CXFA_Font::GetFontSize() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_Size, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_Size, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
diff --git a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
index a483d71..568b7eb 100644
--- a/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_layoutpagemgr.cpp
@@ -327,14 +327,14 @@
pPageArea->InsertChild(pContentArea, nullptr);
pContentArea->SetFlag(XFA_NodeFlag_Initialized, true);
- pContentArea->JSNode()->SetMeasure(XFA_ATTRIBUTE_X,
- CXFA_Measurement(0.25f, XFA_UNIT_In));
- pContentArea->JSNode()->SetMeasure(XFA_ATTRIBUTE_Y,
- CXFA_Measurement(0.25f, XFA_UNIT_In));
- pContentArea->JSNode()->SetMeasure(XFA_ATTRIBUTE_W,
- CXFA_Measurement(8.0f, XFA_UNIT_In));
- pContentArea->JSNode()->SetMeasure(XFA_ATTRIBUTE_H,
- CXFA_Measurement(10.5f, XFA_UNIT_In));
+ pContentArea->JSNode()->SetMeasure(
+ XFA_ATTRIBUTE_X, CXFA_Measurement(0.25f, XFA_UNIT_In), false);
+ pContentArea->JSNode()->SetMeasure(
+ XFA_ATTRIBUTE_Y, CXFA_Measurement(0.25f, XFA_UNIT_In), false);
+ pContentArea->JSNode()->SetMeasure(
+ XFA_ATTRIBUTE_W, CXFA_Measurement(8.0f, XFA_UNIT_In), false);
+ pContentArea->JSNode()->SetMeasure(
+ XFA_ATTRIBUTE_H, CXFA_Measurement(10.5f, XFA_UNIT_In), false);
}
CXFA_Node* pMedium = pPageArea->GetChild(0, XFA_Element::Medium);
if (!pMedium) {
@@ -346,9 +346,9 @@
pPageArea->InsertChild(pMedium, nullptr);
pMedium->SetFlag(XFA_NodeFlag_Initialized, true);
pMedium->JSNode()->SetMeasure(XFA_ATTRIBUTE_Short,
- CXFA_Measurement(8.5f, XFA_UNIT_In));
+ CXFA_Measurement(8.5f, XFA_UNIT_In), false);
pMedium->JSNode()->SetMeasure(XFA_ATTRIBUTE_Long,
- CXFA_Measurement(11.0f, XFA_UNIT_In));
+ CXFA_Measurement(11.0f, XFA_UNIT_In), false);
}
return true;
}
diff --git a/xfa/fxfa/parser/cxfa_para.cpp b/xfa/fxfa/parser/cxfa_para.cpp
index 1d7fe2d..34555a9 100644
--- a/xfa/fxfa/parser/cxfa_para.cpp
+++ b/xfa/fxfa/parser/cxfa_para.cpp
@@ -25,36 +25,36 @@
float CXFA_Para::GetLineHeight() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_LineHeight, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_LineHeight, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
float CXFA_Para::GetMarginLeft() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginLeft, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginLeft, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
float CXFA_Para::GetMarginRight() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginRight, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_MarginRight, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
float CXFA_Para::GetSpaceAbove() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceAbove, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceAbove, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
float CXFA_Para::GetSpaceBelow() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceBelow, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_SpaceBelow, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
float CXFA_Para::GetTextIndent() {
CXFA_Measurement ms;
- m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_TextIndent, ms);
+ m_pNode->JSNode()->TryMeasure(XFA_ATTRIBUTE_TextIndent, ms, true);
return ms.ToUnit(XFA_UNIT_Pt);
}
diff --git a/xfa/fxfa/parser/cxfa_stroke.cpp b/xfa/fxfa/parser/cxfa_stroke.cpp
index b83fc79..753527c 100644
--- a/xfa/fxfa/parser/cxfa_stroke.cpp
+++ b/xfa/fxfa/parser/cxfa_stroke.cpp
@@ -41,7 +41,7 @@
if (!m_pNode)
return;
- m_pNode->JSNode()->SetMeasure(XFA_ATTRIBUTE_Thickness, msThinkness);
+ m_pNode->JSNode()->SetMeasure(XFA_ATTRIBUTE_Thickness, msThinkness, false);
}
FX_ARGB CXFA_Stroke::GetColor() const {
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index eee383b..e44c77d 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -1270,7 +1270,7 @@
CXFA_Node* pUIChild = GetUIChild();
CXFA_Measurement mModuleWidthHeight;
if (pUIChild->JSNode()->TryMeasure(XFA_ATTRIBUTE_ModuleWidth,
- mModuleWidthHeight)) {
+ mModuleWidthHeight, true)) {
*val = static_cast<int32_t>(mModuleWidthHeight.ToUnit(XFA_UNIT_Pt));
return true;
}
@@ -1281,7 +1281,7 @@
CXFA_Node* pUIChild = GetUIChild();
CXFA_Measurement mModuleWidthHeight;
if (pUIChild->JSNode()->TryMeasure(XFA_ATTRIBUTE_ModuleHeight,
- mModuleWidthHeight)) {
+ mModuleWidthHeight, true)) {
*val = static_cast<int32_t>(mModuleWidthHeight.ToUnit(XFA_UNIT_Pt));
return true;
}