Merge to XFA: Remove typdefs for pointer types in fx_system.h.
[pdfium.git] / xfa / src / fxfa / src / parser / xfa_document_serialize.cpp
index f9c22e8..c841287 100644 (file)
@@ -203,7 +203,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_Wi
 {\r
     CFX_WideString wsAttrs;\r
     int32_t iAttrs = 0;\r
-    FX_LPCBYTE pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs);\r
+    const uint8_t* pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs);\r
     while (iAttrs--) {\r
         XFA_LPCATTRIBUTEINFO pAttr = XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]);\r
         if (pAttr->eName == XFA_ATTRIBUTE_Name || (XFA_DataExporter_AttributeSaveInDataModel(pNode, pAttr->eName) && !bSaveXML)) {\r
@@ -241,7 +241,7 @@ static void XFA_DataExporter_RegenerateFormFile_Changed(CXFA_Node* pNode, CFX_Wi
                     IFX_Stream *pTempStream = IFX_Stream::CreateStream((IFX_FileWrite*)pMemStream, FX_STREAMACCESS_Text | FX_STREAMACCESS_Write | FX_STREAMACCESS_Append);\r
                     pTempStream->SetCodePage(FX_CODEPAGE_UTF8);\r
                     pRichTextXML->SaveXMLNode(pTempStream);\r
-                    wsChildren += CFX_WideString::FromUTF8((FX_LPCSTR)pMemStream->GetBuffer(), pMemStream->GetSize());\r
+                    wsChildren += CFX_WideString::FromUTF8((const FX_CHAR*)pMemStream->GetBuffer(), pMemStream->GetSize());\r
                     pTempStream->Release();\r
                     pMemStream->Release();\r
                 } else if (pRawValueNode->GetClassID() == XFA_ELEMENT_Sharpxml  && wsContentType.Equal(FX_WSTRC(L"text/xml"))) {\r
@@ -353,7 +353,7 @@ static void XFA_DataExporter_RegenerateFormFile_Container(CXFA_Node* pNode, IFX_
         XFA_DataExporter_RegenerateFormFile_Changed(pNode, buf, bSaveXML);\r
         FX_STRSIZE nLen = buf.GetLength();\r
         if (nLen > 0) {\r
-            pStream->WriteString((FX_LPCWSTR)buf.GetBuffer(), nLen);\r
+            pStream->WriteString((const FX_WCHAR*)buf.GetBuffer(), nLen);\r
         }\r
         return;\r
     }\r
@@ -365,7 +365,7 @@ static void XFA_DataExporter_RegenerateFormFile_Container(CXFA_Node* pNode, IFX_
     XFA_SaveAttribute(pNode, XFA_ATTRIBUTE_Name, FX_WSTRC(L"name"), TRUE, wsOutput);\r
     CFX_WideString wsAttrs;\r
     int32_t iAttrs = 0;\r
-    FX_LPCBYTE pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs);\r
+    const uint8_t* pAttrs = XFA_GetElementAttributes(pNode->GetClassID(), iAttrs);\r
     while (iAttrs--) {\r
         XFA_LPCATTRIBUTEINFO pAttr = XFA_GetAttributeByID((XFA_ATTRIBUTE)pAttrs[iAttrs]);\r
         if (pAttr->eName == XFA_ATTRIBUTE_Name) {\r
@@ -376,7 +376,7 @@ static void XFA_DataExporter_RegenerateFormFile_Container(CXFA_Node* pNode, IFX_
         wsOutput += wsAttr;\r
     }\r
     if (!wsOutput.IsEmpty()) {\r
-        pStream->WriteString((FX_LPCWSTR)wsOutput, wsOutput.GetLength());\r
+        pStream->WriteString((const FX_WCHAR*)wsOutput, wsOutput.GetLength());\r
     }\r
     CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);\r
     if (pChildNode) {\r
@@ -392,21 +392,21 @@ static void XFA_DataExporter_RegenerateFormFile_Container(CXFA_Node* pNode, IFX_
         pStream->WriteString(L"\n/>", 3);\r
     }\r
 }\r
-void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, IFX_Stream* pStream, FX_LPCSTR pChecksum , FX_BOOL bSaveXML)\r
+void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, IFX_Stream* pStream, const FX_CHAR* pChecksum , FX_BOOL bSaveXML)\r
 {\r
     if(pNode->GetObjectType() == XFA_OBJECTTYPE_ModelNode) {\r
-        static FX_LPCWSTR s_pwsTagName = L"<form";\r
-        static FX_LPCWSTR s_pwsClose = L"</form\n>";\r
+        static const FX_WCHAR* s_pwsTagName = L"<form";\r
+        static const FX_WCHAR* s_pwsClose = L"</form\n>";\r
         pStream->WriteString(s_pwsTagName, FXSYS_wcslen(s_pwsTagName));\r
         if (pChecksum != NULL) {\r
-            static FX_LPCWSTR s_pwChecksum = L" checksum=\"";\r
+            static const FX_WCHAR* s_pwChecksum = L" checksum=\"";\r
             CFX_WideString wsChecksum = CFX_WideString::FromUTF8(pChecksum, FXSYS_strlen(pChecksum));\r
             pStream->WriteString(s_pwChecksum, FXSYS_wcslen(s_pwChecksum));\r
-            pStream->WriteString((FX_LPCWSTR)wsChecksum, wsChecksum.GetLength());\r
+            pStream->WriteString((const FX_WCHAR*)wsChecksum, wsChecksum.GetLength());\r
             pStream->WriteString(L"\"", 1);\r
         }\r
         pStream->WriteString(L" xmlns=\"", FXSYS_wcslen(L" xmlns=\""));\r
-        FX_LPCWSTR pURI = XFA_GetPacketByIndex(XFA_PACKET_Form)->pURI;\r
+        const FX_WCHAR* pURI = XFA_GetPacketByIndex(XFA_PACKET_Form)->pURI;\r
         pStream->WriteString(pURI, FXSYS_wcslen(pURI));\r
         CFX_WideString wsVersionNumber;\r
         XFA_DataExporter_RecognizeXFAVersionNumber((CXFA_Node*)pNode->GetDocument()->GetXFANode(XFA_XDPPACKET_Template), wsVersionNumber);\r
@@ -414,7 +414,7 @@ void XFA_DataExporter_RegenerateFormFile(CXFA_Node* pNode, IFX_Stream* pStream,
             wsVersionNumber = FX_WSTRC(L"2.8");\r
         }\r
         wsVersionNumber += FX_WSTRC(L"/\"\n>");\r
-        pStream->WriteString((FX_LPCWSTR)wsVersionNumber, wsVersionNumber.GetLength());\r
+        pStream->WriteString((const FX_WCHAR*)wsVersionNumber, wsVersionNumber.GetLength());\r
         CXFA_Node* pChildNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild);\r
         while (pChildNode) {\r
             XFA_DataExporter_RegenerateFormFile_Container(pChildNode, pStream);\r
@@ -438,7 +438,7 @@ FX_BOOL CXFA_DataExporter::Export(IFX_FileWrite *pWrite)
 {\r
     return Export(pWrite, m_pDocument->GetRoot());\r
 }\r
-FX_BOOL CXFA_DataExporter::Export(IFX_FileWrite *pWrite, CXFA_Node *pNode, FX_DWORD dwFlag , FX_LPCSTR pChecksum )\r
+FX_BOOL CXFA_DataExporter::Export(IFX_FileWrite *pWrite, CXFA_Node *pNode, FX_DWORD dwFlag , const FX_CHAR* pChecksum )\r
 {\r
     ASSERT(pWrite != NULL);\r
     if (pWrite == NULL) {\r
@@ -453,18 +453,18 @@ FX_BOOL CXFA_DataExporter::Export(IFX_FileWrite *pWrite, CXFA_Node *pNode, FX_DW
     pStream->Release();\r
     return bRet;\r
 }\r
-FX_BOOL CXFA_DataExporter::Export(IFX_Stream *pStream, CXFA_Node *pNode, FX_DWORD dwFlag, FX_LPCSTR pChecksum)\r
+FX_BOOL CXFA_DataExporter::Export(IFX_Stream *pStream, CXFA_Node *pNode, FX_DWORD dwFlag, const FX_CHAR* pChecksum)\r
 {\r
     IFDE_XMLDoc* pXMLDoc = m_pDocument->GetParser()->GetXMLDoc();\r
     if(pNode->GetObjectType() == XFA_OBJECTTYPE_ModelNode) {\r
         switch (pNode->GetPacketID()) {\r
             case XFA_XDPPACKET_XDP: {\r
-                    static FX_LPCWSTR s_pwsPreamble = L"<xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">";\r
+                    static const FX_WCHAR* s_pwsPreamble = L"<xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">";\r
                     pStream->WriteString(s_pwsPreamble, FXSYS_wcslen(s_pwsPreamble));\r
                     for(CXFA_Node *pChild = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); pChild; pChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling)) {\r
                         Export(pStream, pChild, dwFlag, pChecksum);\r
                     }\r
-                    static FX_LPCWSTR s_pwsPostamble = L"</xdp:xdp\n>";\r
+                    static const FX_WCHAR* s_pwsPostamble = L"</xdp:xdp\n>";\r
                     pStream->WriteString(s_pwsPostamble, FXSYS_wcslen(s_pwsPostamble));\r
                 }\r
                 break;\r
@@ -509,7 +509,7 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream *pStream, CXFA_Node *pNode, FX_DWOR
         XFA_DataExporter_DealWithDataGroupNode(pExportNode);\r
         pElement->SetString(FX_WSTRC(L"xmlns:xfa"), FX_WSTRC(L"http://www.xfa.org/schema/xfa-data/1.0/"));\r
         pXMLDoc->SaveXMLNode(pStream, pElement);\r
-        pElement->RemoveAttribute(FX_LPCWSTR(L"xmlns:xfa"));\r
+        pElement->RemoveAttribute(L"xmlns:xfa");\r
     }\r
     return TRUE;\r
 }\r