summaryrefslogtreecommitdiff
path: root/core/fxge/cfx_fontmapper.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-07-27 16:28:44 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-27 21:05:23 +0000
commit33805cc811c722a0c5cd439cff419de252cd39c9 (patch)
treebb6ef4484ff62486e4cc0ea49642278b5da1b746 /core/fxge/cfx_fontmapper.cpp
parent4191b03e29ef54f37deeadf652ee11cbfb81f9df (diff)
downloadpdfium-33805cc811c722a0c5cd439cff419de252cd39c9.tar.xz
Remove single param Mid() method from string classes
This support is being removed from CFX_ByteString, CFX_ByteStringC, CFX_WideString, and CFX_WideStringC. This standardizes all of these classes to only have one Mid method that takes in 2 params, offset and count. Count now must be positive. The old behaviour of calculating the length for the user if -1 is passed in for the count has been removed. This work is in preperation for converting these classes to not accept negative lengths anywhere and thus make the underlying size type unsigned. BUG=pdfium:828 Change-Id: I5f15e7b7b00b264231817f143e2da88ee6f69e7b Reviewed-on: https://pdfium-review.googlesource.com/9430 Reviewed-by: (OOO Jul 28 - Aug 8) dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxge/cfx_fontmapper.cpp')
-rw-r--r--core/fxge/cfx_fontmapper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxge/cfx_fontmapper.cpp b/core/fxge/cfx_fontmapper.cpp
index 5b4ceaac59..5c7b602fed 100644
--- a/core/fxge/cfx_fontmapper.cpp
+++ b/core/fxge/cfx_fontmapper.cpp
@@ -432,7 +432,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
CFX_ByteString SubstName = name;
SubstName.Remove(' ');
if (bTrueType && name[0] == '@')
- SubstName = name.Mid(1);
+ SubstName = name.Mid(1, name.GetLength() - 1);
PDF_GetStandardFontName(&SubstName);
if (SubstName == "Symbol" && !bTrueType) {
pSubstFont->m_Family = "Chrome Symbol";
@@ -453,7 +453,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
if (find >= 0) {
family = SubstName.Left(find);
PDF_GetStandardFontName(&family);
- style = SubstName.Mid(find + 1);
+ style = SubstName.Mid(find + 1, SubstName.GetLength() - (find + 1));
bHasComma = true;
} else {
family = SubstName;
@@ -480,7 +480,7 @@ FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
if (!bHasComma) {
find = family.ReverseFind('-');
if (find >= 0) {
- style = family.Mid(find + 1);
+ style = family.Mid(find + 1, family.GetLength() - (find + 1));
family = family.Left(find);
bHasHyphen = true;
}