summaryrefslogtreecommitdiff
path: root/fxjs/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/xfa')
-rw-r--r--fxjs/xfa/cjx_object.cpp19
-rw-r--r--fxjs/xfa/cjx_object.h4
2 files changed, 12 insertions, 11 deletions
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index 5a2c4bd130..bb8eef123e 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -51,8 +51,8 @@ void XFA_CopyWideString(void*& pData) {
pData = new WideString(*reinterpret_cast<WideString*>(pData));
}
-XFA_MAPDATABLOCKCALLBACKINFO deleteWideStringCallBack = {XFA_DeleteWideString,
- XFA_CopyWideString};
+const XFA_MAPDATABLOCKCALLBACKINFO deleteWideStringCallBack = {
+ XFA_DeleteWideString, XFA_CopyWideString};
enum XFA_KEYTYPE {
XFA_KEYTYPE_Custom,
@@ -72,8 +72,8 @@ void* GetMapKey_Element(XFA_Element eType, XFA_Attribute eAttribute) {
void XFA_DefaultFreeData(void* pData) {}
-XFA_MAPDATABLOCKCALLBACKINFO gs_XFADefaultFreeData = {XFA_DefaultFreeData,
- nullptr};
+const XFA_MAPDATABLOCKCALLBACKINFO gs_XFADefaultFreeData = {XFA_DefaultFreeData,
+ nullptr};
std::tuple<int32_t, int32_t, int32_t> StrToRGB(const WideString& strRGB) {
int32_t r = 0;
@@ -111,7 +111,7 @@ std::tuple<int32_t, int32_t, int32_t> StrToRGB(const WideString& strRGB) {
struct XFA_MAPDATABLOCK {
uint8_t* GetData() const { return (uint8_t*)this + sizeof(XFA_MAPDATABLOCK); }
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo;
+ const XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo;
int32_t iBytes;
};
@@ -949,9 +949,10 @@ CXFA_Node* CJX_Object::GetOrCreatePropertyInternal(int32_t index,
return pNewNode;
}
-bool CJX_Object::SetUserData(void* pKey,
- void* pData,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
+bool CJX_Object::SetUserData(
+ void* pKey,
+ void* pData,
+ const XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
SetMapModuleBuffer(pKey, &pData, sizeof(void*),
pCallbackInfo ? pCallbackInfo : &gs_XFADefaultFreeData);
return true;
@@ -1004,7 +1005,7 @@ void CJX_Object::SetMapModuleBuffer(
void* pKey,
void* pValue,
int32_t iBytes,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
+ const XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) {
XFA_MAPDATABLOCK*& pBuffer = CreateMapModuleData()->m_BufferMap[pKey];
if (!pBuffer) {
pBuffer = reinterpret_cast<XFA_MAPDATABLOCK*>(
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index 12b58b0af8..88f1d8c814 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -243,7 +243,7 @@ class CJX_Object {
void OnChanging(XFA_Attribute eAttr, bool bNotify);
bool SetUserData(void* pKey,
void* pData,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo);
+ const XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo);
// Returns a pointer to the XML node that needs to be updated with the new
// attribute value. |nullptr| if no update is needed.
@@ -261,7 +261,7 @@ class CJX_Object {
void SetMapModuleBuffer(void* pKey,
void* pValue,
int32_t iBytes,
- XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo);
+ const XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo);
bool GetMapModuleBuffer(void* pKey,
void*& pValue,
int32_t& iBytes,