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

Unified Diff: core/src/fpdftext/fpdf_text.cpp

Issue 1406303006: Merge to XFA: Don't bother passing -1 as the length to the CFX_ByteString ctor. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp ('k') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdftext/fpdf_text.cpp
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp
index 0b53338ea0fdaa7f3bc43bb50f43190b5848a53b..2bd8b7d6cea18c855056fbef2679be7e25687a8b 100644
--- a/core/src/fpdftext/fpdf_text.cpp
+++ b/core/src/fpdftext/fpdf_text.cpp
@@ -22,10 +22,7 @@ CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode,
return CFX_ByteString((char)unicode);
}
const FX_CHAR* altstr = FCS_GetAltStr(unicode);
- if (altstr) {
- return CFX_ByteString(altstr, -1);
- }
- return CFX_ByteString(defchar, -1);
+ return CFX_ByteString(altstr ? altstr : defchar);
}
char buf[10];
int iDef = 0;
@@ -35,10 +32,7 @@ CFX_ByteString CharFromUnicodeAlt(FX_WCHAR unicode,
return CFX_ByteString(buf, ret);
}
const FX_CHAR* altstr = FCS_GetAltStr(unicode);
- if (altstr) {
- return CFX_ByteString(altstr, -1);
- }
- return CFX_ByteString(defchar, -1);
+ return CFX_ByteString(altstr ? altstr : defchar);
}
CTextPage::CTextPage() {}
CTextPage::~CTextPage() {
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp ('k') | core/src/fxge/ge/fx_ge_fontmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698