OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/src/foxitlib.h" | 7 #include "xfa/src/foxitlib.h" |
8 #include "xfa/src/fxfa/src/common/xfa_docdata.h" | 8 #include "xfa/src/fxfa/src/common/xfa_docdata.h" |
9 #include "xfa/src/fxfa/src/common/xfa_doclayout.h" | 9 #include "xfa/src/fxfa/src/common/xfa_doclayout.h" |
10 #include "xfa/src/fxfa/src/common/xfa_document.h" | 10 #include "xfa/src/fxfa/src/common/xfa_document.h" |
(...skipping 4989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5000 CFX_WideStringC wsTag = GetCData(XFA_ATTRIBUTE_Name); | 5000 CFX_WideStringC wsTag = GetCData(XFA_ATTRIBUTE_Name); |
5001 m_pXMLNode = IFDE_XMLElement::Create(wsTag); | 5001 m_pXMLNode = IFDE_XMLElement::Create(wsTag); |
5002 SetFlag(XFA_NODEFLAG_OwnXMLNode, TRUE, FALSE); | 5002 SetFlag(XFA_NODEFLAG_OwnXMLNode, TRUE, FALSE); |
5003 } | 5003 } |
5004 return m_pXMLNode; | 5004 return m_pXMLNode; |
5005 } | 5005 } |
5006 FX_BOOL CXFA_Node::IsNeedSavingXMLNode() { | 5006 FX_BOOL CXFA_Node::IsNeedSavingXMLNode() { |
5007 return m_pXMLNode && (GetPacketID() == XFA_XDPPACKET_Datasets || | 5007 return m_pXMLNode && (GetPacketID() == XFA_XDPPACKET_Datasets || |
5008 GetClassID() == XFA_ELEMENT_Xfa); | 5008 GetClassID() == XFA_ELEMENT_Xfa); |
5009 } | 5009 } |
5010 XFA_LPMAPMODULEDATA CXFA_Node::GetMapModuleData(FX_BOOL bCreateNew) { | 5010 XFA_MAPMODULEDATA* CXFA_Node::GetMapModuleData(FX_BOOL bCreateNew) { |
5011 if (!m_pMapModuleData && bCreateNew) { | 5011 if (!m_pMapModuleData && bCreateNew) { |
5012 m_pMapModuleData = new XFA_MAPMODULEDATA; | 5012 m_pMapModuleData = new XFA_MAPMODULEDATA; |
5013 } | 5013 } |
5014 return m_pMapModuleData; | 5014 return m_pMapModuleData; |
5015 } | 5015 } |
5016 void CXFA_Node::SetMapModuleValue(void* pKey, void* pValue) { | 5016 void CXFA_Node::SetMapModuleValue(void* pKey, void* pValue) { |
5017 XFA_LPMAPMODULEDATA pModule = GetMapModuleData(TRUE); | 5017 XFA_MAPMODULEDATA* pModule = GetMapModuleData(TRUE); |
5018 if (pModule) | 5018 if (pModule) |
5019 pModule->m_ValueMap.SetAt(pKey, pValue); | 5019 pModule->m_ValueMap.SetAt(pKey, pValue); |
5020 } | 5020 } |
5021 FX_BOOL CXFA_Node::GetMapModuleValue(void* pKey, void*& pValue) { | 5021 FX_BOOL CXFA_Node::GetMapModuleValue(void* pKey, void*& pValue) { |
5022 CXFA_Node* pNode = this; | 5022 CXFA_Node* pNode = this; |
5023 while (pNode) { | 5023 while (pNode) { |
5024 XFA_LPMAPMODULEDATA pModule = pNode->GetMapModuleData(FALSE); | 5024 XFA_MAPMODULEDATA* pModule = pNode->GetMapModuleData(FALSE); |
5025 if (pModule && pModule->m_ValueMap.Lookup(pKey, pValue)) { | 5025 if (pModule && pModule->m_ValueMap.Lookup(pKey, pValue)) { |
5026 return TRUE; | 5026 return TRUE; |
5027 } | 5027 } |
5028 pNode = pNode->GetPacketID() != XFA_XDPPACKET_Datasets | 5028 pNode = pNode->GetPacketID() != XFA_XDPPACKET_Datasets |
5029 ? pNode->GetTemplateNode() | 5029 ? pNode->GetTemplateNode() |
5030 : NULL; | 5030 : NULL; |
5031 } | 5031 } |
5032 return FALSE; | 5032 return FALSE; |
5033 } | 5033 } |
5034 void CXFA_Node::SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue) { | 5034 void CXFA_Node::SetMapModuleString(void* pKey, const CFX_WideStringC& wsValue) { |
5035 SetMapModuleBuffer(pKey, (void*)wsValue.GetPtr(), | 5035 SetMapModuleBuffer(pKey, (void*)wsValue.GetPtr(), |
5036 wsValue.GetLength() * sizeof(FX_WCHAR)); | 5036 wsValue.GetLength() * sizeof(FX_WCHAR)); |
5037 } | 5037 } |
5038 FX_BOOL CXFA_Node::GetMapModuleString(void* pKey, CFX_WideStringC& wsValue) { | 5038 FX_BOOL CXFA_Node::GetMapModuleString(void* pKey, CFX_WideStringC& wsValue) { |
5039 void* pValue; | 5039 void* pValue; |
5040 int32_t iBytes; | 5040 int32_t iBytes; |
5041 if (!GetMapModuleBuffer(pKey, pValue, iBytes)) { | 5041 if (!GetMapModuleBuffer(pKey, pValue, iBytes)) { |
5042 return FALSE; | 5042 return FALSE; |
5043 } | 5043 } |
5044 wsValue = CFX_WideStringC((const FX_WCHAR*)pValue, iBytes / sizeof(FX_WCHAR)); | 5044 wsValue = CFX_WideStringC((const FX_WCHAR*)pValue, iBytes / sizeof(FX_WCHAR)); |
5045 return TRUE; | 5045 return TRUE; |
5046 } | 5046 } |
5047 void CXFA_Node::SetMapModuleBuffer( | 5047 void CXFA_Node::SetMapModuleBuffer( |
5048 void* pKey, | 5048 void* pKey, |
5049 void* pValue, | 5049 void* pValue, |
5050 int32_t iBytes, | 5050 int32_t iBytes, |
5051 XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { | 5051 XFA_MAPDATABLOCKCALLBACKINFO* pCallbackInfo) { |
5052 XFA_LPMAPMODULEDATA pModule = GetMapModuleData(TRUE); | 5052 XFA_MAPMODULEDATA* pModule = GetMapModuleData(TRUE); |
5053 if (!pModule) | 5053 if (!pModule) |
5054 return; | 5054 return; |
5055 | 5055 |
5056 XFA_LPMAPDATABLOCK& pBuffer = pModule->m_BufferMap[pKey]; | 5056 XFA_MAPDATABLOCK*& pBuffer = pModule->m_BufferMap[pKey]; |
5057 if (pBuffer == NULL) { | 5057 if (pBuffer == NULL) { |
5058 pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc(uint8_t, | 5058 pBuffer = |
5059 sizeof(XFA_MAPDATABLOCK) + iBytes); | 5059 (XFA_MAPDATABLOCK*)FX_Alloc(uint8_t, sizeof(XFA_MAPDATABLOCK) + iBytes); |
5060 } else if (pBuffer->iBytes != iBytes) { | 5060 } else if (pBuffer->iBytes != iBytes) { |
5061 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { | 5061 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { |
5062 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); | 5062 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); |
5063 } | 5063 } |
5064 pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc(uint8_t, pBuffer, | 5064 pBuffer = (XFA_MAPDATABLOCK*)FX_Realloc(uint8_t, pBuffer, |
5065 sizeof(XFA_MAPDATABLOCK) + iBytes); | 5065 sizeof(XFA_MAPDATABLOCK) + iBytes); |
5066 } else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { | 5066 } else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { |
5067 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); | 5067 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); |
5068 } | 5068 } |
5069 if (pBuffer == NULL) { | 5069 if (pBuffer == NULL) { |
5070 return; | 5070 return; |
5071 } | 5071 } |
5072 pBuffer->pCallbackInfo = pCallbackInfo; | 5072 pBuffer->pCallbackInfo = pCallbackInfo; |
5073 pBuffer->iBytes = iBytes; | 5073 pBuffer->iBytes = iBytes; |
5074 FXSYS_memcpy(pBuffer->GetData(), pValue, iBytes); | 5074 FXSYS_memcpy(pBuffer->GetData(), pValue, iBytes); |
5075 } | 5075 } |
5076 FX_BOOL CXFA_Node::GetMapModuleBuffer(void* pKey, | 5076 FX_BOOL CXFA_Node::GetMapModuleBuffer(void* pKey, |
5077 void*& pValue, | 5077 void*& pValue, |
5078 int32_t& iBytes, | 5078 int32_t& iBytes, |
5079 FX_BOOL bProtoAlso) { | 5079 FX_BOOL bProtoAlso) { |
5080 XFA_LPMAPDATABLOCK pBuffer = NULL; | 5080 XFA_MAPDATABLOCK* pBuffer = NULL; |
5081 CXFA_Node* pNode = this; | 5081 CXFA_Node* pNode = this; |
5082 while (pNode) { | 5082 while (pNode) { |
5083 XFA_LPMAPMODULEDATA pModule = pNode->GetMapModuleData(FALSE); | 5083 XFA_MAPMODULEDATA* pModule = pNode->GetMapModuleData(FALSE); |
5084 if (pModule && pModule->m_BufferMap.Lookup(pKey, pBuffer)) { | 5084 if (pModule && pModule->m_BufferMap.Lookup(pKey, pBuffer)) { |
5085 break; | 5085 break; |
5086 } | 5086 } |
5087 pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets) | 5087 pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets) |
5088 ? pNode->GetTemplateNode() | 5088 ? pNode->GetTemplateNode() |
5089 : NULL; | 5089 : NULL; |
5090 } | 5090 } |
5091 if (pBuffer == NULL) { | 5091 if (pBuffer == NULL) { |
5092 return FALSE; | 5092 return FALSE; |
5093 } | 5093 } |
5094 pValue = pBuffer->GetData(); | 5094 pValue = pBuffer->GetData(); |
5095 iBytes = pBuffer->iBytes; | 5095 iBytes = pBuffer->iBytes; |
5096 return TRUE; | 5096 return TRUE; |
5097 } | 5097 } |
5098 FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) { | 5098 FX_BOOL CXFA_Node::HasMapModuleKey(void* pKey, FX_BOOL bProtoAlso) { |
5099 CXFA_Node* pNode = this; | 5099 CXFA_Node* pNode = this; |
5100 while (pNode) { | 5100 while (pNode) { |
5101 void* pVal; | 5101 void* pVal; |
5102 XFA_LPMAPMODULEDATA pModule = pNode->GetMapModuleData(FALSE); | 5102 XFA_MAPMODULEDATA* pModule = pNode->GetMapModuleData(FALSE); |
5103 if (pModule && | 5103 if (pModule && |
5104 (pModule->m_ValueMap.Lookup(pKey, pVal) || | 5104 (pModule->m_ValueMap.Lookup(pKey, pVal) || |
5105 pModule->m_BufferMap.Lookup(pKey, (XFA_LPMAPDATABLOCK&)pVal))) { | 5105 pModule->m_BufferMap.Lookup(pKey, (XFA_MAPDATABLOCK*&)pVal))) { |
5106 return TRUE; | 5106 return TRUE; |
5107 } | 5107 } |
5108 pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets) | 5108 pNode = (bProtoAlso && pNode->GetPacketID() != XFA_XDPPACKET_Datasets) |
5109 ? pNode->GetTemplateNode() | 5109 ? pNode->GetTemplateNode() |
5110 : NULL; | 5110 : NULL; |
5111 } | 5111 } |
5112 return FALSE; | 5112 return FALSE; |
5113 } | 5113 } |
5114 void CXFA_Node::RemoveMapModuleKey(void* pKey) { | 5114 void CXFA_Node::RemoveMapModuleKey(void* pKey) { |
5115 XFA_LPMAPMODULEDATA pModule = GetMapModuleData(FALSE); | 5115 XFA_MAPMODULEDATA* pModule = GetMapModuleData(FALSE); |
5116 if (!pModule) | 5116 if (!pModule) |
5117 return; | 5117 return; |
5118 | 5118 |
5119 if (pKey) { | 5119 if (pKey) { |
5120 XFA_LPMAPDATABLOCK pBuffer = NULL; | 5120 XFA_MAPDATABLOCK* pBuffer = NULL; |
5121 pModule->m_BufferMap.Lookup(pKey, pBuffer); | 5121 pModule->m_BufferMap.Lookup(pKey, pBuffer); |
5122 if (pBuffer) { | 5122 if (pBuffer) { |
5123 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { | 5123 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { |
5124 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); | 5124 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); |
5125 } | 5125 } |
5126 FX_Free(pBuffer); | 5126 FX_Free(pBuffer); |
5127 } | 5127 } |
5128 pModule->m_BufferMap.RemoveKey(pKey); | 5128 pModule->m_BufferMap.RemoveKey(pKey); |
5129 pModule->m_ValueMap.RemoveKey(pKey); | 5129 pModule->m_ValueMap.RemoveKey(pKey); |
5130 } else { | 5130 } else { |
5131 XFA_LPMAPDATABLOCK pBuffer; | 5131 XFA_MAPDATABLOCK* pBuffer; |
5132 FX_POSITION posBuffer = pModule->m_BufferMap.GetStartPosition(); | 5132 FX_POSITION posBuffer = pModule->m_BufferMap.GetStartPosition(); |
5133 while (posBuffer) { | 5133 while (posBuffer) { |
5134 pModule->m_BufferMap.GetNextAssoc(posBuffer, pKey, pBuffer); | 5134 pModule->m_BufferMap.GetNextAssoc(posBuffer, pKey, pBuffer); |
5135 if (pBuffer) { | 5135 if (pBuffer) { |
5136 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { | 5136 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { |
5137 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); | 5137 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); |
5138 } | 5138 } |
5139 FX_Free(pBuffer); | 5139 FX_Free(pBuffer); |
5140 } | 5140 } |
5141 } | 5141 } |
5142 pModule->m_BufferMap.RemoveAll(); | 5142 pModule->m_BufferMap.RemoveAll(); |
5143 pModule->m_ValueMap.RemoveAll(); | 5143 pModule->m_ValueMap.RemoveAll(); |
5144 delete pModule; | 5144 delete pModule; |
5145 } | 5145 } |
5146 } | 5146 } |
5147 void CXFA_Node::MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr) { | 5147 void CXFA_Node::MergeAllData(void* pDstModule, FX_BOOL bUseSrcAttr) { |
5148 XFA_LPMAPMODULEDATA pDstModuleData = | 5148 XFA_MAPMODULEDATA* pDstModuleData = |
5149 static_cast<CXFA_Node*>(pDstModule)->GetMapModuleData(TRUE); | 5149 static_cast<CXFA_Node*>(pDstModule)->GetMapModuleData(TRUE); |
5150 if (!pDstModuleData) { | 5150 if (!pDstModuleData) { |
5151 return; | 5151 return; |
5152 } | 5152 } |
5153 XFA_LPMAPMODULEDATA pSrcModuleData = GetMapModuleData(FALSE); | 5153 XFA_MAPMODULEDATA* pSrcModuleData = this->GetMapModuleData(FALSE); |
5154 if (!pSrcModuleData) { | 5154 if (!pSrcModuleData) { |
5155 return; | 5155 return; |
5156 } | 5156 } |
5157 FX_POSITION psValue = pSrcModuleData->m_ValueMap.GetStartPosition(); | 5157 FX_POSITION psValue = pSrcModuleData->m_ValueMap.GetStartPosition(); |
5158 while (psValue) { | 5158 while (psValue) { |
5159 void* pKey; | 5159 void* pKey; |
5160 void* pValue; | 5160 void* pValue; |
5161 pSrcModuleData->m_ValueMap.GetNextAssoc(psValue, pKey, pValue); | 5161 pSrcModuleData->m_ValueMap.GetNextAssoc(psValue, pKey, pValue); |
5162 if (bUseSrcAttr || !pDstModuleData->m_ValueMap.GetValueAt(pKey)) { | 5162 if (bUseSrcAttr || !pDstModuleData->m_ValueMap.GetValueAt(pKey)) { |
5163 pDstModuleData->m_ValueMap.SetAt(pKey, pValue); | 5163 pDstModuleData->m_ValueMap.SetAt(pKey, pValue); |
5164 } | 5164 } |
5165 } | 5165 } |
5166 FX_POSITION psBuffer = pSrcModuleData->m_BufferMap.GetStartPosition(); | 5166 FX_POSITION psBuffer = pSrcModuleData->m_BufferMap.GetStartPosition(); |
5167 while (psBuffer) { | 5167 while (psBuffer) { |
5168 void* pKey; | 5168 void* pKey; |
5169 XFA_LPMAPDATABLOCK pSrcBuffer; | 5169 XFA_MAPDATABLOCK* pSrcBuffer; |
5170 pSrcModuleData->m_BufferMap.GetNextAssoc(psBuffer, pKey, pSrcBuffer); | 5170 pSrcModuleData->m_BufferMap.GetNextAssoc(psBuffer, pKey, pSrcBuffer); |
5171 XFA_LPMAPDATABLOCK& pBuffer = pDstModuleData->m_BufferMap[pKey]; | 5171 XFA_MAPDATABLOCK*& pBuffer = pDstModuleData->m_BufferMap[pKey]; |
5172 if (pBuffer && !bUseSrcAttr) { | 5172 if (pBuffer && !bUseSrcAttr) { |
5173 continue; | 5173 continue; |
5174 } | 5174 } |
5175 if (pSrcBuffer->pCallbackInfo && pSrcBuffer->pCallbackInfo->pFree && | 5175 if (pSrcBuffer->pCallbackInfo && pSrcBuffer->pCallbackInfo->pFree && |
5176 !pSrcBuffer->pCallbackInfo->pCopy) { | 5176 !pSrcBuffer->pCallbackInfo->pCopy) { |
5177 if (pBuffer) { | 5177 if (pBuffer) { |
5178 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); | 5178 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); |
5179 pDstModuleData->m_BufferMap.RemoveKey(pKey); | 5179 pDstModuleData->m_BufferMap.RemoveKey(pKey); |
5180 } | 5180 } |
5181 continue; | 5181 continue; |
5182 } | 5182 } |
5183 if (pBuffer == NULL) { | 5183 if (pBuffer == NULL) { |
5184 pBuffer = (XFA_LPMAPDATABLOCK)FX_Alloc( | 5184 pBuffer = (XFA_MAPDATABLOCK*)FX_Alloc( |
5185 uint8_t, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); | 5185 uint8_t, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); |
5186 } else if (pBuffer->iBytes != pSrcBuffer->iBytes) { | 5186 } else if (pBuffer->iBytes != pSrcBuffer->iBytes) { |
5187 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { | 5187 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { |
5188 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); | 5188 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); |
5189 } | 5189 } |
5190 pBuffer = (XFA_LPMAPDATABLOCK)FX_Realloc( | 5190 pBuffer = (XFA_MAPDATABLOCK*)FX_Realloc( |
5191 uint8_t, pBuffer, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); | 5191 uint8_t, pBuffer, sizeof(XFA_MAPDATABLOCK) + pSrcBuffer->iBytes); |
5192 } else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { | 5192 } else if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pFree) { |
5193 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); | 5193 pBuffer->pCallbackInfo->pFree(*(void**)pBuffer->GetData()); |
5194 } | 5194 } |
5195 if (pBuffer == NULL) { | 5195 if (pBuffer == NULL) { |
5196 continue; | 5196 continue; |
5197 } | 5197 } |
5198 pBuffer->pCallbackInfo = pSrcBuffer->pCallbackInfo; | 5198 pBuffer->pCallbackInfo = pSrcBuffer->pCallbackInfo; |
5199 pBuffer->iBytes = pSrcBuffer->iBytes; | 5199 pBuffer->iBytes = pSrcBuffer->iBytes; |
5200 FXSYS_memcpy(pBuffer->GetData(), pSrcBuffer->GetData(), pSrcBuffer->iBytes); | 5200 FXSYS_memcpy(pBuffer->GetData(), pSrcBuffer->GetData(), pSrcBuffer->iBytes); |
5201 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pCopy) { | 5201 if (pBuffer->pCallbackInfo && pBuffer->pCallbackInfo->pCopy) { |
5202 pBuffer->pCallbackInfo->pCopy(*(void**)pBuffer->GetData()); | 5202 pBuffer->pCallbackInfo->pCopy(*(void**)pBuffer->GetData()); |
5203 } | 5203 } |
5204 } | 5204 } |
5205 } | 5205 } |
5206 void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) { | 5206 void CXFA_Node::MoveBufferMapData(CXFA_Node* pDstModule, void* pKey) { |
5207 if (!pDstModule) { | 5207 if (!pDstModule) { |
5208 return; | 5208 return; |
5209 } | 5209 } |
5210 FX_BOOL bNeedMove = TRUE; | 5210 FX_BOOL bNeedMove = TRUE; |
5211 if (!pKey) { | 5211 if (!pKey) { |
5212 bNeedMove = FALSE; | 5212 bNeedMove = FALSE; |
5213 } | 5213 } |
5214 if (pDstModule->GetClassID() != GetClassID()) { | 5214 if (pDstModule->GetClassID() != GetClassID()) { |
5215 bNeedMove = FALSE; | 5215 bNeedMove = FALSE; |
5216 } | 5216 } |
5217 XFA_LPMAPMODULEDATA pSrcModuleData = NULL; | 5217 XFA_MAPMODULEDATA* pSrcModuleData = NULL; |
5218 XFA_LPMAPMODULEDATA pDstModuleData = NULL; | 5218 XFA_MAPMODULEDATA* pDstModuleData = NULL; |
5219 if (bNeedMove) { | 5219 if (bNeedMove) { |
5220 pSrcModuleData = GetMapModuleData(FALSE); | 5220 pSrcModuleData = GetMapModuleData(FALSE); |
5221 if (!pSrcModuleData) { | 5221 if (!pSrcModuleData) { |
5222 bNeedMove = FALSE; | 5222 bNeedMove = FALSE; |
5223 } | 5223 } |
5224 pDstModuleData = pDstModule->GetMapModuleData(TRUE); | 5224 pDstModuleData = pDstModule->GetMapModuleData(TRUE); |
5225 if (!pDstModuleData) { | 5225 if (!pDstModuleData) { |
5226 bNeedMove = FALSE; | 5226 bNeedMove = FALSE; |
5227 } | 5227 } |
5228 } | 5228 } |
5229 if (bNeedMove) { | 5229 if (bNeedMove) { |
5230 void* pBufferBlockData = pSrcModuleData->m_BufferMap.GetValueAt(pKey); | 5230 void* pBufferBlockData = pSrcModuleData->m_BufferMap.GetValueAt(pKey); |
5231 if (pBufferBlockData) { | 5231 if (pBufferBlockData) { |
5232 pSrcModuleData->m_BufferMap.RemoveKey(pKey); | 5232 pSrcModuleData->m_BufferMap.RemoveKey(pKey); |
5233 pDstModuleData->m_BufferMap.RemoveKey(pKey); | 5233 pDstModuleData->m_BufferMap.RemoveKey(pKey); |
5234 pDstModuleData->m_BufferMap.SetAt(pKey, | 5234 pDstModuleData->m_BufferMap.SetAt(pKey, |
5235 (XFA_LPMAPDATABLOCK)pBufferBlockData); | 5235 (XFA_MAPDATABLOCK*)pBufferBlockData); |
5236 } | 5236 } |
5237 } | 5237 } |
5238 if (pDstModule->GetObjectType() == XFA_OBJECTTYPE_NodeV) { | 5238 if (pDstModule->GetObjectType() == XFA_OBJECTTYPE_NodeV) { |
5239 CFX_WideString wsValue = pDstModule->GetScriptContent(FALSE); | 5239 CFX_WideString wsValue = pDstModule->GetScriptContent(FALSE); |
5240 CFX_WideString wsFormatValue(wsValue); | 5240 CFX_WideString wsFormatValue(wsValue); |
5241 CXFA_WidgetData* pWidgetData = pDstModule->GetContainerWidgetData(); | 5241 CXFA_WidgetData* pWidgetData = pDstModule->GetContainerWidgetData(); |
5242 if (pWidgetData) { | 5242 if (pWidgetData) { |
5243 pWidgetData->GetFormatDataValue(wsValue, wsFormatValue); | 5243 pWidgetData->GetFormatDataValue(wsValue, wsFormatValue); |
5244 } | 5244 } |
5245 pDstModule->SetScriptContent(wsValue, wsFormatValue, TRUE, TRUE); | 5245 pDstModule->SetScriptContent(wsValue, wsFormatValue, TRUE, TRUE); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5430 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); | 5430 return m_pAttachNode->InsertChild(pNewNode, pBeforeNode); |
5431 } | 5431 } |
5432 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { | 5432 FX_BOOL CXFA_AttachNodeList::Remove(CXFA_Node* pNode) { |
5433 return m_pAttachNode->RemoveChild(pNode); | 5433 return m_pAttachNode->RemoveChild(pNode); |
5434 } | 5434 } |
5435 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { | 5435 CXFA_Node* CXFA_AttachNodeList::Item(int32_t iIndex) { |
5436 return m_pAttachNode->GetChild( | 5436 return m_pAttachNode->GetChild( |
5437 iIndex, XFA_ELEMENT_UNKNOWN, | 5437 iIndex, XFA_ELEMENT_UNKNOWN, |
5438 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform); | 5438 m_pAttachNode->GetClassID() == XFA_ELEMENT_Subform); |
5439 } | 5439 } |
OLD | NEW |