summaryrefslogtreecommitdiff
path: root/fxbarcode/cbc_onecode.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-04-20 15:58:56 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-21 00:54:04 +0000
commit1badb85e5c3a4b4cd42ca1a2b223d6b3bc67cc4a (patch)
tree55bf63857592387531797b0f08e0a6effc0f40c9 /fxbarcode/cbc_onecode.cpp
parentaeee187c927c07f47a9e5886a417dcc58badefb6 (diff)
downloadpdfium-1badb85e5c3a4b4cd42ca1a2b223d6b3bc67cc4a.tar.xz
Change more fxbarcode to use return values.
Change-Id: Idcc05fb8c5a1448f552b4db5ae131ad82aef4d59 Reviewed-on: https://pdfium-review.googlesource.com/4258 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fxbarcode/cbc_onecode.cpp')
-rw-r--r--fxbarcode/cbc_onecode.cpp36
1 files changed, 13 insertions, 23 deletions
diff --git a/fxbarcode/cbc_onecode.cpp b/fxbarcode/cbc_onecode.cpp
index 1b4db0a170..ec7033a1f1 100644
--- a/fxbarcode/cbc_onecode.cpp
+++ b/fxbarcode/cbc_onecode.cpp
@@ -28,51 +28,41 @@ CBC_OneCode::CBC_OneCode(CBC_Writer* pWriter) : CBC_CodeBase(pWriter) {}
CBC_OneCode::~CBC_OneCode() {}
bool CBC_OneCode::CheckContentValidity(const CFX_WideStringC& contents) {
- return m_pBCWriter &&
- static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
- ->CheckContentValidity(contents);
+ return GetOneDimWriter()->CheckContentValidity(contents);
}
CFX_WideString CBC_OneCode::FilterContents(const CFX_WideStringC& contents) {
- if (!m_pBCWriter)
- return CFX_WideString();
- return static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
- ->FilterContents(contents);
+ return GetOneDimWriter()->FilterContents(contents);
}
void CBC_OneCode::SetPrintChecksum(bool checksum) {
- if (m_pBCWriter)
- static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
- ->SetPrintChecksum(checksum);
+ GetOneDimWriter()->SetPrintChecksum(checksum);
}
void CBC_OneCode::SetDataLength(int32_t length) {
- if (m_pBCWriter)
- static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetDataLength(length);
+ GetOneDimWriter()->SetDataLength(length);
}
void CBC_OneCode::SetCalChecksum(bool calc) {
- if (m_pBCWriter)
- static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetCalcChecksum(calc);
+ GetOneDimWriter()->SetCalcChecksum(calc);
}
bool CBC_OneCode::SetFont(CFX_Font* cFont) {
- if (m_pBCWriter)
- return static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetFont(cFont);
- return false;
+ return GetOneDimWriter()->SetFont(cFont);
}
void CBC_OneCode::SetFontSize(float size) {
- if (m_pBCWriter)
- static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetFontSize(size);
+ GetOneDimWriter()->SetFontSize(size);
}
void CBC_OneCode::SetFontStyle(int32_t style) {
- if (m_pBCWriter)
- static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetFontStyle(style);
+ GetOneDimWriter()->SetFontStyle(style);
}
void CBC_OneCode::SetFontColor(FX_ARGB color) {
- if (m_pBCWriter)
- static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetFontColor(color);
+ GetOneDimWriter()->SetFontColor(color);
+}
+
+CBC_OneDimWriter* CBC_OneCode::GetOneDimWriter() {
+ return static_cast<CBC_OneDimWriter*>(m_pBCWriter.get());
}