summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/ifwl_barcode.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-23 10:49:33 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-23 10:49:33 -0800
commit7c47e1d3172ce6f625b93be50aac2ebf86a45d0c (patch)
treebb7beae7637635cd0c631f015411a63fd2892486 /xfa/fwl/core/ifwl_barcode.cpp
parent7172b71a005c181e9f103ac0e19f6675bf3bc8e8 (diff)
downloadpdfium-7c47e1d3172ce6f625b93be50aac2ebf86a45d0c.tar.xz
Remove DataProvider from CFWL_WidgetPropertieschromium/2931chromium/2930
This CL removes the generic DataProvider code from CFWL_WidgetProperties and adds the specific providers to the two classes that require them. Review-Url: https://codereview.chromium.org/2527683002
Diffstat (limited to 'xfa/fwl/core/ifwl_barcode.cpp')
-rw-r--r--xfa/fwl/core/ifwl_barcode.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/xfa/fwl/core/ifwl_barcode.cpp b/xfa/fwl/core/ifwl_barcode.cpp
index d5ab17f66b..b4cd13a6c1 100644
--- a/xfa/fwl/core/ifwl_barcode.cpp
+++ b/xfa/fwl/core/ifwl_barcode.cpp
@@ -66,10 +66,6 @@ void IFWL_Barcode::GenerateBarcodeImageCache() {
m_dwStatus = 0;
CreateBarcodeEngine();
- IFWL_Barcode::DataProvider* pData =
- static_cast<IFWL_Barcode::DataProvider*>(m_pProperties->m_pDataProvider);
- if (!pData)
- return;
if (!m_pBarcodeEngine)
return;
@@ -98,33 +94,35 @@ void IFWL_Barcode::GenerateBarcodeImageCache() {
m_pBarcodeEngine->SetHeight(int32_t(GetRTClient().height));
m_pBarcodeEngine->SetWidth(int32_t(GetRTClient().width));
- uint32_t dwAttributeMask = pData->GetBarcodeAttributeMask();
+ uint32_t dwAttributeMask = m_pDataProvider->GetBarcodeAttributeMask();
if (dwAttributeMask & FWL_BCDATTRIBUTE_CHARENCODING)
- m_pBarcodeEngine->SetCharEncoding(pData->GetCharEncoding());
+ m_pBarcodeEngine->SetCharEncoding(m_pDataProvider->GetCharEncoding());
if (dwAttributeMask & FWL_BCDATTRIBUTE_MODULEHEIGHT)
- m_pBarcodeEngine->SetModuleHeight(pData->GetModuleHeight());
+ m_pBarcodeEngine->SetModuleHeight(m_pDataProvider->GetModuleHeight());
if (dwAttributeMask & FWL_BCDATTRIBUTE_MODULEWIDTH)
- m_pBarcodeEngine->SetModuleWidth(pData->GetModuleWidth());
+ m_pBarcodeEngine->SetModuleWidth(m_pDataProvider->GetModuleWidth());
if (dwAttributeMask & FWL_BCDATTRIBUTE_DATALENGTH)
- m_pBarcodeEngine->SetDataLength(pData->GetDataLength());
+ m_pBarcodeEngine->SetDataLength(m_pDataProvider->GetDataLength());
if (dwAttributeMask & FWL_BCDATTRIBUTE_CALCHECKSUM)
- m_pBarcodeEngine->SetCalChecksum(pData->GetCalChecksum());
+ m_pBarcodeEngine->SetCalChecksum(m_pDataProvider->GetCalChecksum());
if (dwAttributeMask & FWL_BCDATTRIBUTE_PRINTCHECKSUM)
- m_pBarcodeEngine->SetPrintChecksum(pData->GetPrintChecksum());
+ m_pBarcodeEngine->SetPrintChecksum(m_pDataProvider->GetPrintChecksum());
if (dwAttributeMask & FWL_BCDATTRIBUTE_TEXTLOCATION)
- m_pBarcodeEngine->SetTextLocation(pData->GetTextLocation());
+ m_pBarcodeEngine->SetTextLocation(m_pDataProvider->GetTextLocation());
if (dwAttributeMask & FWL_BCDATTRIBUTE_WIDENARROWRATIO)
- m_pBarcodeEngine->SetWideNarrowRatio(pData->GetWideNarrowRatio());
+ m_pBarcodeEngine->SetWideNarrowRatio(m_pDataProvider->GetWideNarrowRatio());
if (dwAttributeMask & FWL_BCDATTRIBUTE_STARTCHAR)
- m_pBarcodeEngine->SetStartChar(pData->GetStartChar());
+ m_pBarcodeEngine->SetStartChar(m_pDataProvider->GetStartChar());
if (dwAttributeMask & FWL_BCDATTRIBUTE_ENDCHAR)
- m_pBarcodeEngine->SetEndChar(pData->GetEndChar());
+ m_pBarcodeEngine->SetEndChar(m_pDataProvider->GetEndChar());
if (dwAttributeMask & FWL_BCDATTRIBUTE_VERSION)
- m_pBarcodeEngine->SetVersion(pData->GetVersion());
- if (dwAttributeMask & FWL_BCDATTRIBUTE_ECLEVEL)
- m_pBarcodeEngine->SetErrorCorrectionLevel(pData->GetErrorCorrectionLevel());
+ m_pBarcodeEngine->SetVersion(m_pDataProvider->GetVersion());
+ if (dwAttributeMask & FWL_BCDATTRIBUTE_ECLEVEL) {
+ m_pBarcodeEngine->SetErrorCorrectionLevel(
+ m_pDataProvider->GetErrorCorrectionLevel());
+ }
if (dwAttributeMask & FWL_BCDATTRIBUTE_TRUNCATED)
- m_pBarcodeEngine->SetTruncated(pData->GetTruncated());
+ m_pBarcodeEngine->SetTruncated(m_pDataProvider->GetTruncated());
int32_t errorCode = 0;
m_dwStatus = m_pBarcodeEngine->Encode(wsText.AsStringC(), true, errorCode)