summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-01-31 13:02:10 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-01-31 22:52:16 +0000
commitc8017b2581b7ade6b05ba086eb7221465414173f (patch)
treef606dadefe9d6e27e7782bd9c33e2498810a7b2f /xfa/fxbarcode/oned/BC_OneDimWriter.cpp
parent00d4064e5414fc0845e354b50c7f1a8323449268 (diff)
downloadpdfium-c8017b2581b7ade6b05ba086eb7221465414173f.tar.xz
Remove BC_EXCEPTION_CHECK macroschromium/2999
These obfuscate control flow and save very few lines. Mechanical change (mostly), sed + clang-format and adding a few missing semicolons. Change-Id: If8ae06c23edea8c455c79eab589fee5142dc3409 Reviewed-on: https://pdfium-review.googlesource.com/2472 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxbarcode/oned/BC_OneDimWriter.cpp')
-rw-r--r--xfa/fxbarcode/oned/BC_OneDimWriter.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
index 24d257a630..49b1847d9c 100644
--- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -103,7 +103,8 @@ uint8_t* CBC_OneDimWriter::Encode(const CFX_ByteString& contents,
} else {
ret = Encode(contents, outWidth, e);
}
- BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
+ if (e != BCExceptionNO)
+ return nullptr;
return ret;
}
@@ -113,7 +114,8 @@ uint8_t* CBC_OneDimWriter::Encode(const CFX_ByteString& contents,
int32_t& outHeight,
int32_t& e) {
uint8_t* ret = Encode(contents, format, outWidth, outHeight, 0, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
+ if (e != BCExceptionNO)
+ return nullptr;
return ret;
}
@@ -319,7 +321,8 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
const CFX_WideStringC& contents,
int32_t& e) {
if (!m_output)
- BC_EXCEPTION_CHECK_ReturnVoid(e);
+ if (e != BCExceptionNO)
+ return;
pOutBitmap = CreateDIBitmap(m_output->GetWidth(), m_output->GetHeight());
pOutBitmap->Clear(m_backgroundColor);
@@ -342,7 +345,8 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
if (m_locTextLoc != BC_TEXT_LOC_NONE && i < contents.GetLength()) {
ShowChars(contents, pOutBitmap, nullptr, nullptr, m_barWidth, m_multiple,
e);
- BC_EXCEPTION_CHECK_ReturnVoid(e);
+ if (e != BCExceptionNO)
+ return;
}
std::unique_ptr<CFX_DIBitmap> pStretchBitmap =
pOutBitmap->StretchTo(m_Width, m_Height);
@@ -355,7 +359,8 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
const CFX_WideStringC& contents,
int32_t& e) {
if (!m_output)
- BC_EXCEPTION_CHECK_ReturnVoid(e);
+ if (e != BCExceptionNO)
+ return;
CFX_GraphStateData stateData;
CFX_PathData path;
@@ -382,7 +387,8 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
}
if (m_locTextLoc != BC_TEXT_LOC_NONE && i < contents.GetLength()) {
ShowChars(contents, nullptr, device, matrix, m_barWidth, m_multiple, e);
- BC_EXCEPTION_CHECK_ReturnVoid(e);
+ if (e != BCExceptionNO)
+ return;
}
}
@@ -392,7 +398,8 @@ void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
bool isDevice,
int32_t& e) {
if (codeLength < 1) {
- BC_EXCEPTION_CHECK_ReturnVoid(e);
+ if (e != BCExceptionNO)
+ return;
}
if (m_ModuleHeight < 20.0) {
m_ModuleHeight = 20;
@@ -456,7 +463,8 @@ void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents,
break;
}
m_output->SetRegion(outputX, 0, m_multiple, outputHeight, e);
- BC_EXCEPTION_CHECK_ReturnVoid(e);
+ if (e != BCExceptionNO)
+ return;
}
outputX += m_multiple;
}