summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfedittext.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fpdfsdk/fpdfedittext.cpp
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz
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 <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfedittext.cpp')
-rw-r--r--fpdfsdk/fpdfedittext.cpp19
1 files changed, 9 insertions, 10 deletions
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<CPDF_Stream>();
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<CPDF_Reference>(fontFile, pDoc, pStream->GetObjNum());
return fontDesc;
}
@@ -243,7 +242,7 @@ void* LoadSimpleFont(CPDF_Document* pDoc,
fontDict->SetNewFor<CPDF_Name>("Type", "Font");
fontDict->SetNewFor<CPDF_Name>(
"Subtype", font_type == FPDF_FONT_TYPE1 ? "Type1" : "TrueType");
- CFX_ByteString name = pFont->GetFaceName();
+ ByteString name = pFont->GetFaceName();
if (name.IsEmpty())
name = "Unnamed";
fontDict->SetNewFor<CPDF_Name>("BaseFont", name);
@@ -286,9 +285,9 @@ void* LoadCompositeFont(CPDF_Document* pDoc,
fontDict->SetNewFor<CPDF_Name>("Type", "Font");
fontDict->SetNewFor<CPDF_Name>("Subtype", "Type0");
// TODO(npm): Get the correct encoding, if it's not identity.
- CFX_ByteString encoding = "Identity-H";
+ ByteString encoding = "Identity-H";
fontDict->SetNewFor<CPDF_Name>("Encoding", encoding);
- CFX_ByteString name = pFont->GetFaceName();
+ ByteString name = pFont->GetFaceName();
if (name.IsEmpty())
name = "Unnamed";
fontDict->SetNewFor<CPDF_Name>(
@@ -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));