Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Unified Diff: xfa/fwl/basewidget/fwl_barcodeimp.cpp

Issue 1890443002: Remove IFX_Barcode. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/basewidget/fwl_barcodeimp.h ('k') | xfa/fwl/basewidget/fxmath_barcodeimp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/basewidget/fwl_barcodeimp.cpp
diff --git a/xfa/fwl/basewidget/fwl_barcodeimp.cpp b/xfa/fwl/basewidget/fwl_barcodeimp.cpp
index 0ab2e1ed74aa486358829da701f63acb9b702caf..771d7b9833d77ccbd75016b3b98b769490014914 100644
--- a/xfa/fwl/basewidget/fwl_barcodeimp.cpp
+++ b/xfa/fwl/basewidget/fwl_barcodeimp.cpp
@@ -7,6 +7,7 @@
#include "xfa/fwl/basewidget/fwl_barcodeimp.h"
#include "xfa/fwl/basewidget/fwl_editimp.h"
+#include "xfa/fwl/basewidget/fxmath_barcodeimp.h"
#include "xfa/fwl/core/cfwl_themepart.h"
#include "xfa/fwl/core/fwl_noteimp.h"
#include "xfa/fwl/core/fwl_targetimp.h"
@@ -174,11 +175,18 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() {
? XFA_BCS_EncodeSuccess
: 0;
}
+
void CFWL_BarcodeImp::CreateBarcodeEngine() {
- if ((m_pBarcodeEngine == NULL) && (m_type != BC_UNKNOWN)) {
- m_pBarcodeEngine = FX_Barcode_Create(m_type);
+ if (m_pBarcodeEngine || m_type == BC_UNKNOWN)
+ return;
+
+ m_pBarcodeEngine = new CFX_Barcode;
+ if (!m_pBarcodeEngine->Create(m_type)) {
+ m_pBarcodeEngine->Release();
+ m_pBarcodeEngine = nullptr;
}
}
+
void CFWL_BarcodeImp::ReleaseBarcodeEngine() {
if (m_pBarcodeEngine) {
m_pBarcodeEngine->Release();
« no previous file with comments | « xfa/fwl/basewidget/fwl_barcodeimp.h ('k') | xfa/fwl/basewidget/fxmath_barcodeimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698