diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-03-15 09:10:05 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-03-15 09:10:05 -0700 |
commit | 6d6f1f4078c745e6ba7560a71c5ff65d1aa7d963 (patch) | |
tree | 0707f7ea1a8e4742117645677dc056697e6d4727 /core/fpdftext/unicodenormalization.cpp | |
parent | f89acbcf5c652dc2eb3509568b3a5a57cb4c4c5e (diff) | |
download | pdfium-6d6f1f4078c745e6ba7560a71c5ff65d1aa7d963.tar.xz |
Tidy fpdftext/ directory
Make .h/.cpp filenames match.
Add header for unicodenormalization.cpp
Remove dead code.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1796303002 .
Diffstat (limited to 'core/fpdftext/unicodenormalization.cpp')
-rw-r--r-- | core/fpdftext/unicodenormalization.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/core/fpdftext/unicodenormalization.cpp b/core/fpdftext/unicodenormalization.cpp index 6ede1365c4..b8e8eb98d3 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; -} |