summaryrefslogtreecommitdiff
path: root/core/src/fpdfdoc
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/fpdfdoc
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/fpdfdoc')
-rw-r--r--core/src/fpdfdoc/doc_annot.cpp2
-rw-r--r--core/src/fpdfdoc/doc_basic.cpp4
-rw-r--r--core/src/fpdfdoc/doc_form.cpp46
-rw-r--r--core/src/fpdfdoc/doc_link.cpp12
-rw-r--r--core/src/fpdfdoc/doc_metadata.cpp6
-rw-r--r--core/src/fpdfdoc/doc_ocg.cpp4
-rw-r--r--core/src/fpdfdoc/doc_tagged.cpp2
-rw-r--r--core/src/fpdfdoc/doc_vt.cpp4
-rw-r--r--core/src/fpdfdoc/pdf_vt.h4
9 files changed, 42 insertions, 42 deletions
diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp
index ef6c34701b..a72285c478 100644
--- a/core/src/fpdfdoc/doc_annot.cpp
+++ b/core/src/fpdfdoc/doc_annot.cpp
@@ -129,7 +129,7 @@ void CPDF_AnnotList::DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDe
int CPDF_AnnotList::GetIndex(CPDF_Annot* pAnnot)
{
for (int i = 0; i < m_AnnotList.GetSize(); ++i)
- if (m_AnnotList[i] == (FX_LPVOID)pAnnot) {
+ if (m_AnnotList[i] == (void*)pAnnot) {
return i;
}
return -1;
diff --git a/core/src/fpdfdoc/doc_basic.cpp b/core/src/fpdfdoc/doc_basic.cpp
index dfa2e6718a..f9e692cb69 100644
--- a/core/src/fpdfdoc/doc_basic.cpp
+++ b/core/src/fpdfdoc/doc_basic.cpp
@@ -251,7 +251,7 @@ CPDF_Array* CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc, FX_BSTR sName)
return NULL;
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ || _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-static CFX_WideString ChangeSlashToPlatform(FX_LPCWSTR str)
+static CFX_WideString ChangeSlashToPlatform(const FX_WCHAR* str)
{
CFX_WideString result;
while (*str) {
@@ -268,7 +268,7 @@ static CFX_WideString ChangeSlashToPlatform(FX_LPCWSTR str)
}
return result;
}
-static CFX_WideString ChangeSlashToPDF(FX_LPCWSTR str)
+static CFX_WideString ChangeSlashToPDF(const FX_WCHAR* str)
{
CFX_WideString result;
while (*str) {
diff --git a/core/src/fpdfdoc/doc_form.cpp b/core/src/fpdfdoc/doc_form.cpp
index 0fbbd1d38f..8dab922d74 100644
--- a/core/src/fpdfdoc/doc_form.cpp
+++ b/core/src/fpdfdoc/doc_form.cpp
@@ -19,7 +19,7 @@ public:
m_pEnd = m_pStart + full_name.GetLength();
m_pCur = m_pStart;
}
- void GetNext(FX_LPCWSTR &pSubName, FX_STRSIZE& size)
+ void GetNext(const FX_WCHAR* &pSubName, FX_STRSIZE& size)
{
pSubName = m_pCur;
while (m_pCur < m_pEnd && m_pCur[0] != L'.') {
@@ -31,9 +31,9 @@ public:
}
}
protected:
- FX_LPCWSTR m_pStart;
- FX_LPCWSTR m_pEnd;
- FX_LPCWSTR m_pCur;
+ const FX_WCHAR* m_pStart;
+ const FX_WCHAR* m_pEnd;
+ const FX_WCHAR* m_pCur;
};
class CFieldTree
{
@@ -162,7 +162,7 @@ void CFieldTree::SetField(const CFX_WideString &full_name, CPDF_FormField *field
return;
}
_CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
+ const FX_WCHAR* pName;
FX_STRSIZE nLength;
name_extractor.GetNext(pName, nLength);
_Node *pNode = &m_Root, *pLast = NULL;
@@ -185,7 +185,7 @@ CPDF_FormField *CFieldTree::GetField(const CFX_WideString &full_name)
return NULL;
}
_CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
+ const FX_WCHAR* pName;
FX_STRSIZE nLength;
name_extractor.GetNext(pName, nLength);
_Node *pNode = &m_Root, *pLast = NULL;
@@ -203,7 +203,7 @@ CPDF_FormField *CFieldTree::RemoveField(const CFX_WideString & full_name)
return NULL;
}
_CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
+ const FX_WCHAR* pName;
FX_STRSIZE nLength;
name_extractor.GetNext(pName, nLength);
_Node *pNode = &m_Root, *pLast = NULL;
@@ -233,7 +233,7 @@ CFieldTree::_Node *CFieldTree::FindNode(const CFX_WideString& full_name)
return NULL;
}
_CFieldNameExtractor name_extractor(full_name);
- FX_LPCWSTR pName;
+ const FX_WCHAR* pName;
FX_STRSIZE nLength;
name_extractor.GetNext(pName, nLength);
_Node *pNode = &m_Root, *pLast = NULL;
@@ -270,7 +270,8 @@ CPDF_InterForm::~CPDF_InterForm()
{
FX_POSITION pos = m_ControlMap.GetStartPosition();
while (pos) {
- FX_LPVOID key, value;
+ void* key;
+ void* value;
m_ControlMap.GetNextAssoc(pos, key, value);
delete (CPDF_FormControl*)value;
}
@@ -292,7 +293,7 @@ void CPDF_InterForm::EnableUpdateAP(FX_BOOL bUpdateAP)
{
m_bUpdateAP = bUpdateAP;
}
-CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pResDict, FX_LPCSTR csType, int iMinLen, FX_LPCSTR csPrefix)
+CFX_ByteString CPDF_InterForm::GenerateNewResourceName(const CPDF_Dictionary* pResDict, const FX_CHAR* csType, int iMinLen, const FX_CHAR* csPrefix)
{
CFX_ByteString csStr = csPrefix;
CFX_ByteString csBType = csType;
@@ -476,7 +477,7 @@ CPDF_Font* CPDF_InterForm::AddStandardFont(const CPDF_Document* pDocument, CFX_B
}
return pFont;
}
-CFX_ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, FX_LPVOID pLogFont)
+CFX_ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, void* pLogFont)
{
CFX_ByteString csFontName;
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
@@ -513,7 +514,7 @@ CFX_ByteString CPDF_InterForm::GetNativeFont(uint8_t charSet, FX_LPVOID pLogFont
#endif
return csFontName;
}
-CFX_ByteString CPDF_InterForm::GetNativeFont(FX_LPVOID pLogFont)
+CFX_ByteString CPDF_InterForm::GetNativeFont(void* pLogFont)
{
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
uint8_t charSet = GetNativeCharSet();
@@ -698,7 +699,8 @@ FX_BOOL CPDF_InterForm::ValidateFieldName(const CPDF_FormControl* pControl, CFX_
}
int CPDF_InterForm::CompareFieldName(const CFX_ByteString& name1, const CFX_ByteString& name2)
{
- FX_LPCSTR ptr1 = name1, ptr2 = name2;
+ const FX_CHAR* ptr1 = name1;
+ const FX_CHAR* ptr2 = name2;
if (name1.GetLength() != name2.GetLength()) {
int i = 0;
while (ptr1[i] == ptr2[i]) {
@@ -717,8 +719,8 @@ int CPDF_InterForm::CompareFieldName(const CFX_ByteString& name1, const CFX_Byte
}
int CPDF_InterForm::CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2)
{
- FX_LPCWSTR ptr1 = name1.c_str();
- FX_LPCWSTR ptr2 = name2.c_str();
+ const FX_WCHAR* ptr1 = name1.c_str();
+ const FX_WCHAR* ptr2 = name2.c_str();
if (name1.GetLength() != name2.GetLength()) {
int i = 0;
while (ptr1[i] == ptr2[i]) {
@@ -822,7 +824,7 @@ FX_BOOL CPDF_InterForm::IsValidFormControl(const void* pControl)
while (pos) {
CPDF_Dictionary* pWidgetDict = NULL;
void* pFormControl = NULL;
- m_ControlMap.GetNextAssoc(pos, (FX_LPVOID&)pWidgetDict, pFormControl);
+ m_ControlMap.GetNextAssoc(pos, (void*&)pWidgetDict, pFormControl);
if (pControl == pFormControl) {
return TRUE;
}
@@ -842,7 +844,7 @@ int CPDF_InterForm::CountPageControls(CPDF_Page* pPage) const
continue;
}
CPDF_FormControl* pControl;
- if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
+ if (!m_ControlMap.Lookup(pAnnot, (void*&)pControl)) {
continue;
}
count ++;
@@ -862,7 +864,7 @@ CPDF_FormControl* CPDF_InterForm::GetPageControl(CPDF_Page* pPage, int index) co
continue;
}
CPDF_FormControl* pControl;
- if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
+ if (!m_ControlMap.Lookup(pAnnot, (void*&)pControl)) {
continue;
}
if (index == count) {
@@ -884,7 +886,7 @@ CPDF_FormControl* CPDF_InterForm::GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT p
continue;
}
CPDF_FormControl* pControl;
- if (!m_ControlMap.Lookup(pAnnot, (FX_LPVOID&)pControl)) {
+ if (!m_ControlMap.Lookup(pAnnot, (void*&)pControl)) {
continue;
}
CFX_FloatRect rect = pControl->GetRect();
@@ -897,7 +899,7 @@ CPDF_FormControl* CPDF_InterForm::GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT p
CPDF_FormControl* CPDF_InterForm::GetControlByDict(CPDF_Dictionary* pWidgetDict) const
{
CPDF_FormControl* pControl = NULL;
- m_ControlMap.Lookup(pWidgetDict, (FX_LPVOID&)pControl);
+ m_ControlMap.Lookup(pWidgetDict, (void*&)pControl);
return pControl;
}
FX_DWORD CPDF_InterForm::CountInternalFields(const CFX_WideString& csFieldName) const
@@ -1205,7 +1207,7 @@ void CPDF_InterForm::ReloadForm()
while (pos) {
CPDF_Dictionary* pWidgetDict;
CPDF_FormControl* pControl;
- m_ControlMap.GetNextAssoc(pos, (FX_LPVOID&)pWidgetDict, (FX_LPVOID&)pControl);
+ m_ControlMap.GetNextAssoc(pos, (void*&)pWidgetDict, (void*&)pControl);
delete pControl;
}
m_ControlMap.RemoveAll();
@@ -1471,7 +1473,7 @@ CFDF_Document* CPDF_InterForm::ExportToFDF(FX_WSTR pdf_path, CFX_PtrArray& field
return pDoc;
}
const struct _SupportFieldEncoding {
- FX_LPCSTR m_name;
+ const FX_CHAR* m_name;
int32_t m_codePage;
} g_fieldEncoding[] = {
{ "BigFive", 950 },
diff --git a/core/src/fpdfdoc/doc_link.cpp b/core/src/fpdfdoc/doc_link.cpp
index 71be0c36ab..e614af3ec8 100644
--- a/core/src/fpdfdoc/doc_link.cpp
+++ b/core/src/fpdfdoc/doc_link.cpp
@@ -11,7 +11,8 @@ CPDF_LinkList::~CPDF_LinkList()
{
FX_POSITION pos = m_PageMap.GetStartPosition();
while (pos) {
- FX_LPVOID key, value;
+ void* key;
+ void* value;
m_PageMap.GetNextAssoc(pos, key, value);
delete (CFX_PtrArray*)value;
}
@@ -23,12 +24,9 @@ CFX_PtrArray* CPDF_LinkList::GetPageLinks(CPDF_Page* pPage)
return NULL;
}
CFX_PtrArray* pPageLinkList = NULL;
- if (!m_PageMap.Lookup((FX_LPVOID)(uintptr_t)objnum, (FX_LPVOID&)pPageLinkList)) {
- pPageLinkList = FX_NEW CFX_PtrArray;
- if (pPageLinkList == NULL) {
- return NULL;
- }
- m_PageMap.SetAt((FX_LPVOID)(uintptr_t)objnum, pPageLinkList);
+ if (!m_PageMap.Lookup((void*)(uintptr_t)objnum, (void*&)pPageLinkList)) {
+ pPageLinkList = new CFX_PtrArray;
+ m_PageMap.SetAt((void*)(uintptr_t)objnum, pPageLinkList);
LoadPageLinks(pPage, pPageLinkList);
}
return pPageLinkList;
diff --git a/core/src/fpdfdoc/doc_metadata.cpp b/core/src/fpdfdoc/doc_metadata.cpp
index 677d0e91af..07cba96e61 100644
--- a/core/src/fpdfdoc/doc_metadata.cpp
+++ b/core/src/fpdfdoc/doc_metadata.cpp
@@ -13,7 +13,7 @@ typedef struct _PDFDOC_METADATA {
CFX_CMapByteStringToPtr *m_pStringMap;
} PDFDOC_METADATA, * PDFDOC_LPMETADATA;
typedef PDFDOC_METADATA const * PDFDOC_LPCMETADATA;
-const FX_LPCSTR gs_FPDFDOC_Metadata_Titles[] = {
+const FX_CHAR* const gs_FPDFDOC_Metadata_Titles[] = {
"Title", "title",
"Subject", "description",
"Author", "creator",
@@ -61,7 +61,7 @@ void CPDF_Metadata::LoadDoc(CPDF_Document *pDoc)
CPDF_StreamAcc acc;
acc.LoadAllData(pStream, FALSE);
int size = acc.GetSize();
- FX_LPCBYTE pBuf = acc.GetData();
+ const uint8_t* pBuf = acc.GetData();
CXML_Element *&pXmlElmnt = ((PDFDOC_LPMETADATA)m_pData)->m_pXmlElmnt;
pXmlElmnt = CXML_Element::Parse(pBuf, size);
if (!pXmlElmnt) {
@@ -86,7 +86,7 @@ int32_t CPDF_Metadata::GetString(FX_BSTR bsItem, CFX_WideString &wsStr)
if (!((PDFDOC_LPMETADATA)m_pData)->m_pStringMap->Lookup(bsItem, szTag)) {
return -1;
}
- CFX_ByteString bsTag = (FX_LPCSTR)szTag;
+ CFX_ByteString bsTag = (const FX_CHAR*)szTag;
wsStr = L"";
CXML_Element *pElmntRdf = ((PDFDOC_LPMETADATA)m_pData)->m_pElmntRdf;
if (!pElmntRdf) {
diff --git a/core/src/fpdfdoc/doc_ocg.cpp b/core/src/fpdfdoc/doc_ocg.cpp
index c2f77a58fa..318e9318ce 100644
--- a/core/src/fpdfdoc/doc_ocg.cpp
+++ b/core/src/fpdfdoc/doc_ocg.cpp
@@ -179,11 +179,11 @@ FX_BOOL CPDF_OCContext::GetOCGVisible(const CPDF_Dictionary *pOCGDict)
if (!pOCGDict) {
return FALSE;
}
- FX_LPVOID bState = NULL;
+ void* bState = NULL;
if (m_OCGStates.Lookup(pOCGDict, bState)) {
return (uintptr_t)bState != 0;
}
- bState = (FX_LPVOID)(uintptr_t)LoadOCGState(pOCGDict);
+ bState = (void*)(uintptr_t)LoadOCGState(pOCGDict);
m_OCGStates.SetAt(pOCGDict, bState);
return (uintptr_t)bState != 0;
}
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index c5fe39b6ee..0bf229e7d8 100644
--- a/core/src/fpdfdoc/doc_tagged.cpp
+++ b/core/src/fpdfdoc/doc_tagged.cpp
@@ -137,7 +137,7 @@ CPDF_StructElementImpl* CPDF_StructTreeImpl::AddPageNode(CPDF_Dictionary* pDict,
return NULL;
}
CPDF_StructElementImpl* pElement = NULL;
- if (map.Lookup(pDict, (FX_LPVOID&)pElement)) {
+ if (map.Lookup(pDict, (void*&)pElement)) {
return pElement;
}
pElement = FX_NEW CPDF_StructElementImpl(this, NULL, pDict);
diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp
index 7ed5b4ad3c..94dc1126da 100644
--- a/core/src/fpdfdoc/doc_vt.cpp
+++ b/core/src/fpdfdoc/doc_vt.cpp
@@ -920,7 +920,7 @@ CPVT_WordPlace CPDF_VariableText::InsertSection(const CPVT_WordPlace & place, co
}
return newplace;
}
-CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset,
+CPVT_WordPlace CPDF_VariableText::InsertText(const CPVT_WordPlace & place, const FX_WCHAR* text, int32_t charset,
const CPVT_SecProps * pSecProps, const CPVT_WordProps * pProps)
{
CFX_WideString swText = text;
@@ -980,7 +980,7 @@ CPVT_WordPlace CPDF_VariableText::BackSpaceWord(const CPVT_WordPlace & place)
{
return ClearLeftWord(AjustLineHeader(place, TRUE));
}
-void CPDF_VariableText::SetText(FX_LPCWSTR text, int32_t charset, const CPVT_SecProps * pSecProps,
+void CPDF_VariableText::SetText(const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps,
const CPVT_WordProps * pWordProps)
{
DeleteWords(CPVT_WordRange(GetBeginWordPlace(), GetEndWordPlace()));
diff --git a/core/src/fpdfdoc/pdf_vt.h b/core/src/fpdfdoc/pdf_vt.h
index 5d8b20cf52..b66c2ed3b5 100644
--- a/core/src/fpdfdoc/pdf_vt.h
+++ b/core/src/fpdfdoc/pdf_vt.h
@@ -474,13 +474,13 @@ public:
void RearrangeAll();
void RearrangePart(const CPVT_WordRange & PlaceRange);
void ResetAll();
- void SetText(FX_LPCWSTR text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL,
+ void SetText(const FX_WCHAR* text, int32_t charset = 1, const CPVT_SecProps * pSecProps = NULL,
const CPVT_WordProps * pWordProps = NULL);
CPVT_WordPlace InsertWord(const CPVT_WordPlace & place, FX_WORD word, int32_t charset = 1,
const CPVT_WordProps * pWordProps = NULL);
CPVT_WordPlace InsertSection(const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps = NULL,
const CPVT_WordProps * pWordProps = NULL);
- CPVT_WordPlace InsertText(const CPVT_WordPlace & place, FX_LPCWSTR text, int32_t charset = 1,
+ CPVT_WordPlace InsertText(const CPVT_WordPlace & place, const FX_WCHAR* text, int32_t charset = 1,
const CPVT_SecProps * pSecProps = NULL, const CPVT_WordProps * pWordProps = NULL);
CPVT_WordPlace DeleteWords(const CPVT_WordRange & PlaceRange);
CPVT_WordPlace DeleteWord(const CPVT_WordPlace & place);