summaryrefslogtreecommitdiff
path: root/fxbarcode/cbc_ean13.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode/cbc_ean13.cpp')
-rw-r--r--fxbarcode/cbc_ean13.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/fxbarcode/cbc_ean13.cpp b/fxbarcode/cbc_ean13.cpp
index 16725323f4..a111fdbfb6 100644
--- a/fxbarcode/cbc_ean13.cpp
+++ b/fxbarcode/cbc_ean13.cpp
@@ -57,16 +57,13 @@ bool CBC_EAN13::Encode(const WideStringView& contents) {
BCFORMAT format = BCFORMAT_EAN_13;
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 = GetOnedEAN13Writer();
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_EAN13::RenderDevice(CFX_RenderDevice* device,