summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-05 12:22:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-05 12:22:15 -0700
commitfc58ad18b7ab32e7b0bb3959b07dbe7538a7cebd (patch)
tree8662b886d373b149fbdd6f5db9570c233cb23ce7 /xfa/fxbarcode
parentc7a7349cf316af37d4ad4b71c5742159deccbf33 (diff)
downloadpdfium-fc58ad18b7ab32e7b0bb3959b07dbe7538a7cebd.tar.xz
Make down-conversion explicit from CFX_Widetring to CFX_WideStringC.
Companion to https://codereview.chromium.org/1853233002 BUG= Review URL: https://codereview.chromium.org/1857073002
Diffstat (limited to 'xfa/fxbarcode')
-rw-r--r--xfa/fxbarcode/cbc_codabar.cpp13
-rw-r--r--xfa/fxbarcode/cbc_code128.cpp11
-rw-r--r--xfa/fxbarcode/cbc_code39.cpp17
-rw-r--r--xfa/fxbarcode/cbc_ean13.cpp7
-rw-r--r--xfa/fxbarcode/cbc_ean8.cpp7
-rw-r--r--xfa/fxbarcode/cbc_upca.cpp7
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp4
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp3
8 files changed, 40 insertions, 29 deletions
diff --git a/xfa/fxbarcode/cbc_codabar.cpp b/xfa/fxbarcode/cbc_codabar.cpp
index a7310ba1fc..d038904095 100644
--- a/xfa/fxbarcode/cbc_codabar.cpp
+++ b/xfa/fxbarcode/cbc_codabar.cpp
@@ -77,7 +77,8 @@ FX_BOOL CBC_Codabar::Encode(const CFX_WideStringC& contents,
->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderResult(filtercontents, data, outWidth, isDevice, e);
+ ->RenderResult(filtercontents.AsWideStringC(), data, outWidth, isDevice,
+ e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
@@ -87,18 +88,20 @@ FX_BOOL CBC_Codabar::RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matirx,
int32_t& e) {
CFX_WideString renderCon =
- ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents);
+ ((CBC_OnedCodaBarWriter*)m_pBCWriter)
+ ->encodedContents(m_renderContents.AsWideStringC());
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderDeviceResult(device, matirx, renderCon, e);
+ ->RenderDeviceResult(device, matirx, renderCon.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
FX_BOOL CBC_Codabar::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
CFX_WideString renderCon =
- ((CBC_OnedCodaBarWriter*)m_pBCWriter)->encodedContents(m_renderContents);
+ ((CBC_OnedCodaBarWriter*)m_pBCWriter)
+ ->encodedContents(m_renderContents.AsWideStringC());
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderBitmapResult(pOutBitmap, renderCon, e);
+ ->RenderBitmapResult(pOutBitmap, renderCon.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
diff --git a/xfa/fxbarcode/cbc_code128.cpp b/xfa/fxbarcode/cbc_code128.cpp
index e585de302c..2f7be93140 100644
--- a/xfa/fxbarcode/cbc_code128.cpp
+++ b/xfa/fxbarcode/cbc_code128.cpp
@@ -58,15 +58,16 @@ FX_BOOL CBC_Code128::Encode(const CFX_WideStringC& contents,
((CBC_OnedCode128Writer*)m_pBCWriter)->GetType() == BC_CODE128_C) {
content += '0';
}
- CFX_WideString encodeContents =
- ((CBC_OnedCode128Writer*)m_pBCWriter)->FilterContents(content);
+ CFX_WideString encodeContents = ((CBC_OnedCode128Writer*)m_pBCWriter)
+ ->FilterContents(content.AsWideStringC());
m_renderContents = encodeContents;
CFX_ByteString byteString = encodeContents.UTF8Encode();
uint8_t* data = static_cast<CBC_OnedCode128Writer*>(m_pBCWriter)
->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderResult(encodeContents, data, outWidth, isDevice, e);
+ ->RenderResult(encodeContents.AsWideStringC(), data, outWidth, isDevice,
+ e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
@@ -76,14 +77,14 @@ FX_BOOL CBC_Code128::RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matirx,
int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderDeviceResult(device, matirx, m_renderContents, e);
+ ->RenderDeviceResult(device, matirx, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
FX_BOOL CBC_Code128::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderBitmapResult(pOutBitmap, m_renderContents, e);
+ ->RenderBitmapResult(pOutBitmap, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
diff --git a/xfa/fxbarcode/cbc_code39.cpp b/xfa/fxbarcode/cbc_code39.cpp
index a0e3d17fc1..a590f7e39a 100644
--- a/xfa/fxbarcode/cbc_code39.cpp
+++ b/xfa/fxbarcode/cbc_code39.cpp
@@ -68,7 +68,8 @@ FX_BOOL CBC_Code39::Encode(const CFX_WideStringC& contents,
->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderResult(renderContents, data, outWidth, isDevice, e);
+ ->RenderResult(renderContents.AsWideStringC(), data, outWidth, isDevice,
+ e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
@@ -77,19 +78,21 @@ FX_BOOL CBC_Code39::Encode(const CFX_WideStringC& contents,
FX_BOOL CBC_Code39::RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matirx,
int32_t& e) {
- CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)
- ->encodedContents(m_renderContents, e);
+ CFX_WideString renderCon =
+ ((CBC_OnedCode39Writer*)m_pBCWriter)
+ ->encodedContents(m_renderContents.AsWideStringC(), e);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderDeviceResult(device, matirx, renderCon, e);
+ ->RenderDeviceResult(device, matirx, renderCon.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
FX_BOOL CBC_Code39::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
- CFX_WideString renderCon = ((CBC_OnedCode39Writer*)m_pBCWriter)
- ->encodedContents(m_renderContents, e);
+ CFX_WideString renderCon =
+ ((CBC_OnedCode39Writer*)m_pBCWriter)
+ ->encodedContents(m_renderContents.AsWideStringC(), e);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderBitmapResult(pOutBitmap, renderCon, e);
+ ->RenderBitmapResult(pOutBitmap, renderCon.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
diff --git a/xfa/fxbarcode/cbc_ean13.cpp b/xfa/fxbarcode/cbc_ean13.cpp
index e764122e3c..149c5a6a63 100644
--- a/xfa/fxbarcode/cbc_ean13.cpp
+++ b/xfa/fxbarcode/cbc_ean13.cpp
@@ -74,7 +74,8 @@ FX_BOOL CBC_EAN13::Encode(const CFX_WideStringC& contents,
->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderResult(encodeContents, data, outWidth, isDevice, e);
+ ->RenderResult(encodeContents.AsWideStringC(), data, outWidth, isDevice,
+ e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
@@ -84,14 +85,14 @@ FX_BOOL CBC_EAN13::RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matirx,
int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderDeviceResult(device, matirx, m_renderContents, e);
+ ->RenderDeviceResult(device, matirx, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
FX_BOOL CBC_EAN13::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderBitmapResult(pOutBitmap, m_renderContents, e);
+ ->RenderBitmapResult(pOutBitmap, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
diff --git a/xfa/fxbarcode/cbc_ean8.cpp b/xfa/fxbarcode/cbc_ean8.cpp
index bc983b8c47..12a821385b 100644
--- a/xfa/fxbarcode/cbc_ean8.cpp
+++ b/xfa/fxbarcode/cbc_ean8.cpp
@@ -73,7 +73,8 @@ FX_BOOL CBC_EAN8::Encode(const CFX_WideStringC& contents,
->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderResult(encodeContents, data, outWidth, isDevice, e);
+ ->RenderResult(encodeContents.AsWideStringC(), data, outWidth, isDevice,
+ e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
@@ -83,14 +84,14 @@ FX_BOOL CBC_EAN8::RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matirx,
int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderDeviceResult(device, matirx, m_renderContents, e);
+ ->RenderDeviceResult(device, matirx, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
FX_BOOL CBC_EAN8::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderBitmapResult(pOutBitmap, m_renderContents, e);
+ ->RenderBitmapResult(pOutBitmap, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
diff --git a/xfa/fxbarcode/cbc_upca.cpp b/xfa/fxbarcode/cbc_upca.cpp
index 220b8fa2d8..79aa922e46 100644
--- a/xfa/fxbarcode/cbc_upca.cpp
+++ b/xfa/fxbarcode/cbc_upca.cpp
@@ -76,7 +76,8 @@ FX_BOOL CBC_UPCA::Encode(const CFX_WideStringC& contents,
->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderResult(encodeContents, data, outWidth, isDevice, e);
+ ->RenderResult(encodeContents.AsWideStringC(), data, outWidth, isDevice,
+ e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
@@ -86,14 +87,14 @@ FX_BOOL CBC_UPCA::RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matirx,
int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderDeviceResult(device, matirx, m_renderContents, e);
+ ->RenderDeviceResult(device, matirx, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
FX_BOOL CBC_UPCA::RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) {
((CBC_OneDimWriter*)m_pBCWriter)
- ->RenderBitmapResult(pOutBitmap, m_renderContents, e);
+ ->RenderBitmapResult(pOutBitmap, m_renderContents.AsWideStringC(), e);
BC_EXCEPTION_CHECK_ReturnValue(e, FALSE);
return TRUE;
}
diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
index 81f0339aa8..3fbeb1c318 100644
--- a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
@@ -226,6 +226,6 @@ void CBC_OnedCodaBarWriter::RenderResult(const CFX_WideStringC& contents,
int32_t codeLength,
FX_BOOL isDevice,
int32_t& e) {
- CBC_OneDimWriter::RenderResult(encodedContents(contents), code, codeLength,
- isDevice, e);
+ CBC_OneDimWriter::RenderResult(encodedContents(contents).AsWideStringC(),
+ code, codeLength, isDevice, e);
}
diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
index 31e75ca7df..0a69f04a4f 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
@@ -360,5 +360,6 @@ void CBC_OnedCode39Writer::RenderResult(const CFX_WideStringC& contents,
int32_t& e) {
CFX_WideString encodedCon = encodedContents(contents, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- CBC_OneDimWriter::RenderResult(encodedCon, code, codeLength, isDevice, e);
+ CBC_OneDimWriter::RenderResult(encodedCon.AsWideStringC(), code, codeLength,
+ isDevice, e);
}