summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-16 22:08:07 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-16 22:08:07 +0000
commit1c4735aed9442a8e442214a23a3df94bd8fc99b5 (patch)
tree37264efcc3a1d90e3a9f05384d283923c828242f /core/fpdfapi
parent3f1c832dda209cf6682bb75316c07d71332fe6c3 (diff)
downloadpdfium-1c4735aed9442a8e442214a23a3df94bd8fc99b5.tar.xz
Convert ByteString::{Format|FormatV} to static methods
This CL moves the Format and FormatV methods of ByteString to be static. Bug: pdfium:934 Change-Id: I9c30455a789aff9f619b9d5bf89c0712644f2d9a Reviewed-on: https://pdfium-review.googlesource.com/18650 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/edit/cpdf_creator.cpp12
-rw-r--r--core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp6
2 files changed, 9 insertions, 9 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp
index 590229bf4f..db5bd681d4 100644
--- a/core/fpdfapi/edit/cpdf_creator.cpp
+++ b/core/fpdfapi/edit/cpdf_creator.cpp
@@ -556,15 +556,15 @@ int32_t CPDF_Creator::WriteDoc_Stage3() {
j++;
if (i == 1)
- str.Format("0 %d\r\n0000000000 65535 f\r\n", j);
+ str = ByteString::Format("0 %d\r\n0000000000 65535 f\r\n", j);
else
- str.Format("%d %d\r\n", i, j - i);
+ str = ByteString::Format("%d %d\r\n", i, j - i);
if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
return -1;
while (i < j) {
- str.Format("%010d 00000 n\r\n", m_ObjectOffsets[i++]);
+ str = ByteString::Format("%010d 00000 n\r\n", m_ObjectOffsets[i++]);
if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
return -1;
}
@@ -590,16 +590,16 @@ int32_t CPDF_Creator::WriteDoc_Stage3() {
}
objnum = m_NewObjNumArray[i];
if (objnum == 1)
- str.Format("0 %d\r\n0000000000 65535 f\r\n", j - i + 1);
+ str = ByteString::Format("0 %d\r\n0000000000 65535 f\r\n", j - i + 1);
else
- str.Format("%d %d\r\n", objnum, j - i);
+ str = ByteString::Format("%d %d\r\n", objnum, j - i);
if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
return -1;
while (i < j) {
objnum = m_NewObjNumArray[i++];
- str.Format("%010d 00000 n\r\n", m_ObjectOffsets[objnum]);
+ str = ByteString::Format("%010d 00000 n\r\n", m_ObjectOffsets[objnum]);
if (!m_Archive->WriteBlock(str.c_str(), str.GetLength()))
return -1;
}
diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
index 593680e7ff..8a08a849cc 100644
--- a/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
@@ -138,10 +138,10 @@ ByteString CPDF_PageContentGenerator::RealizeResource(
ByteString name;
int idnum = 1;
while (1) {
- name.Format("FX%c%d", bsType[0], idnum);
- if (!pResList->KeyExist(name)) {
+ name = ByteString::Format("FX%c%d", bsType[0], idnum);
+ if (!pResList->KeyExist(name))
break;
- }
+
idnum++;
}
pResList->SetNewFor<CPDF_Reference>(name, m_pDocument.Get(),