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

Unified Diff: core/fpdftext/unicodenormalization.cpp

Issue 1796303002: Tidy fpdftext/ directory (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 9 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/fpdftext/unicodenormalization.h ('k') | pdfium.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdftext/unicodenormalization.cpp
diff --git a/core/fpdftext/unicodenormalization.cpp b/core/fpdftext/unicodenormalization.cpp
index 6ede1365c41ea688db9fb9c3d05be5c2dbf29eca..b8e8eb98d3a4e7161c616c4ade66f8f36b2fae0e 100644
--- a/core/fpdftext/unicodenormalization.cpp
+++ b/core/fpdftext/unicodenormalization.cpp
@@ -4,13 +4,19 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "core/fpdftext/unicodenormalization.h"
+
#include "core/fpdftext/unicodenormalizationdata.h"
#include "core/include/fxcrt/fx_string.h"
+namespace {
+
const FX_WCHAR* const g_UnicodeData_Normalization_Maps[5] = {
nullptr, g_UnicodeData_Normalization_Map1, g_UnicodeData_Normalization_Map2,
g_UnicodeData_Normalization_Map3, g_UnicodeData_Normalization_Map4};
+} // namespace
+
FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_WCHAR* pDst) {
wch = wch & 0xFFFF;
FX_WCHAR wFind = g_UnicodeData_Normalization[wch];
@@ -42,27 +48,3 @@ FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_WCHAR* pDst) {
}
return (FX_STRSIZE)wFind;
}
-FX_STRSIZE FX_WideString_GetNormalization(const CFX_WideStringC& wsSrc,
- FX_WCHAR* pDst) {
- FX_STRSIZE nCount = 0;
- for (FX_STRSIZE len = 0; len < wsSrc.GetLength(); len++) {
- FX_WCHAR wch = wsSrc.GetAt(len);
- if (pDst) {
- nCount += FX_Unicode_GetNormalization(wch, pDst + nCount);
- } else {
- nCount += FX_Unicode_GetNormalization(wch, pDst);
- }
- }
- return nCount;
-}
-FX_STRSIZE FX_WideString_GetNormalization(const CFX_WideStringC& wsSrc,
- CFX_WideString& wsDst) {
- FX_STRSIZE nLen = FX_WideString_GetNormalization(wsSrc, (FX_WCHAR*)NULL);
- if (!nLen) {
- return 0;
- }
- FX_WCHAR* pBuf = wsDst.GetBuffer(nLen);
- FX_WideString_GetNormalization(wsSrc, pBuf);
- wsDst.ReleaseBuffer(nLen);
- return nLen;
-}
« no previous file with comments | « core/fpdftext/unicodenormalization.h ('k') | pdfium.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698