void CJX_Field::defaultValue(CFXJSE_Value* pValue, bool bSetting, XFA_Attribute eAttribute) { CXFA_Node* xfaNode = GetXFANode(); if (!xfaNode->IsWidgetReady()) return; if (bSetting) { if (pValue) { xfaNode->SetPreNull(xfaNode->IsNull()); xfaNode->SetIsNull(pValue->IsNull()); } WideString wsNewText; if (pValue && !(pValue->IsNull() || pValue->IsUndefined())) wsNewText = pValue->ToWideString(); if (xfaNode->GetUIChildNode()->GetElementType() == XFA_Element::NumericEdit) wsNewText = xfaNode->NumericLimit(wsNewText); CXFA_Node* pContainerNode = xfaNode->GetContainerNode(); WideString wsFormatText(wsNewText); if (pContainerNode) wsFormatText = pContainerNode->GetFormatDataValue(wsNewText); SetContent(wsNewText, wsFormatText, true, true, true); return; } WideString content = GetContent(true); if (content.IsEmpty()) { pValue->SetNull(); return; } CXFA_Node* formValue = xfaNode->GetFormValueIfExists(); CXFA_Node* pNode = formValue ? formValue->GetFirstChild() : nullptr; if (pNode && pNode->GetElementType() == XFA_Element::Decimal) { if (xfaNode->GetUIChildNode()->GetElementType() == XFA_Element::NumericEdit && (pNode->JSObject()->GetInteger(XFA_Attribute::FracDigits) == -1)) { pValue->SetString(content.ToUTF8().AsStringView()); } else { CFX_Decimal decimal(content.AsStringView()); pValue->SetFloat((float)(double)decimal); } } else if (pNode && pNode->GetElementType() == XFA_Element::Integer) { pValue->SetInteger(FXSYS_wtoi(content.c_str())); } else if (pNode && pNode->GetElementType() == XFA_Element::Boolean) { pValue->SetBoolean(FXSYS_wtoi(content.c_str()) == 0 ? false : true); } else if (pNode && pNode->GetElementType() == XFA_Element::Float) { CFX_Decimal decimal(content.AsStringView()); pValue->SetFloat((float)(double)decimal); } else { pValue->SetString(content.ToUTF8().AsStringView()); } }
FX_FLOAT CXFA_Font::GetVerticalScale() { CFX_WideString wsValue; m_pNode->TryCData(XFA_ATTRIBUTE_FontVerticalScale, wsValue); int32_t iScale = FXSYS_wtoi(wsValue.c_str()); return iScale > 0 ? (FX_FLOAT)iScale : 100.0f; }
++nMaxLen; continue; } int nItemLen = 0; int nWidth = 0; for (; *pStr != 0; pStr++) { if (*pStr == '#') { nMaxLen += 2; } else if (*pStr == '*') { nWidth = va_arg(argList, int); } else if (*pStr != '-' && *pStr != '+' && *pStr != '0' && *pStr != ' ') { break; } } if (nWidth == 0) { nWidth = FXSYS_wtoi(pStr); while (FXSYS_IsDecimalDigit(*pStr)) ++pStr; } if (nWidth < 0 || nWidth > 128 * 1024) return Optional<size_t>(); int nPrecision = 0; if (*pStr == '.') { pStr++; if (*pStr == '*') { nPrecision = va_arg(argList, int); pStr++; } else { nPrecision = FXSYS_wtoi(pStr); while (FXSYS_IsDecimalDigit(*pStr)) ++pStr;