summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-11 14:26:01 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-11 14:26:01 +0000
commit7981d15a799e3bdfaf6bd3e04fc08a6a43d143ec (patch)
treee9afc04bbee08b17e32c2286c6e2ae1d9ea52d41 /core/fxcrt
parent8b68d30fdc8ae33a8a5c2d647bd7a67f1271ff90 (diff)
downloadpdfium-7981d15a799e3bdfaf6bd3e04fc08a6a43d143ec.tar.xz
Add jumbo build support for fdrm, fpdfdoc and fxcrt.
BUG=pdfium:964 Change-Id: Ifde885861aeafac803948bd537de826e2a3fddca Reviewed-on: https://pdfium-review.googlesource.com/22732 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/bytestring.cpp2
-rw-r--r--core/fxcrt/widestring.cpp16
2 files changed, 11 insertions, 7 deletions
diff --git a/core/fxcrt/bytestring.cpp b/core/fxcrt/bytestring.cpp
index 3e4861ae60..2ab1379974 100644
--- a/core/fxcrt/bytestring.cpp
+++ b/core/fxcrt/bytestring.cpp
@@ -69,7 +69,9 @@ bool IsValidCodePage(uint16_t codepage) {
#endif
ByteString GetByteString(uint16_t codepage, const WideStringView& wstr) {
+#ifndef NDEBUG
ASSERT(IsValidCodePage(codepage));
+#endif
int src_len = wstr.GetLength();
int dest_len =
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index 158c67409b..8d47564e13 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -31,7 +31,7 @@ template struct std::hash<WideString>;
namespace {
-constexpr wchar_t kTrimChars[] = L"\x09\x0a\x0b\x0c\x0d\x20";
+constexpr wchar_t kWideTrimChars[] = L"\x09\x0a\x0b\x0c\x0d\x20";
const wchar_t* FX_wcsstr(const wchar_t* haystack,
int haystack_len,
@@ -273,7 +273,7 @@ Optional<WideString> TryVSWPrintf(size_t size,
}
#ifndef NDEBUG
-bool IsValidCodePage(uint16_t codepage) {
+bool IsValidWideCodePage(uint16_t codepage) {
switch (codepage) {
case FX_CODEPAGE_DefANSI:
case FX_CODEPAGE_ShiftJIS:
@@ -288,7 +288,9 @@ bool IsValidCodePage(uint16_t codepage) {
#endif
WideString GetWideString(uint16_t codepage, const ByteStringView& bstr) {
- ASSERT(IsValidCodePage(codepage));
+#ifndef NDEBUG
+ ASSERT(IsValidWideCodePage(codepage));
+#endif
int src_len = bstr.GetLength();
int dest_len = FXSYS_MultiByteToWideChar(
@@ -940,8 +942,8 @@ size_t WideString::WStringLength(const unsigned short* str) {
}
void WideString::Trim() {
- TrimRight(kTrimChars);
- TrimLeft(kTrimChars);
+ TrimRight(kWideTrimChars);
+ TrimLeft(kWideTrimChars);
}
void WideString::Trim(wchar_t target) {
@@ -956,7 +958,7 @@ void WideString::Trim(const WideStringView& targets) {
}
void WideString::TrimLeft() {
- TrimLeft(kTrimChars);
+ TrimLeft(kWideTrimChars);
}
void WideString::TrimLeft(wchar_t target) {
@@ -994,7 +996,7 @@ void WideString::TrimLeft(const WideStringView& targets) {
}
void WideString::TrimRight() {
- TrimRight(kTrimChars);
+ TrimRight(kWideTrimChars);
}
void WideString::TrimRight(wchar_t target) {