diff options
author | tsepez <tsepez@chromium.org> | 2016-04-01 10:23:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-01 10:23:05 -0700 |
commit | 9f2970caec897c40b91bd010c04dfe1f19d11108 (patch) | |
tree | d0a289939b3b6be3fe19a412b134eeb467672db2 /core/fpdfdoc | |
parent | df4bc596c64fb848647c670be66a29ea0861b4f4 (diff) | |
download | pdfium-9f2970caec897c40b91bd010c04dfe1f19d11108.tar.xz |
Remove CFX_{Byte,Wide}String::Equal in favor of "==".
Makes the code slightly cleaner.
Review URL: https://codereview.chromium.org/1846083002
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/doc_basic_unittest.cpp | 18 | ||||
-rw-r--r-- | core/fpdfdoc/doc_formcontrol.cpp | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/core/fpdfdoc/doc_basic_unittest.cpp b/core/fpdfdoc/doc_basic_unittest.cpp index a84f334ebb..0ab70c9304 100644 --- a/core/fpdfdoc/doc_basic_unittest.cpp +++ b/core/fpdfdoc/doc_basic_unittest.cpp @@ -52,10 +52,10 @@ TEST(doc_basic_filespec, EncodeDecodeFileName) { }; for (const auto& data : test_data) { CFX_WideString encoded_str = CPDF_FileSpec::EncodeFileName(data.input); - EXPECT_TRUE(encoded_str.Equal(data.expected)); + EXPECT_TRUE(encoded_str == data.expected); // DecodeFileName is the reverse procedure of EncodeFileName. CFX_WideString decoded_str = CPDF_FileSpec::DecodeFileName(data.expected); - EXPECT_TRUE(decoded_str.Equal(data.input)); + EXPECT_TRUE(decoded_str == data.input); } } @@ -78,7 +78,7 @@ TEST(doc_basic_filespec, GetFileName) { CPDF_FileSpec file_spec(str_obj.get()); CFX_WideString file_name; EXPECT_TRUE(file_spec.GetFileName(&file_name)); - EXPECT_TRUE(file_name.Equal(test_data.expected)); + EXPECT_TRUE(file_name == test_data.expected); } { // Dictionary object. @@ -111,14 +111,14 @@ TEST(doc_basic_filespec, GetFileName) { for (int i = 0; i < 5; ++i) { dict_obj->SetAt(keywords[i], new CPDF_String(test_data[i].input)); EXPECT_TRUE(file_spec.GetFileName(&file_name)); - EXPECT_TRUE(file_name.Equal(test_data[i].expected)); + EXPECT_TRUE(file_name == test_data[i].expected); } // With all the former fields and 'FS' field suggests 'URL' type. dict_obj->SetAtString("FS", "URL"); EXPECT_TRUE(file_spec.GetFileName(&file_name)); // Url string is not decoded. - EXPECT_TRUE(file_name.Equal(test_data[4].input)); + EXPECT_TRUE(file_name == test_data[4].input); } { // Invalid object. @@ -152,7 +152,7 @@ TEST(doc_basic_filespec, SetFileName) { // Check we can get the file name back. CFX_WideString file_name; EXPECT_TRUE(file_spec1.GetFileName(&file_name)); - EXPECT_TRUE(file_name.Equal(test_data.input)); + EXPECT_TRUE(file_name == test_data.input); // Dictionary object. ScopedDict dict_obj(new CPDF_Dictionary); @@ -160,10 +160,10 @@ TEST(doc_basic_filespec, SetFileName) { file_spec2.SetFileName(test_data.input); // Check internal object value. file_name = dict_obj->GetUnicodeTextBy("F"); - EXPECT_TRUE(file_name.Equal(test_data.expected)); + EXPECT_TRUE(file_name == test_data.expected); file_name = dict_obj->GetUnicodeTextBy("UF"); - EXPECT_TRUE(file_name.Equal(test_data.expected)); + EXPECT_TRUE(file_name == test_data.expected); // Check we can get the file name back. EXPECT_TRUE(file_spec2.GetFileName(&file_name)); - EXPECT_TRUE(file_name.Equal(test_data.input)); + EXPECT_TRUE(file_name == test_data.input); } diff --git a/core/fpdfdoc/doc_formcontrol.cpp b/core/fpdfdoc/doc_formcontrol.cpp index 255b5e9a70..1fcc4a386b 100644 --- a/core/fpdfdoc/doc_formcontrol.cpp +++ b/core/fpdfdoc/doc_formcontrol.cpp @@ -190,7 +190,7 @@ CPDF_FormControl::HighlightingMode CPDF_FormControl::GetHighlightingMode() { } CFX_ByteString csH = m_pWidgetDict->GetStringBy("H", "I"); for (int i = 0; g_sHighlightingMode[i]; ++i) { - if (csH.Equal(g_sHighlightingMode[i])) + if (csH == g_sHighlightingMode[i]) return static_cast<HighlightingMode>(i); } return Invert; |