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/fpdfedittext.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'fpdfsdk/fpdfedittext.cpp') diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdfedittext.cpp index 38f7cc2562..2ac32b82a3 100644 --- a/fpdfsdk/fpdfedittext.cpp +++ b/fpdfsdk/fpdfedittext.cpp @@ -28,7 +28,7 @@ namespace { CPDF_Dictionary* LoadFontDesc(CPDF_Document* pDoc, - const CFX_ByteString& font_name, + const ByteString& font_name, CFX_Font* pFont, const uint8_t* data, uint32_t size, @@ -71,8 +71,7 @@ CPDF_Dictionary* LoadFontDesc(CPDF_Document* pDoc, CPDF_Stream* pStream = pDoc->NewIndirect(); pStream->SetData(data, size); - CFX_ByteString fontFile = - font_type == FPDF_FONT_TYPE1 ? "FontFile" : "FontFile2"; + ByteString fontFile = font_type == FPDF_FONT_TYPE1 ? "FontFile" : "FontFile2"; fontDesc->SetNewFor(fontFile, pDoc, pStream->GetObjNum()); return fontDesc; } @@ -243,7 +242,7 @@ void* LoadSimpleFont(CPDF_Document* pDoc, fontDict->SetNewFor("Type", "Font"); fontDict->SetNewFor( "Subtype", font_type == FPDF_FONT_TYPE1 ? "Type1" : "TrueType"); - CFX_ByteString name = pFont->GetFaceName(); + ByteString name = pFont->GetFaceName(); if (name.IsEmpty()) name = "Unnamed"; fontDict->SetNewFor("BaseFont", name); @@ -286,9 +285,9 @@ void* LoadCompositeFont(CPDF_Document* pDoc, fontDict->SetNewFor("Type", "Font"); fontDict->SetNewFor("Subtype", "Type0"); // TODO(npm): Get the correct encoding, if it's not identity. - CFX_ByteString encoding = "Identity-H"; + ByteString encoding = "Identity-H"; fontDict->SetNewFor("Encoding", encoding); - CFX_ByteString name = pFont->GetFaceName(); + ByteString name = pFont->GetFaceName(); if (name.IsEmpty()) name = "Unnamed"; fontDict->SetNewFor( @@ -404,7 +403,7 @@ FPDFPageObj_NewTextObj(FPDF_DOCUMENT document, if (!pDoc) return nullptr; - CPDF_Font* pFont = CPDF_Font::GetStockFont(pDoc, CFX_ByteStringC(font)); + CPDF_Font* pFont = CPDF_Font::GetStockFont(pDoc, ByteStringView(font)); if (!pFont) return nullptr; @@ -421,9 +420,9 @@ FPDFText_SetText(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text) { if (!pTextObj) return false; - FX_STRSIZE len = CFX_WideString::WStringLength(text); - CFX_WideString encodedText = CFX_WideString::FromUTF16LE(text, len); - CFX_ByteString byteText; + FX_STRSIZE len = WideString::WStringLength(text); + WideString encodedText = WideString::FromUTF16LE(text, len); + ByteString byteText; for (wchar_t wc : encodedText) { pTextObj->GetFont()->AppendChar( &byteText, pTextObj->GetFont()->CharCodeFromUnicode(wc)); -- cgit v1.2.3