diff options
Diffstat (limited to 'fxbarcode/cbc_ean8.cpp')
-rw-r--r-- | fxbarcode/cbc_ean8.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fxbarcode/cbc_ean8.cpp b/fxbarcode/cbc_ean8.cpp index 796f3a526b..ce071af2ce 100644 --- a/fxbarcode/cbc_ean8.cpp +++ b/fxbarcode/cbc_ean8.cpp @@ -55,16 +55,13 @@ bool CBC_EAN8::Encode(const WideStringView& contents) { BCFORMAT format = BCFORMAT_EAN_8; int32_t outWidth = 0; int32_t outHeight = 0; - WideString encodeContents = Preprocess(contents); - ByteString byteString = encodeContents.UTF8Encode(); - m_renderContents = encodeContents; + m_renderContents = Preprocess(contents); + ByteString byteString = m_renderContents.UTF8Encode(); auto* pWriter = GetOnedEAN8Writer(); std::unique_ptr<uint8_t, FxFreeDeleter> data( pWriter->Encode(byteString, format, outWidth, outHeight)); - if (!data) - return false; - return pWriter->RenderResult(encodeContents.AsStringView(), data.get(), - outWidth); + return data && pWriter->RenderResult(m_renderContents.AsStringView(), + data.get(), outWidth); } bool CBC_EAN8::RenderDevice(CFX_RenderDevice* device, |