summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-10 14:33:37 -0700
commitd7e5cc754a937605d1f73db5e7967c58ddd80742 (patch)
treeed28e012c4d6a46b7f29f15a0c060474c27d4286 /core/src/fpdfapi/fpdf_edit
parentbfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff)
downloadpdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r--core/src/fpdfapi/fpdf_edit/editint.h4
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp80
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp30
5 files changed, 66 insertions, 66 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/editint.h b/core/src/fpdfapi/fpdf_edit/editint.h
index 38c33439ec..3a9d1588e0 100644
--- a/core/src/fpdfapi/fpdf_edit/editint.h
+++ b/core/src/fpdfapi/fpdf_edit/editint.h
@@ -15,7 +15,7 @@ public:
FX_BOOL Start();
int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj);
- int32_t CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize);
+ int32_t CompressIndirectObject(FX_DWORD dwObjNum, const uint8_t* pBuffer, FX_DWORD dwSize);
FX_FILESIZE End(CPDF_Creator* pCreator);
@@ -38,7 +38,7 @@ public:
int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator);
- int32_t CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator);
+ int32_t CompressIndirectObject(FX_DWORD dwObjNum, const uint8_t* pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator);
FX_BOOL End(CPDF_Creator *pCreator, FX_BOOL bEOF = FALSE);
FX_BOOL AddObjectNumberToIndexArray(FX_DWORD objnum);
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
index 65b482bf30..717386041d 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_content.cpp
@@ -99,7 +99,7 @@ void CPDF_PageContentGenerate::ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObje
buf << "/" << PDF_NameEncode(name) << " Do Q\n";
}
}
-void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data, FX_DWORD size, CFX_Matrix& matrix)
+void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, const uint8_t* data, FX_DWORD size, CFX_Matrix& matrix)
{
if (!data || !size) {
return;
@@ -111,7 +111,7 @@ void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf, FX_LPCBYTE data
CFX_FloatRect bbox = m_pPage->GetPageBBox();
matrix.TransformRect(bbox);
pFormDict->SetAtRect(FX_BSTR("BBox"), bbox);
- pStream->InitStream((FX_LPBYTE)data, size, pFormDict);
+ pStream->InitStream((uint8_t*)data, size, pFormDict);
buf << "q " << matrix << " cm ";
CFX_ByteString name = RealizeResource(pStream, "XObject");
buf << "/" << PDF_NameEncode(name) << " Do Q\n";
@@ -142,7 +142,7 @@ void CPDF_PageContentGenerate::TransformContent(CFX_Matrix& matrix)
size += pContentArray[i]->GetSize() + 1;
}
int pos = 0;
- FX_LPBYTE pBuf = FX_Alloc(uint8_t, size);
+ uint8_t* pBuf = FX_Alloc(uint8_t, size);
for (i = 0; i < iCount; ++i) {
FXSYS_memcpy32(pBuf + pos, pContentArray[i]->GetData(), pContentArray[i]->GetSize());
pos += pContentArray[i]->GetSize() + 1;
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index 035baa398f..0091613120 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -8,9 +8,9 @@
#include "editint.h"
#define PDF_OBJECTSTREAM_MAXLENGTH (256 * 1024)
#define PDF_XREFSTREAM_MAXSIZE 10000
-extern void FlateEncode(const uint8_t* src_buf, FX_DWORD src_data, FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
-extern void FlateEncode(FX_LPCBYTE src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns,
- FX_LPBYTE& dest_buf, FX_DWORD& dest_size);
+extern void FlateEncode(const uint8_t* src_buf, FX_DWORD src_data, uint8_t*& dest_buf, FX_DWORD& dest_size);
+extern void FlateEncode(const uint8_t* src_buf, FX_DWORD src_size, int predictor, int Colors, int BitsPerComponent, int Columns,
+ uint8_t*& dest_buf, FX_DWORD& dest_size);
extern FX_BOOL IsSignatureDict(const CPDF_Dictionary* pDict);
int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, CFX_FileBufferArchive *pFile, FX_FILESIZE& offset)
{
@@ -283,12 +283,12 @@ int32_t PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict, FX_DWORD dw
offset += len + 6;
return offset;
}
-FX_BOOL PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_LPDWORD pBuffer)
+FX_BOOL PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2, FX_DWORD* pBuffer)
{
if (!pBuffer) {
return FALSE;
}
- FX_LPVOID pContext = FX_Random_MT_Start(dwSeed1);
+ void* pContext = FX_Random_MT_Start(dwSeed1);
int32_t i = 0;
for (i = 0; i < 2; i++) {
*pBuffer++ = FX_Random_MT_Generate(pContext);
@@ -307,9 +307,9 @@ public:
CPDF_FlateEncoder();
~CPDF_FlateEncoder();
FX_BOOL Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode);
- FX_BOOL Initialize(FX_LPCBYTE pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream = FALSE);
+ FX_BOOL Initialize(const uint8_t* pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream = FALSE);
void CloneDict();
- FX_LPBYTE m_pData;
+ uint8_t* m_pData;
FX_DWORD m_dwSize;
CPDF_Dictionary* m_pDict;
FX_BOOL m_bCloned;
@@ -339,13 +339,13 @@ FX_BOOL CPDF_FlateEncoder::Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode
CPDF_StreamAcc destAcc;
destAcc.LoadAllData(pStream);
m_dwSize = destAcc.GetSize();
- m_pData = (FX_LPBYTE)destAcc.DetachData();
+ m_pData = (uint8_t*)destAcc.DetachData();
m_pDict = (CPDF_Dictionary*)pStream->GetDict()->Clone();
m_pDict->RemoveAt(FX_BSTRC("Filter"));
m_bNewData = TRUE;
m_bCloned = TRUE;
} else {
- m_pData = (FX_LPBYTE)m_Acc.GetData();
+ m_pData = (uint8_t*)m_Acc.GetData();
m_dwSize = m_Acc.GetSize();
m_pDict = pStream->GetDict();
}
@@ -362,10 +362,10 @@ FX_BOOL CPDF_FlateEncoder::Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode
m_pDict->RemoveAt("DecodeParms");
return TRUE;
}
-FX_BOOL CPDF_FlateEncoder::Initialize(FX_LPCBYTE pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream)
+FX_BOOL CPDF_FlateEncoder::Initialize(const uint8_t* pBuffer, FX_DWORD size, FX_BOOL bFlateEncode, FX_BOOL bXRefStream)
{
if (!bFlateEncode) {
- m_pData = (FX_LPBYTE)pBuffer;
+ m_pData = (uint8_t*)pBuffer;
m_dwSize = size;
return TRUE;
}
@@ -391,8 +391,8 @@ class CPDF_Encryptor
public:
CPDF_Encryptor();
~CPDF_Encryptor();
- FX_BOOL Initialize(CPDF_CryptoHandler* pHandler, int objnum, FX_LPBYTE src_data, FX_DWORD src_size);
- FX_LPBYTE m_pData;
+ FX_BOOL Initialize(CPDF_CryptoHandler* pHandler, int objnum, uint8_t* src_data, FX_DWORD src_size);
+ uint8_t* m_pData;
FX_DWORD m_dwSize;
FX_BOOL m_bNewBuf;
};
@@ -402,13 +402,13 @@ CPDF_Encryptor::CPDF_Encryptor()
m_dwSize = 0;
m_bNewBuf = FALSE;
}
-FX_BOOL CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, int objnum, FX_LPBYTE src_data, FX_DWORD src_size)
+FX_BOOL CPDF_Encryptor::Initialize(CPDF_CryptoHandler* pHandler, int objnum, uint8_t* src_data, FX_DWORD src_size)
{
if (src_size == 0) {
return TRUE;
}
if (pHandler == NULL) {
- m_pData = (FX_LPBYTE)src_data;
+ m_pData = (uint8_t*)src_data;
m_dwSize = src_size;
m_bNewBuf = FALSE;
return TRUE;
@@ -446,7 +446,7 @@ int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_
m_Buffer << pObj;
return 1;
}
-int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize)
+int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum, const uint8_t* pBuffer, FX_DWORD dwSize)
{
m_ObjNumArray.Add(dwObjNum);
m_OffsetArray.Add(m_Buffer.GetLength());
@@ -564,7 +564,7 @@ int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Ob
}
return EndObjectStream(pCreator);
}
-int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator)
+int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum, const uint8_t* pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator)
{
if (!pCreator) {
return 0;
@@ -958,7 +958,7 @@ int32_t CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj)
}
return 0;
}
-int32_t CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum, FX_LPCBYTE pBuffer, FX_DWORD dwSize)
+int32_t CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum, const uint8_t* pBuffer, FX_DWORD dwSize)
{
if (!m_pXRefStream) {
return 1;
@@ -1104,8 +1104,8 @@ int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj, F
break;
}
CPDF_Encryptor encryptor;
- encryptor.Initialize(m_pCryptoHandler, objnum, (FX_LPBYTE)str.c_str(), str.GetLength());
- CFX_ByteString content = PDF_EncodeString(CFX_ByteString((FX_LPCSTR)encryptor.m_pData, encryptor.m_dwSize), bHex);
+ encryptor.Initialize(m_pCryptoHandler, objnum, (uint8_t*)str.c_str(), str.GetLength());
+ CFX_ByteString content = PDF_EncodeString(CFX_ByteString((const FX_CHAR*)encryptor.m_pData, encryptor.m_dwSize), bHex);
if ((len = m_File.AppendString(content)) < 0) {
return -1;
}
@@ -1252,8 +1252,8 @@ int32_t CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum)
return 0;
}
m_ObjectOffset[objnum] = m_Offset;
- FX_LPVOID valuetemp = NULL;
- FX_BOOL bExistInMap = m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, valuetemp);
+ void* valuetemp = NULL;
+ FX_BOOL bExistInMap = m_pDocument->m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, valuetemp);
FX_BOOL bObjStm = (m_pParser->m_V5Type[objnum] == 2) && m_pEncryptDict && !m_pXRefStream;
if(m_pParser->m_bVersionUpdated || m_bSecurityChanged || bExistInMap || bObjStm) {
CPDF_Object* pObj = m_pDocument->GetIndirectObject(objnum);
@@ -1326,7 +1326,7 @@ int32_t CPDF_Creator::WriteOldObjs(IFX_Pause *pPause)
}
m_ObjectSize[objnum] = (FX_DWORD)(m_Offset - m_ObjectOffset[objnum]);
if (pPause && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(uintptr_t)(objnum + 1);
+ m_Pos = (void*)(uintptr_t)(objnum + 1);
return 1;
}
}
@@ -1339,7 +1339,7 @@ int32_t CPDF_Creator::WriteNewObjs(FX_BOOL bIncremental, IFX_Pause *pPause)
while (index < iCount) {
FX_DWORD objnum = m_NewObjNumArray.ElementAt(index);
CPDF_Object *pObj = NULL;
- m_pDocument->m_IndirectObjs.Lookup((FX_LPVOID)(uintptr_t)objnum, (FX_LPVOID&)pObj);
+ m_pDocument->m_IndirectObjs.Lookup((void*)(uintptr_t)objnum, (void*&)pObj);
if (NULL == pObj) {
++index;
continue;
@@ -1390,7 +1390,7 @@ void CPDF_Creator::InitNewObjNumOffsets()
while (pos) {
size_t key = 0;
CPDF_Object* pObj;
- m_pDocument->m_IndirectObjs.GetNextAssoc(pos, (FX_LPVOID&)key, (FX_LPVOID&)pObj);
+ m_pDocument->m_IndirectObjs.GetNextAssoc(pos, (void*&)key, (void*&)pObj);
FX_DWORD objnum = (FX_DWORD)key;
if (pObj->GetObjNum() == -1) {
continue;
@@ -1517,7 +1517,7 @@ int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause)
} else {
IFX_FileRead* pSrcFile = m_pParser->GetFileAccess();
m_Offset = pSrcFile->GetSize();
- m_Pos = (FX_LPVOID)(uintptr_t)m_Offset;
+ m_Pos = (void*)(uintptr_t)m_Offset;
m_iStage = 15;
}
}
@@ -1536,7 +1536,7 @@ int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause *pPause)
}
src_size -= block_size;
if (pPause && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(uintptr_t)src_size;
+ m_Pos = (void*)(uintptr_t)src_size;
return 1;
}
}
@@ -1569,7 +1569,7 @@ int32_t CPDF_Creator::WriteDoc_Stage2(IFX_Pause *pPause)
FXSYS_assert(m_iStage >= 20 || m_iStage < 30);
if (m_iStage == 20) {
if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 && m_pParser) {
- m_Pos = (FX_LPVOID)(uintptr_t)0;
+ m_Pos = (void*)(uintptr_t)0;
m_iStage = 21;
} else {
m_iStage = 25;
@@ -1583,7 +1583,7 @@ int32_t CPDF_Creator::WriteDoc_Stage2(IFX_Pause *pPause)
m_iStage = 25;
}
if (m_iStage == 25) {
- m_Pos = (FX_LPVOID)(uintptr_t)0;
+ m_Pos = (void*)(uintptr_t)0;
m_iStage = 26;
}
if (m_iStage == 26) {
@@ -1630,13 +1630,13 @@ int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
if (m_File.AppendString(str) < 0) {
return -1;
}
- m_Pos = (FX_LPVOID)(uintptr_t)1;
+ m_Pos = (void*)(uintptr_t)1;
m_iStage = 81;
} else {
if (m_File.AppendString(FX_BSTRC("xref\r\n")) < 0) {
return -1;
}
- m_Pos = (FX_LPVOID)(uintptr_t)0;
+ m_Pos = (void*)(uintptr_t)0;
m_iStage = 82;
}
} else {
@@ -1675,7 +1675,7 @@ int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
break;
}
if (pPause && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(uintptr_t)i;
+ m_Pos = (void*)(uintptr_t)i;
return 1;
}
}
@@ -1715,7 +1715,7 @@ int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
}
}
if (pPause && (i % 100) == 0 && pPause->NeedToPauseNow()) {
- m_Pos = (FX_LPVOID)(uintptr_t)i;
+ m_Pos = (void*)(uintptr_t)i;
return 1;
}
}
@@ -1976,7 +1976,7 @@ void CPDF_Creator::Clear()
m_pIDArray = NULL;
}
}
-FX_BOOL CPDF_Creator::Create(FX_LPCSTR filename, FX_DWORD flags)
+FX_BOOL CPDF_Creator::Create(const FX_CHAR* filename, FX_DWORD flags)
{
if (!m_File.AttachFile(filename)) {
return FALSE;
@@ -1987,7 +1987,7 @@ FX_BOOL CPDF_Creator::Create(FX_LPCSTR filename, FX_DWORD flags)
}
return bRet;
}
-FX_BOOL CPDF_Creator::Create(FX_LPCWSTR filename, FX_DWORD flags)
+FX_BOOL CPDF_Creator::Create(const FX_WCHAR* filename, FX_DWORD flags)
{
if (!m_File.AttachFile(filename)) {
return FALSE;
@@ -2028,7 +2028,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault )
CPDF_Array* pOldIDArray = m_pParser ? m_pParser->GetIDArray() : NULL;
FX_BOOL bNewId = !m_pIDArray;
if (!m_pIDArray) {
- FX_LPDWORD pBuffer = NULL;
+ FX_DWORD* pBuffer = NULL;
m_pIDArray = CPDF_Array::Create();
CPDF_Object* pID1 = pOldIDArray ? pOldIDArray->GetElement(0) : NULL;
if (pID1) {
@@ -2036,7 +2036,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault )
} else {
pBuffer = FX_Alloc(FX_DWORD, 4);
PDF_GenerateFileID((FX_DWORD)(uintptr_t)this, m_dwLastObjNum, pBuffer);
- CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD));
+ CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD));
m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
}
if (pBuffer) {
@@ -2052,9 +2052,9 @@ void CPDF_Creator::InitID(FX_BOOL bDefault )
m_pIDArray->Add(pID2->Clone());
return;
}
- FX_LPDWORD pBuffer = FX_Alloc(FX_DWORD, 4);
+ FX_DWORD* pBuffer = FX_Alloc(FX_DWORD, 4);
PDF_GenerateFileID((FX_DWORD)(uintptr_t)this, m_dwLastObjNum, pBuffer);
- CFX_ByteStringC bsBuffer((FX_LPCBYTE)pBuffer, 4 * sizeof(FX_DWORD));
+ CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD));
m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument);
FX_Free(pBuffer);
return;
@@ -2065,7 +2065,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault )
CPDF_StandardSecurityHandler handler;
CFX_ByteString user_pass = m_pParser->GetPassword();
FX_DWORD flag = PDF_ENCRYPT_CONTENT;
- handler.OnCreate(m_pEncryptDict, m_pIDArray, (FX_LPCBYTE)user_pass, user_pass.GetLength(), flag);
+ handler.OnCreate(m_pEncryptDict, m_pIDArray, (const uint8_t*)user_pass, user_pass.GetLength(), flag);
if (m_pCryptoHandler && m_bNewCrypto) {
delete m_pCryptoHandler;
}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index d2d81d5566..7176a62435 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -226,7 +226,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_B
FXSYS_strcpy(lfa.lfFaceName, face.c_str());
return AddWindowsFont(&lfa, bVert, bTranslateName);
}
-extern CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name);
+extern CFX_ByteString _FPDF_GetNameFromTT(const uint8_t* name_table, FX_DWORD name);
CFX_ByteString _FPDF_GetPSNameFromTT(HDC hDC)
{
CFX_ByteString result;
@@ -429,11 +429,11 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, FX_BOOL bVert, FX_B
}
#endif
#if (_FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_)
-uint32_t FX_GetLangHashCode( FX_LPCSTR pStr)
+uint32_t FX_GetLangHashCode( const FX_CHAR* pStr)
{
FXSYS_assert( pStr != NULL);
int32_t iLength = FXSYS_strlen(pStr);
- FX_LPCSTR pStrEnd = pStr + iLength;
+ const FX_CHAR* pStrEnd = pStr + iLength;
uint32_t uHashCode = 0;
while ( pStr < pStrEnd) {
uHashCode = 31 * uHashCode + tolower(*pStr++);
@@ -529,7 +529,7 @@ static FX_WORD FX_GetCsFromLangCode(uint32_t uCode)
};
return 0;
}
-static FX_WORD FX_GetCharsetFromLang(FX_LPCSTR pLang, int32_t iLength)
+static FX_WORD FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength)
{
FXSYS_assert(pLang);
if (iLength < 0) {
@@ -545,7 +545,7 @@ static void _CFString2CFXByteString(CFStringRef src, CFX_ByteString &dest)
CFIndex used = 0;
UInt8* pBuffer = (UInt8*)calloc(len+1, sizeof(UInt8));
CFStringGetBytes(src, range, kCFStringEncodingASCII, 0, false, pBuffer, len, &used);
- dest = (FX_LPSTR)pBuffer;
+ dest = (FX_CHAR*)pBuffer;
free(pBuffer);
}
FX_BOOL IsHasCharSet(CFArrayRef languages, const CFX_DWordArray &charSets)
@@ -1141,7 +1141,7 @@ CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage)
return pDict;
}
int _PDF_GetStandardFontName(CFX_ByteString& name);
-CPDF_Font* CPDF_Document::AddStandardFont(FX_LPCSTR font, CPDF_FontEncoding* pEncoding)
+CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, CPDF_FontEncoding* pEncoding)
{
CFX_ByteString name(font, -1);
if (_PDF_GetStandardFontName(name) < 0) {
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index 8d105a5bd8..fd715240a4 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
@@ -10,7 +10,7 @@
#include "../../../include/fpdfapi/fpdf_render.h"
#include "../fpdf_page/pageint.h"
#include "../fpdf_render/render_int.h"
-CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
+CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size)
{
int32_t width, height, color_trans, num_comps, bits;
if (!CPDF_ModuleMgr::Get()->GetJpegModule()->
@@ -22,7 +22,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
pDict->SetAtName("Subtype", "Image");
pDict->SetAtInteger("Width", width);
pDict->SetAtInteger("Height", height);
- FX_LPCSTR csname = NULL;
+ const FX_CHAR* csname = NULL;
if (num_comps == 1) {
csname = "DeviceGray";
} else if (num_comps == 3) {
@@ -52,7 +52,7 @@ CPDF_Dictionary* CPDF_Image::InitJPEG(FX_LPBYTE pData, FX_DWORD size)
}
return pDict;
}
-void CPDF_Image::SetJpegImage(FX_LPBYTE pData, FX_DWORD size)
+void CPDF_Image::SetJpegImage(uint8_t* pData, FX_DWORD size)
{
CPDF_Dictionary *pDict = InitJPEG(pData, size);
if (!pDict) {
@@ -70,7 +70,7 @@ void CPDF_Image::SetJpegImage(IFX_FileRead *pFile)
if (dwEstimateSize > 8192) {
dwEstimateSize = 8192;
}
- FX_LPBYTE pData = FX_Alloc(uint8_t, dwEstimateSize);
+ uint8_t* pData = FX_Alloc(uint8_t, dwEstimateSize);
pFile->ReadBlock(pData, 0, dwEstimateSize);
CPDF_Dictionary *pDict = InitJPEG(pData, dwEstimateSize);
FX_Free(pData);
@@ -85,10 +85,10 @@ void CPDF_Image::SetJpegImage(IFX_FileRead *pFile)
}
m_pStream->InitStream(pFile, pDict);
}
-void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap, int quality, FX_LPBYTE &buf, FX_STRSIZE &size)
+void _DCTEncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap* pBitmap, int quality, uint8_t* &buf, FX_STRSIZE &size)
{
}
-void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, FX_LPBYTE &buf, FX_STRSIZE &size, FX_BOOL bLossLess)
+void _JBIG2EncodeBitmap(CPDF_Dictionary *pBitmapDict, const CFX_DIBitmap *pBitmap, CPDF_Document *pDoc, uint8_t* &buf, FX_STRSIZE &size, FX_BOOL bLossLess)
{
}
void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_FileWrite *pFileWrite, IFX_FileRead *pFileRead, const CFX_DIBitmap* pMask, const CPDF_ImageSetParam* pParam)
@@ -98,7 +98,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
if (BitmapWidth < 1 || BitmapHeight < 1) {
return;
}
- FX_LPBYTE src_buf = pBitmap->GetBuffer();
+ uint8_t* src_buf = pBitmap->GetBuffer();
int32_t src_pitch = pBitmap->GetPitch();
int32_t bpp = pBitmap->GetBPP();
FX_BOOL bUseMatte = pParam && pParam->pMatteColor && (pBitmap->GetFormat() == FXDIB_Argb);
@@ -107,7 +107,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
pDict->SetAtName(FX_BSTRC("Subtype"), FX_BSTRC("Image"));
pDict->SetAtInteger(FX_BSTRC("Width"), BitmapWidth);
pDict->SetAtInteger(FX_BSTRC("Height"), BitmapHeight);
- FX_LPBYTE dest_buf = NULL;
+ uint8_t* dest_buf = NULL;
FX_STRSIZE dest_pitch = 0, dest_size = 0, opType = -1;
if (bpp == 1) {
int32_t reset_a = 0, reset_r = 0, reset_g = 0, reset_b = 0;
@@ -130,7 +130,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
pCS->AddName(FX_BSTRC("DeviceRGB"));
pCS->AddInteger(1);
CFX_ByteString ct;
- FX_LPSTR pBuf = ct.GetBuffer(6);
+ FX_CHAR* pBuf = ct.GetBuffer(6);
pBuf[0] = (FX_CHAR)reset_r;
pBuf[1] = (FX_CHAR)reset_g;
pBuf[2] = (FX_CHAR)reset_b;
@@ -156,8 +156,8 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
pCS->AddName(FX_BSTRC("Indexed"));
pCS->AddName(FX_BSTRC("DeviceRGB"));
pCS->AddInteger(iPalette - 1);
- FX_LPBYTE pColorTable = FX_Alloc2D(uint8_t, iPalette, 3);
- FX_LPBYTE ptr = pColorTable;
+ uint8_t* pColorTable = FX_Alloc2D(uint8_t, iPalette, 3);
+ uint8_t* ptr = pColorTable;
for (int32_t i = 0; i < iPalette; i ++) {
FX_DWORD argb = pBitmap->GetPaletteArgb(i);
ptr[0] = (uint8_t)(argb >> 16);
@@ -204,7 +204,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
if (pMaskBitmap) {
int32_t maskWidth = pMaskBitmap->GetWidth();
int32_t maskHeight = pMaskBitmap->GetHeight();
- FX_LPBYTE mask_buf = NULL;
+ uint8_t* mask_buf = NULL;
FX_STRSIZE mask_size;
CPDF_Dictionary* pMaskDict = new CPDF_Dictionary;
pMaskDict->SetAtName(FX_BSTRC("Type"), FX_BSTRC("XObject"));
@@ -270,7 +270,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
if (bUseMatte) {
CFX_DIBitmap *pNewBitmap = new CFX_DIBitmap();
pNewBitmap->Create(BitmapWidth, BitmapHeight, FXDIB_Argb);
- FX_LPBYTE dst_buf = pNewBitmap->GetBuffer();
+ uint8_t* dst_buf = pNewBitmap->GetBuffer();
int32_t src_offset = 0;
for (int32_t row = 0; row < BitmapHeight; row ++) {
src_offset = row * src_pitch;
@@ -300,7 +300,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
dest_buf = FX_Alloc2D(uint8_t, dest_pitch, BitmapHeight);
dest_size = dest_pitch * BitmapHeight; // Safe since checked alloc returned.
}
- FX_LPBYTE pDest = dest_buf;
+ uint8_t* pDest = dest_buf;
for (int32_t i = 0; i < BitmapHeight; i ++) {
if (!bStream) {
FXSYS_memcpy32(pDest, src_buf, dest_pitch);
@@ -317,7 +317,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, int32_t iCompress, IFX_Fi
} else {
dest_buf = FX_Alloc(uint8_t, dest_pitch);
}
- FX_LPBYTE pDest = dest_buf;
+ uint8_t* pDest = dest_buf;
int32_t src_offset = 0;
int32_t dest_offset = 0;
for (int32_t row = 0; row < BitmapHeight; row ++) {