summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-02 20:42:48 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-02 20:42:48 +0000
commita39b3caf5170778981f50cc1dffea47f28acd50e (patch)
tree673b239b2755c197f5baad3cda067b3bfa3dc686 /fxjs
parent8bafef176a2a810373a386373fa3f558ae427984 (diff)
downloadpdfium-a39b3caf5170778981f50cc1dffea47f28acd50e.tar.xz
Remove default params from some Map Module methods
This CL removes the default value from {Set|Get}MapModuleBuffer and inlines into the call sites. Change-Id: Ia003bec3908a1531e572e25ea0a762973b8beebe Reviewed-on: https://pdfium-review.googlesource.com/17630 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxjs')
-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);