summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser')
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.cpp42
-rw-r--r--xfa/fxfa/parser/cxfa_widgetdata.h12
2 files changed, 36 insertions, 18 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp
index 72c2d7fd34..3938884d0d 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.cpp
+++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp
@@ -327,28 +327,46 @@ CXFA_BindData CXFA_WidgetData::GetBindData() {
m_pNode->JSNode()->GetProperty(0, XFA_Element::Bind, false));
}
-bool CXFA_WidgetData::TryWidth(float& fWidth) {
- return TryMeasure(XFA_Attribute::W, fWidth);
+pdfium::Optional<float> CXFA_WidgetData::TryWidth() {
+ float width = 0;
+ if (TryMeasure(XFA_Attribute::W, width))
+ return {width};
+ return {};
}
-bool CXFA_WidgetData::TryHeight(float& fHeight) {
- return TryMeasure(XFA_Attribute::H, fHeight);
+pdfium::Optional<float> CXFA_WidgetData::TryHeight() {
+ float height = 0;
+ if (TryMeasure(XFA_Attribute::H, height))
+ return {height};
+ return {};
}
-bool CXFA_WidgetData::TryMinWidth(float& fMinWidth) {
- return TryMeasure(XFA_Attribute::MinW, fMinWidth);
+pdfium::Optional<float> CXFA_WidgetData::TryMinWidth() {
+ float minWidth = 0;
+ if (TryMeasure(XFA_Attribute::MinW, minWidth))
+ return {minWidth};
+ return {};
}
-bool CXFA_WidgetData::TryMinHeight(float& fMinHeight) {
- return TryMeasure(XFA_Attribute::MinH, fMinHeight);
+pdfium::Optional<float> CXFA_WidgetData::TryMinHeight() {
+ float minHeight = 0;
+ if (TryMeasure(XFA_Attribute::MinH, minHeight))
+ return {minHeight};
+ return {};
}
-bool CXFA_WidgetData::TryMaxWidth(float& fMaxWidth) {
- return TryMeasure(XFA_Attribute::MaxW, fMaxWidth);
+pdfium::Optional<float> CXFA_WidgetData::TryMaxWidth() {
+ float maxWidth = 0;
+ if (TryMeasure(XFA_Attribute::MaxW, maxWidth))
+ return {maxWidth};
+ return {};
}
-bool CXFA_WidgetData::TryMaxHeight(float& fMaxHeight) {
- return TryMeasure(XFA_Attribute::MaxH, fMaxHeight);
+pdfium::Optional<float> CXFA_WidgetData::TryMaxHeight() {
+ float maxHeight = 0;
+ if (TryMeasure(XFA_Attribute::MaxH, maxHeight))
+ return {maxHeight};
+ return {};
}
CXFA_BorderData CXFA_WidgetData::GetUIBorderData() {
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.h b/xfa/fxfa/parser/cxfa_widgetdata.h
index 9d955a3d99..309f00fe12 100644
--- a/xfa/fxfa/parser/cxfa_widgetdata.h
+++ b/xfa/fxfa/parser/cxfa_widgetdata.h
@@ -61,12 +61,12 @@ class CXFA_WidgetData : public CXFA_DataData {
CXFA_CalculateData GetCalculateData();
CXFA_ValidateData GetValidateData(bool bModified);
- bool TryWidth(float& fWidth);
- bool TryHeight(float& fHeight);
- bool TryMinWidth(float& fMinWidth);
- bool TryMinHeight(float& fMinHeight);
- bool TryMaxWidth(float& fMaxWidth);
- bool TryMaxHeight(float& fMaxHeight);
+ pdfium::Optional<float> TryWidth();
+ pdfium::Optional<float> TryHeight();
+ pdfium::Optional<float> TryMinWidth();
+ pdfium::Optional<float> TryMinHeight();
+ pdfium::Optional<float> TryMaxWidth();
+ pdfium::Optional<float> TryMaxHeight();
CXFA_BorderData GetUIBorderData();
CFX_RectF GetUIMargin();