diff options
author | tsepez <tsepez@chromium.org> | 2016-04-08 12:20:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-08 12:20:39 -0700 |
commit | 4c3debb3c91f5842784be30a911b52cdabcab7df (patch) | |
tree | e0534dcb43a71376be8da0b376a97de37080ecc5 /core/fpdfapi/fpdf_edit | |
parent | f172290a8dc527cd8bc73b0d0ad59e78797968c1 (diff) | |
download | pdfium-4c3debb3c91f5842784be30a911b52cdabcab7df.tar.xz |
Rename both As{Byte,Wide}StringC() helpers to AsStringC().
The naming is redundant given the base type, and will stand
in the way of consolidating Byte and Wide code.
BUG=
Review URL: https://codereview.chromium.org/1862123003
Diffstat (limited to 'core/fpdfapi/fpdf_edit')
-rw-r--r-- | core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp | 4 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 31 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp | 2 |
3 files changed, 16 insertions, 21 deletions
diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp index af79fd31c1..a484edd6b9 100644 --- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp +++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp @@ -74,12 +74,12 @@ CFX_ByteString CPDF_PageContentGenerator::RealizeResource( int idnum = 1; while (1) { name.Format("FX%c%d", szType[0], idnum); - if (!pResList->KeyExist(name.AsByteStringC())) { + if (!pResList->KeyExist(name.AsStringC())) { break; } idnum++; } - pResList->AddReference(name.AsByteStringC(), m_pDocument, + pResList->AddReference(name.AsStringC(), m_pDocument, pResourceObj->GetObjNum()); return name; } diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 323602b0e1..c0d2ab0dd3 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -54,7 +54,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, if (pFile->AppendString(" ") < 0) { return -1; } - if ((len = pFile->AppendString(pObj->GetString().AsByteStringC())) < 0) { + if ((len = pFile->AppendString(pObj->GetString().AsStringC())) < 0) { return -1; } offset += len + 1; @@ -62,8 +62,8 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, case CPDF_Object::STRING: { CFX_ByteString str = pObj->GetString(); FX_BOOL bHex = pObj->AsString()->IsHex(); - if ((len = pFile->AppendString( - PDF_EncodeString(str, bHex).AsByteStringC())) < 0) { + if ((len = pFile->AppendString(PDF_EncodeString(str, bHex).AsStringC())) < + 0) { return -1; } offset += len; @@ -74,8 +74,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, return -1; } CFX_ByteString str = pObj->GetString(); - if ((len = pFile->AppendString(PDF_NameEncode(str).AsByteStringC())) < - 0) { + if ((len = pFile->AppendString(PDF_NameEncode(str).AsStringC())) < 0) { return -1; } offset += len + 1; @@ -134,8 +133,7 @@ int32_t PDF_CreatorAppendObject(const CPDF_Object* pObj, if (pFile->AppendString("/") < 0) { return -1; } - if ((len = pFile->AppendString(PDF_NameEncode(key).AsByteStringC())) < - 0) { + if ((len = pFile->AppendString(PDF_NameEncode(key).AsStringC())) < 0) { return -1; } offset += len + 1; @@ -214,8 +212,7 @@ int32_t PDF_CreatorWriteTrailer(CPDF_Document* pDocument, if (pFile->AppendString(("/")) < 0) { return -1; } - if ((len = pFile->AppendString(PDF_NameEncode(key).AsByteStringC())) < - 0) { + if ((len = pFile->AppendString(PDF_NameEncode(key).AsStringC())) < 0) { return -1; } offset += len + 1; @@ -1118,7 +1115,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum, if (m_File.AppendString(" ") < 0) { return -1; } - if ((len = m_File.AppendString(pObj->GetString().AsByteStringC())) < 0) { + if ((len = m_File.AppendString(pObj->GetString().AsStringC())) < 0) { return -1; } m_Offset += len + 1; @@ -1128,7 +1125,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum, FX_BOOL bHex = pObj->AsString()->IsHex(); if (!m_pCryptoHandler || !bEncrypt) { CFX_ByteString content = PDF_EncodeString(str, bHex); - if ((len = m_File.AppendString(content.AsByteStringC())) < 0) { + if ((len = m_File.AppendString(content.AsStringC())) < 0) { return -1; } m_Offset += len; @@ -1140,7 +1137,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum, CFX_ByteString content = PDF_EncodeString( CFX_ByteString((const FX_CHAR*)encryptor.m_pData, encryptor.m_dwSize), bHex); - if ((len = m_File.AppendString(content.AsByteStringC())) < 0) { + if ((len = m_File.AppendString(content.AsStringC())) < 0) { return -1; } m_Offset += len; @@ -1180,8 +1177,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum, return -1; } CFX_ByteString str = pObj->GetString(); - if ((len = m_File.AppendString(PDF_NameEncode(str).AsByteStringC())) < - 0) { + if ((len = m_File.AppendString(PDF_NameEncode(str).AsStringC())) < 0) { return -1; } m_Offset += len + 1; @@ -1245,8 +1241,7 @@ int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum, if (m_File.AppendString("/") < 0) { return -1; } - if ((len = m_File.AppendString(PDF_NameEncode(key).AsByteStringC())) < - 0) { + if ((len = m_File.AppendString(PDF_NameEncode(key).AsStringC())) < 0) { return -1; } m_Offset += len + 1; @@ -1648,7 +1643,7 @@ int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause* pPause) { str = m_ObjectOffset.GetPtrAt(1) ? "xref\r\n" : "xref\r\n0 1\r\n0000000000 65535 f\r\n"; - if (m_File.AppendString(str.AsByteStringC()) < 0) { + if (m_File.AppendString(str.AsStringC()) < 0) { return -1; } m_Pos = (void*)(uintptr_t)1; @@ -1777,7 +1772,7 @@ int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause* pPause) { if (m_File.AppendString(("/")) < 0) { return -1; } - if (m_File.AppendString(PDF_NameEncode(key).AsByteStringC()) < 0) { + if (m_File.AppendString(PDF_NameEncode(key).AsStringC()) < 0) { return -1; } if (pValue->GetObjNum()) { diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index d70c04c690..04ab9ea863 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -1124,7 +1124,7 @@ CPDF_Font* CPDF_Document::AddStandardFont(const FX_CHAR* font, CFX_ByteString name(font); if (PDF_GetStandardFontName(&name) < 0) return nullptr; - return GetPageData()->GetStandardFont(name.AsByteStringC(), pEncoding); + return GetPageData()->GetStandardFont(name.AsStringC(), pEncoding); } void CPDF_Document::DeletePage(int iPage) { |