summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-12-30 16:56:12 -0800
committerBo Xu <bo_xu@foxitsoftware.com>2014-12-30 17:07:17 -0800
commitc616483e834b791b92b0c0d4f99d0ea3b66f1a4f (patch)
treee9589ee48c4aeb5e0ab5e9ba0766e6d8c1f768dd /core/src/fpdfapi/fpdf_edit
parentbb1405dda43fd4b605fd9c2808dc0ead87f54ccc (diff)
downloadpdfium-c616483e834b791b92b0c0d4f99d0ea3b66f1a4f.tar.xz
XFA: merge patch from CL 733693003, get rid of FX_LPCSTR cast
Get rid of FX_LPCSTR cast. Follow up on https://codereview.chromium.org/733693003 R=brucedawson@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/809993004
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp10
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index 4a34de1c16..7795f1fe91 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -1107,7 +1107,7 @@ FX_INT32 CPDF_Creator::WriteDirectObj(FX_DWORD objnum, const CPDF_Object* pObj,
break;
}
CPDF_Encryptor encryptor;
- encryptor.Initialize(m_pCryptoHandler, objnum, (FX_LPBYTE)(FX_LPCSTR)str, str.GetLength());
+ 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);
if ((len = m_File.AppendString(content)) < 0) {
return -1;
@@ -1665,12 +1665,12 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
} else {
str.Format("%d %d\r\n", i, j - i);
}
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ if (m_File.AppendBlock(str.c_str(), str.GetLength()) < 0) {
return -1;
}
while (i < j) {
str.Format("%010d 00000 n\r\n", m_ObjectOffset[i ++]);
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ if (m_File.AppendBlock(str.c_str(), str.GetLength()) < 0) {
return -1;
}
}
@@ -1707,13 +1707,13 @@ FX_INT32 CPDF_Creator::WriteDoc_Stage3(IFX_Pause *pPause)
} else {
str.Format("%d %d\r\n", objnum, j - i);
}
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ if (m_File.AppendBlock(str.c_str(), str.GetLength()) < 0) {
return -1;
}
while (i < j) {
objnum = m_NewObjNumArray.ElementAt(i++);
str.Format("%010d 00000 n\r\n", m_ObjectOffset[objnum]);
- if (m_File.AppendBlock((FX_LPCSTR)str, str.GetLength()) < 0) {
+ if (m_File.AppendBlock(str.c_str(), str.GetLength()) < 0) {
return -1;
}
}
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index 19786f7451..b6c1dff84b 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -223,7 +223,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTW* pLogFont, FX_BOOL bVert, FX_B
if (face.GetLength() >= LF_FACESIZE) {
return NULL;
}
- FXSYS_strcpy(lfa.lfFaceName, (FX_LPCSTR)face);
+ FXSYS_strcpy(lfa.lfFaceName, face.c_str());
return AddWindowsFont(&lfa, bVert, bTranslateName);
}
extern CFX_ByteString _FPDF_GetNameFromTT(FX_LPCBYTE name_table, FX_DWORD name);