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/fpdfdoc.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'fpdfsdk/fpdfdoc.cpp') diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index f73336a94f..c3910b2883 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -24,7 +24,7 @@ namespace { CPDF_Bookmark FindBookmark(const CPDF_BookmarkTree& tree, CPDF_Bookmark bookmark, - const CFX_WideString& title, + const WideString& title, std::set* visited) { // Return if already checked to avoid circular calling. if (pdfium::ContainsKey(*visited, bookmark.GetDict())) @@ -91,7 +91,7 @@ FPDFBookmark_GetTitle(FPDF_BOOKMARK pDict, void* buffer, unsigned long buflen) { if (!pDict) return 0; CPDF_Bookmark bookmark(ToDictionary(static_cast(pDict))); - CFX_WideString title = bookmark.GetTitle(); + WideString title = bookmark.GetTitle(); return Utf16EncodeMaybeCopyAndReturnLength(title, buffer, buflen); } @@ -103,8 +103,8 @@ FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title) { if (!pDoc) return nullptr; CPDF_BookmarkTree tree(pDoc); - FX_STRSIZE len = CFX_WideString::WStringLength(title); - CFX_WideString encodedTitle = CFX_WideString::FromUTF16LE(title, len); + FX_STRSIZE len = WideString::WStringLength(title); + WideString encodedTitle = WideString::FromUTF16LE(title, len); std::set visited; return FindBookmark(tree, CPDF_Bookmark(), encodedTitle, &visited).GetDict(); } @@ -174,7 +174,7 @@ FPDFAction_GetFilePath(FPDF_ACTION pDict, void* buffer, unsigned long buflen) { return 0; CPDF_Action action(ToDictionary(static_cast(pDict))); - CFX_ByteString path = action.GetFilePath().UTF8Encode(); + ByteString path = action.GetFilePath().UTF8Encode(); unsigned long len = path.GetLength() + 1; if (buffer && len <= buflen) memcpy(buffer, path.c_str(), len); @@ -192,7 +192,7 @@ FPDFAction_GetURIPath(FPDF_DOCUMENT document, if (!pDoc) return 0; CPDF_Action action(ToDictionary(static_cast(pDict))); - CFX_ByteString path = action.GetURI(pDoc); + ByteString path = action.GetURI(pDoc); unsigned long len = path.GetLength() + 1; if (buffer && len <= buflen) memcpy(buffer, path.c_str(), len); @@ -390,7 +390,7 @@ FPDF_EXPORT unsigned long FPDF_CALLCONV FPDF_GetMetaText(FPDF_DOCUMENT document, const CPDF_Dictionary* pInfo = pDoc->GetInfo(); if (!pInfo) return 0; - CFX_WideString text = pInfo->GetUnicodeTextFor(tag); + WideString text = pInfo->GetUnicodeTextFor(tag); return Utf16EncodeMaybeCopyAndReturnLength(text, buffer, buflen); } @@ -404,7 +404,7 @@ FPDF_GetPageLabel(FPDF_DOCUMENT document, // CPDF_PageLabel can deal with NULL |document|. CPDF_PageLabel label(CPDFDocumentFromFPDFDocument(document)); - CFX_WideString str; + WideString str; if (!label.GetLabel(page_index, &str)) return 0; return Utf16EncodeMaybeCopyAndReturnLength(str, buffer, buflen); -- cgit v1.2.3