diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-18 14:23:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-18 18:40:16 +0000 |
commit | 275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch) | |
tree | 2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fxbarcode/oned/BC_OnedEAN13Writer.cpp | |
parent | 450fbeaaabf1ab340c1018de2e58f1950657517e (diff) | |
download | pdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz |
Convert string class names
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fxbarcode/oned/BC_OnedEAN13Writer.cpp')
-rw-r--r-- | fxbarcode/oned/BC_OnedEAN13Writer.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp index 2d9759b9eb..6de7c2cb20 100644 --- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -56,14 +56,12 @@ CBC_OnedEAN13Writer::CBC_OnedEAN13Writer() { } CBC_OnedEAN13Writer::~CBC_OnedEAN13Writer() {} -bool CBC_OnedEAN13Writer::CheckContentValidity( - const CFX_WideStringC& contents) { +bool CBC_OnedEAN13Writer::CheckContentValidity(const WideStringView& contents) { return std::all_of(contents.begin(), contents.end(), std::iswdigit); } -CFX_WideString CBC_OnedEAN13Writer::FilterContents( - const CFX_WideStringC& contents) { - CFX_WideString filtercontents; +WideString CBC_OnedEAN13Writer::FilterContents(const WideStringView& contents) { + WideString filtercontents; wchar_t ch; for (FX_STRSIZE i = 0; i < contents.GetLength(); i++) { ch = contents[i]; @@ -78,11 +76,11 @@ CFX_WideString CBC_OnedEAN13Writer::FilterContents( return filtercontents; } -int32_t CBC_OnedEAN13Writer::CalcChecksum(const CFX_ByteString& contents) { +int32_t CBC_OnedEAN13Writer::CalcChecksum(const ByteString& contents) { return EANCalcChecksum(contents); } -uint8_t* CBC_OnedEAN13Writer::EncodeWithHint(const CFX_ByteString& contents, +uint8_t* CBC_OnedEAN13Writer::EncodeWithHint(const ByteString& contents, BCFORMAT format, int32_t& outWidth, int32_t& outHeight, @@ -93,7 +91,7 @@ uint8_t* CBC_OnedEAN13Writer::EncodeWithHint(const CFX_ByteString& contents, hints); } -uint8_t* CBC_OnedEAN13Writer::EncodeImpl(const CFX_ByteString& contents, +uint8_t* CBC_OnedEAN13Writer::EncodeImpl(const ByteString& contents, int32_t& outLength) { if (contents.GetLength() != 13) return nullptr; @@ -136,7 +134,7 @@ uint8_t* CBC_OnedEAN13Writer::EncodeImpl(const CFX_ByteString& contents, return result.release(); } -bool CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, +bool CBC_OnedEAN13Writer::ShowChars(const WideStringView& contents, CFX_RenderDevice* device, const CFX_Matrix* matrix, int32_t barWidth, @@ -146,12 +144,12 @@ bool CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, int32_t leftPadding = 7 * multiple; int32_t leftPosition = 3 * multiple + leftPadding; - CFX_ByteString str = FX_UTF8Encode(contents); + ByteString str = FX_UTF8Encode(contents); int32_t iLen = str.GetLength(); std::vector<FXTEXT_CHARPOS> charpos(iLen); int32_t iFontSize = (int32_t)fabs(m_fFontSize); int32_t iTextHeight = iFontSize + 1; - CFX_ByteString tempStr = str.Mid(1, 6); + ByteString tempStr = str.Mid(1, 6); int32_t strWidth = multiple * 42; CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); |