Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: xfa/fxfa/app/xfa_fontmgr.cpp

Issue 1846083002: Remove CFX_{Byte,Wide}String::Equal in favor of "==". (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fxfa/app/xfa_fontmgr.h" 7 #include "xfa/fxfa/app/xfa_fontmgr.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 } else if (bsDRName.Find("Oblique") > 0) { 1959 } else if (bsDRName.Find("Oblique") > 0) {
1960 iDifferLength -= 7; 1960 iDifferLength -= 7;
1961 } else { 1961 } else {
1962 bItalicFont = FALSE; 1962 bItalicFont = FALSE;
1963 } 1963 }
1964 if (bItalic ^ bItalicFont) { 1964 if (bItalic ^ bItalicFont) {
1965 return FALSE; 1965 return FALSE;
1966 } 1966 }
1967 if (iDifferLength > 1) { 1967 if (iDifferLength > 1) {
1968 CFX_ByteString bsDRTailer = bsDRName.Right(iDifferLength); 1968 CFX_ByteString bsDRTailer = bsDRName.Right(iDifferLength);
1969 if (bsDRTailer.Equal("MT") || bsDRTailer.Equal("PSMT") || 1969 if (bsDRTailer == "MT" || bsDRTailer == "PSMT" ||
1970 bsDRTailer.Equal("Regular") || bsDRTailer.Equal("Reg")) { 1970 bsDRTailer == "Regular" || bsDRTailer == "Reg") {
1971 return TRUE; 1971 return TRUE;
1972 } 1972 }
1973 if (bBoldFont || bItalicFont) { 1973 if (bBoldFont || bItalicFont) {
1974 return FALSE; 1974 return FALSE;
1975 } 1975 }
1976 FX_BOOL bMatch = FALSE; 1976 FX_BOOL bMatch = FALSE;
1977 switch (bsPsName.GetAt(iPsLen - 1)) { 1977 switch (bsPsName.GetAt(iPsLen - 1)) {
1978 case 'L': { 1978 case 'L': {
1979 if (bsDRName.Right(5).Equal("Light")) { 1979 if (bsDRName.Right(5) == "Light") {
1980 bMatch = TRUE; 1980 bMatch = TRUE;
1981 } 1981 }
1982 } break; 1982 } break;
1983 case 'R': { 1983 case 'R': {
1984 if (bsDRName.Right(7).Equal("Regular") || 1984 if (bsDRName.Right(7) == "Regular" || bsDRName.Right(3) == "Reg") {
1985 bsDRName.Right(3).Equal("Reg")) {
1986 bMatch = TRUE; 1985 bMatch = TRUE;
1987 } 1986 }
1988 } break; 1987 } break;
1989 case 'M': { 1988 case 'M': {
1990 if (bsDRName.Right(5).Equal("Medium")) { 1989 if (bsDRName.Right(5) == "Medium") {
1991 bMatch = TRUE; 1990 bMatch = TRUE;
1992 } 1991 }
1993 } break; 1992 } break;
1994 default: 1993 default:
1995 break; 1994 break;
1996 } 1995 }
1997 return bMatch; 1996 return bMatch;
1998 } 1997 }
1999 } 1998 }
2000 return TRUE; 1999 return TRUE;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
2080 CXFA_PDFFontMgr* pMgr = NULL; 2079 CXFA_PDFFontMgr* pMgr = NULL;
2081 m_PDFFontMgrArray.GetNextAssoc(ps, (void*&)hDoc, (void*&)pMgr); 2080 m_PDFFontMgrArray.GetNextAssoc(ps, (void*&)hDoc, (void*&)pMgr);
2082 delete pMgr; 2081 delete pMgr;
2083 } 2082 }
2084 m_PDFFontMgrArray.RemoveAll(); 2083 m_PDFFontMgrArray.RemoveAll();
2085 m_FontMap.clear(); 2084 m_FontMap.clear();
2086 } 2085 }
2087 void CXFA_FontMgr::SetDefFontMgr(IXFA_FontMgr* pFontMgr) { 2086 void CXFA_FontMgr::SetDefFontMgr(IXFA_FontMgr* pFontMgr) {
2088 m_pDefFontMgr = pFontMgr; 2087 m_pDefFontMgr = pFontMgr;
2089 } 2088 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698