summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fxjs/cjx_node.cpp9
-rw-r--r--fxjs/cjx_node.h11
2 files changed, 10 insertions, 10 deletions
diff --git a/fxjs/cjx_node.cpp b/fxjs/cjx_node.cpp
index e0fbe2f51d..7d919c1cff 100644
--- a/fxjs/cjx_node.cpp
+++ b/fxjs/cjx_node.cpp
@@ -3014,7 +3014,7 @@ bool CJX_Node::SetMeasure(XFA_ATTRIBUTE eAttr,
bool bNotify) {
void* pKey = GetMapKey_Element(GetXFANode()->GetElementType(), eAttr);
OnChanging(eAttr, bNotify);
- SetMapModuleBuffer(pKey, &mValue, sizeof(CXFA_Measurement));
+ SetMapModuleBuffer(pKey, &mValue, sizeof(CXFA_Measurement), nullptr);
OnChanged(eAttr, bNotify, false);
return true;
}
@@ -3025,7 +3025,8 @@ bool CJX_Node::TryMeasure(XFA_ATTRIBUTE eAttr,
void* pKey = GetMapKey_Element(GetXFANode()->GetElementType(), eAttr);
void* pValue;
int32_t iBytes;
- if (GetMapModuleBuffer(pKey, pValue, iBytes) && iBytes == sizeof(mValue)) {
+ if (GetMapModuleBuffer(pKey, pValue, iBytes, true) &&
+ iBytes == sizeof(mValue)) {
memcpy(&mValue, pValue, sizeof(mValue));
return true;
}
@@ -3692,13 +3693,13 @@ bool CJX_Node::GetMapModuleValue(void* pKey, void*& pValue) {
void CJX_Node::SetMapModuleString(void* pKey, const WideStringView& wsValue) {
SetMapModuleBuffer(pKey, (void*)wsValue.unterminated_c_str(),
- wsValue.GetLength() * sizeof(wchar_t));
+ wsValue.GetLength() * sizeof(wchar_t), nullptr);
}
bool CJX_Node::GetMapModuleString(void* pKey, WideStringView& wsValue) {
void* pValue;
int32_t iBytes;
- if (!GetMapModuleBuffer(pKey, pValue, iBytes))
+ if (!GetMapModuleBuffer(pKey, pValue, iBytes, true))
return false;
// Defensive measure: no out-of-bounds pointers even if zero length.
int32_t iChars = iBytes / sizeof(wchar_t);
diff --git a/fxjs/cjx_node.h b/fxjs/cjx_node.h
index 1864643f91..77092d434b 100644
--- a/fxjs/cjx_node.h
+++ b/fxjs/cjx_node.h
@@ -434,15 +434,14 @@ class CJX_Node : public CJX_Object {
bool GetMapModuleValue(void* pKey, void*& pValue);
void SetMapModuleString(void* pKey, const WideStringView& wsValue);
bool GetMapModuleString(void* pKey, WideStringView& wsValue);
- void SetMapModuleBuffer(
- void* pKey,
- void* pValue,
- int32_t iBytes,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo = nullptr);
+ void SetMapModuleBuffer(void* pKey,
+ void* pValue,
+ int32_t iBytes,
+ XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo);
bool GetMapModuleBuffer(void* pKey,
void*& pValue,
int32_t& iBytes,
- bool bProtoAlso = true) const;
+ bool bProtoAlso) const;
bool HasMapModuleKey(void* pKey);
void RemoveMapModuleKey(void* pKey = nullptr);
void MoveBufferMapData(CXFA_Node* pDstModule, void* pKey);