From 275e260a6cd4a8e506ba974feb85ebcd926c1739 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 18 Sep 2017 14:23:18 -0400 Subject: Convert string class names Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez Commit-Queue: Ryan Harrison --- fpdfsdk/fpdf_flatten.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'fpdfsdk/fpdf_flatten.cpp') diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp index b8e84c8cc4..a276e3a368 100644 --- a/fpdfsdk/fpdf_flatten.cpp +++ b/fpdfsdk/fpdf_flatten.cpp @@ -97,7 +97,7 @@ int ParserAnnots(CPDF_Document* pSourceDoc, if (!pAnnotDic) continue; - CFX_ByteString sSubtype = pAnnotDic->GetStringFor("Subtype"); + ByteString sSubtype = pAnnotDic->GetStringFor("Subtype"); if (sSubtype == "Popup") continue; @@ -168,18 +168,18 @@ CFX_FloatRect CalculateRect(std::vector* pRectArray) { return rcRet; } -uint32_t NewIndirectContentsStream(const CFX_ByteString& key, +uint32_t NewIndirectContentsStream(const ByteString& key, CPDF_Document* pDocument) { CPDF_Stream* pNewContents = pDocument->NewIndirect( nullptr, 0, pdfium::MakeUnique(pDocument->GetByteStringPool())); - CFX_ByteString sStream; + ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); pNewContents->SetData(sStream.raw_str(), sStream.GetLength()); return pNewContents->GetObjNum(); } -void SetPageContents(const CFX_ByteString& key, +void SetPageContents(const ByteString& key, CPDF_Dictionary* pPage, CPDF_Document* pDocument) { CPDF_Array* pContentsArray = nullptr; @@ -199,9 +199,9 @@ void SetPageContents(const CFX_ByteString& key, pContentsArray = pDocument->NewIndirect(); auto pAcc = pdfium::MakeRetain(pContentsStream); pAcc->LoadAllData(); - CFX_ByteString sStream = "q\n"; - CFX_ByteString sBody = - CFX_ByteString((const char*)pAcc->GetData(), pAcc->GetSize()); + ByteString sStream = "q\n"; + ByteString sBody = + ByteString((const char*)pAcc->GetData(), pAcc->GetSize()); sStream = sStream + sBody + "\nQ"; pContentsStream->SetDataAndRemoveFilter(sStream.raw_str(), sStream.GetLength()); @@ -299,10 +299,10 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { if (!pPageXObject) pPageXObject = pRes->SetNewFor("XObject"); - CFX_ByteString key; + ByteString key; int nStreams = pdfium::CollectionSize(ObjectArray); if (nStreams > 0) { - CFX_ByteString sKey; + ByteString sKey; int i = 0; while (i < INT_MAX) { sKey.Format("FFT%d", i); @@ -336,7 +336,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { CFX_FloatRect rcAnnot = pAnnotDic->GetRectFor("Rect"); rcAnnot.Normalize(); - CFX_ByteString sAnnotState = pAnnotDic->GetStringFor("AS"); + ByteString sAnnotState = pAnnotDic->GetStringFor("AS"); CPDF_Dictionary* pAnnotAP = pAnnotDic->GetDictFor("AP"); if (!pAnnotAP) continue; @@ -392,17 +392,17 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFPage_Flatten(FPDF_PAGE page, int nFlag) { if (!pXObject) pXObject = pNewXORes->SetNewFor("XObject"); - CFX_ByteString sFormName; + ByteString sFormName; sFormName.Format("F%d", i); pXObject->SetNewFor(sFormName, pDocument, pObj->GetObjNum()); auto pAcc = pdfium::MakeRetain(pNewXObject); pAcc->LoadAllData(); - CFX_ByteString sStream(pAcc->GetData(), pAcc->GetSize()); + ByteString sStream(pAcc->GetData(), pAcc->GetSize()); CFX_Matrix matrix = pAPDic->GetMatrixFor("Matrix"); CFX_Matrix m = GetMatrix(rcAnnot, rcStream, matrix); - CFX_ByteString sTemp; + ByteString sTemp; sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, sFormName.c_str()); sStream += sTemp; -- cgit v1.2.3