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

Unified Diff: core/fxcrt/fx_basic_wstring.cpp

Issue 1861183002: Make CFX_WideString::FromUTF8() take a CFX_ByteStringC argument. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase, combine delcs with initialization. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/fxcrt/include/fx_string.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic_wstring.cpp
diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp
index cd60036acd521319a6e89057074a72cdb11fab97..627573fa7dd70292c8e9c4dcbecb5f556bc5a6b6 100644
--- a/core/fxcrt/fx_basic_wstring.cpp
+++ b/core/fxcrt/fx_basic_wstring.cpp
@@ -372,13 +372,12 @@ CFX_WideString CFX_WideString::FromCodePage(const CFX_ByteString& str,
}
// static
-CFX_WideString CFX_WideString::FromUTF8(const char* str, FX_STRSIZE len) {
- if (!str || 0 == len) {
+CFX_WideString CFX_WideString::FromUTF8(const CFX_ByteStringC& str) {
+ if (str.IsEmpty())
return CFX_WideString();
- }
CFX_UTF8Decoder decoder;
- for (FX_STRSIZE i = 0; i < len; i++) {
+ for (FX_STRSIZE i = 0; i < str.GetLength(); i++) {
decoder.Input(str[i]);
}
return decoder.GetResult();
« no previous file with comments | « no previous file | core/fxcrt/include/fx_string.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698