7#include "xfa/fxfa/parser/cxfa_occur.h"
9#include "fxjs/xfa/cjx_occur.h"
10#include "xfa/fxfa/parser/cxfa_document.h"
32 {XFA_XDPPACKET::kTemplate, XFA_XDPPACKET::kForm},
37 cppgc::MakeGarbageCollected<CJX_Occur>(
38 doc->GetHeap()->GetAllocationHandle(),
44 absl::optional<int32_t> max =
45 JSObject()->TryInteger(XFA_Attribute::Max,
true);
46 return max.has_value() ? max.value() : GetMin();
50 absl::optional<int32_t> min =
51 JSObject()->TryInteger(XFA_Attribute::Min,
true);
52 return min.has_value() && min.value() >= 0 ? min.value() : 1;
59 absl::optional<int32_t> init =
60 JSObject()->TryInteger(XFA_Attribute::Initial,
false);
62 init.has_value() && init.value() >= iMin ? init.value() : iMin};
65void CXFA_Occur::
SetMax(int32_t iMax) {
66 iMax = (iMax != -1 && iMax < 1) ? 1 : iMax;
70 if (iMax != -1 && iMax < iMin) {
76void CXFA_Occur::
SetMin(int32_t iMin) {
77 iMin = (iMin < 0) ? 1 : iMin;
81 if (iMax > 0 && iMax < iMin) {
void SetMax(int32_t iMax)
std::tuple< int32_t, int32_t, int32_t > GetOccurInfo()
void SetMin(int32_t iMin)