From 9f2970caec897c40b91bd010c04dfe1f19d11108 Mon Sep 17 00:00:00 2001 From: tsepez Date: Fri, 1 Apr 2016 10:23:04 -0700 Subject: Remove CFX_{Byte,Wide}String::Equal in favor of "==". Makes the code slightly cleaner. Review URL: https://codereview.chromium.org/1846083002 --- fpdfsdk/fpdfdoc.cpp | 2 +- fpdfsdk/fpdfppo.cpp | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp index 1b2daaeb5a..c9030e5035 100644 --- a/fpdfsdk/fpdfdoc.cpp +++ b/fpdfsdk/fpdfdoc.cpp @@ -291,7 +291,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, ToDictionary(static_cast(pAnnots->GetDirectObjectAt(i))); if (!pDict) continue; - if (pDict->GetStringBy("Subtype").Equal("Link")) { + if (pDict->GetStringBy("Subtype") == "Link") { *startPos = i + 1; *linkAnnot = (FPDF_LINK)pDict; return TRUE; diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp index 94fa6bae84..cab2c6c3e0 100644 --- a/fpdfsdk/fpdfppo.cpp +++ b/fpdfsdk/fpdfppo.cpp @@ -54,7 +54,6 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc, if (!pNewRoot) return FALSE; - // Set the document information CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo(); if (!DInfoDict) return FALSE; @@ -63,11 +62,9 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc, producerstr.Format("PDFium"); DInfoDict->SetAt("Producer", new CPDF_String(producerstr, FALSE)); - // Set type CFX_ByteString cbRootType = pNewRoot->GetStringBy("Type", ""); - if (cbRootType.Equal("")) { + if (cbRootType.IsEmpty()) pNewRoot->SetAt("Type", new CPDF_Name("Catalog")); - } CPDF_Object* pElement = pNewRoot->GetObjectBy("Pages"); CPDF_Dictionary* pNewPages = @@ -79,7 +76,7 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document* pDestPDFDoc, } CFX_ByteString cbPageType = pNewPages->GetStringBy("Type", ""); - if (cbPageType.Equal("")) { + if (cbPageType == "") { pNewPages->SetAt("Type", new CPDF_Name("Pages")); } -- cgit v1.2.3