summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/include/fpdfapi/fpdf_parser.h19
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp58
2 files changed, 13 insertions, 64 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index 0ed8ed20d8..4b91802601 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -800,25 +800,12 @@ FX_FLOAT PDF_ClipFloat(FX_FLOAT f);
class CFDF_Document : public CPDF_IndirectObjects
{
public:
-
- static CFDF_Document* CreateNewDoc();
-
- static CFDF_Document* ParseFile(FX_LPCSTR file_path);
-
- static CFDF_Document* ParseFile(FX_LPCWSTR file_path);
-
- static CFDF_Document* ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE);
-
- static CFDF_Document* ParseMemory(FX_LPCBYTE pData, FX_DWORD size);
+ static CFDF_Document* CreateNewDoc();
+ static CFDF_Document* ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile = FALSE);
+ static CFDF_Document* ParseMemory(FX_LPCBYTE pData, FX_DWORD size);
~CFDF_Document();
- FX_BOOL WriteFile(FX_LPCSTR file_path) const;
-
- FX_BOOL WriteFile(FX_LPCWSTR file_path) const;
-
- FX_BOOL WriteFile(IFX_FileWrite *pFile) const;
-
FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const;
CPDF_Dictionary* GetRoot() const
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
index e431c6ad3c..028e5e2972 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
@@ -26,26 +26,18 @@ CFDF_Document* CFDF_Document::CreateNewDoc()
pDoc->m_pRootDict->SetAt(FX_BSTRC("FDF"), pFDFDict);
return pDoc;
}
-CFDF_Document* CFDF_Document::ParseFile(FX_LPCSTR file_path)
-{
- return CFDF_Document::ParseFile(FX_CreateFileRead(file_path), TRUE);
-}
-CFDF_Document* CFDF_Document::ParseFile(FX_LPCWSTR file_path)
-{
- return CFDF_Document::ParseFile(FX_CreateFileRead(file_path), TRUE);
-}
CFDF_Document* CFDF_Document::ParseFile(IFX_FileRead *pFile, FX_BOOL bOwnFile)
{
- if (!pFile) {
- return NULL;
- }
- CFDF_Document* pDoc = FX_NEW CFDF_Document;
- pDoc->ParseStream(pFile, bOwnFile);
- if (pDoc->m_pRootDict == NULL) {
- delete pDoc;
- return NULL;
- }
- return pDoc;
+ if (!pFile) {
+ return NULL;
+ }
+ CFDF_Document* pDoc = FX_NEW CFDF_Document;
+ pDoc->ParseStream(pFile, bOwnFile);
+ if (pDoc->m_pRootDict == NULL) {
+ delete pDoc;
+ return NULL;
+ }
+ return pDoc;
}
CFDF_Document* CFDF_Document::ParseMemory(FX_LPCBYTE pData, FX_DWORD size)
{
@@ -121,36 +113,6 @@ CFX_WideString CFDF_Document::GetWin32Path() const
}
return FPDF_FileSpec_GetWin32Path(pFileSpec);
}
-FX_BOOL CFDF_Document::WriteFile(FX_LPCSTR file_path) const
-{
- IFX_FileWrite *pFile = FX_CreateFileWrite(file_path);
- if (!pFile) {
- return FALSE;
- }
- FX_BOOL bRet = WriteFile(pFile);
- pFile->Release();
- return bRet;
-}
-FX_BOOL CFDF_Document::WriteFile(FX_LPCWSTR file_path) const
-{
- IFX_FileWrite *pFile = FX_CreateFileWrite(file_path);
- if (!pFile) {
- return FALSE;
- }
- FX_BOOL bRet = WriteFile(pFile);
- pFile->Release();
- return bRet;
-}
-FX_BOOL CFDF_Document::WriteFile(IFX_FileWrite *pFile) const
-{
- CFX_ByteTextBuf buf;
- WriteBuf(buf);
- FX_BOOL bRet = pFile->WriteBlock(buf.GetBuffer(), buf.GetSize());
- if (bRet) {
- pFile->Flush();
- }
- return bRet;
-}
static CFX_WideString ChangeSlash(FX_LPCWSTR str)
{
CFX_WideString result;