summaryrefslogtreecommitdiff
path: root/core/src/fpdftext/fpdf_text.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-16 16:29:59 -0700
committerLei Zhang <thestig@chromium.org>2015-10-16 16:29:59 -0700
commit0c6e6824979c9a3e7006a925f7b307db04342146 (patch)
tree12be3af6450fbb37cc5c12247eea888c9cf09d11 /core/src/fpdftext/fpdf_text.cpp
parentc40ccaff017691b7d31e0597863bfb954aebd739 (diff)
downloadpdfium-0c6e6824979c9a3e7006a925f7b307db04342146.tar.xz
Merge to XFA: Don't bother passing -1 as the length to the CFX_ByteString ctor.
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1406363002 . (cherry picked from commit 316e482630d5f5d9084edd9725f98a0d89a5bbdf) Review URL: https://codereview.chromium.org/1406303006 .
Diffstat (limited to 'core/src/fpdftext/fpdf_text.cpp')
-rw-r--r--core/src/fpdftext/fpdf_text.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/core/src/fpdftext/fpdf_text.cpp b/core/src/fpdftext/fpdf_text.cpp
index 0b53338ea0..2bd8b7d6ce 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() {