| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/cfwl_barcode.h" | 7 #include "xfa/fwl/cfwl_barcode.h" |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 m_dwStatus = 0; | 163 m_dwStatus = 0; |
| 164 CreateBarcodeEngine(); | 164 CreateBarcodeEngine(); |
| 165 if (!m_pBarcodeEngine) | 165 if (!m_pBarcodeEngine) |
| 166 return; | 166 return; |
| 167 | 167 |
| 168 IFWL_ThemeProvider* pTheme = GetAvailableTheme(); | 168 IFWL_ThemeProvider* pTheme = GetAvailableTheme(); |
| 169 if (pTheme) { | 169 if (pTheme) { |
| 170 CFWL_ThemePart part; | 170 CFWL_ThemePart part; |
| 171 part.m_pWidget = this; | 171 part.m_pWidget = this; |
| 172 | 172 if (CFX_RetainPtr<CFGAS_GEFont> pFont = pTheme->GetFont(&part)) { |
| 173 if (CFGAS_GEFont* pFont = pTheme->GetFont(&part)) { | |
| 174 if (CFX_Font* pCXFont = pFont->GetDevFont()) | 173 if (CFX_Font* pCXFont = pFont->GetDevFont()) |
| 175 m_pBarcodeEngine->SetFont(pCXFont); | 174 m_pBarcodeEngine->SetFont(pCXFont); |
| 176 } | 175 } |
| 177 m_pBarcodeEngine->SetFontSize(pTheme->GetFontSize(&part)); | 176 m_pBarcodeEngine->SetFontSize(pTheme->GetFontSize(&part)); |
| 178 m_pBarcodeEngine->SetFontColor(pTheme->GetTextColor(&part)); | 177 m_pBarcodeEngine->SetFontColor(pTheme->GetTextColor(&part)); |
| 179 } else { | 178 } else { |
| 180 m_pBarcodeEngine->SetFontSize(FWLTHEME_CAPACITY_FontSize); | 179 m_pBarcodeEngine->SetFontSize(FWLTHEME_CAPACITY_FontSize); |
| 181 } | 180 } |
| 182 | 181 |
| 183 m_pBarcodeEngine->SetHeight(int32_t(GetRTClient().height)); | 182 m_pBarcodeEngine->SetHeight(int32_t(GetRTClient().height)); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 215 } |
| 217 | 216 |
| 218 void CFWL_Barcode::CreateBarcodeEngine() { | 217 void CFWL_Barcode::CreateBarcodeEngine() { |
| 219 if (m_pBarcodeEngine || m_type == BC_UNKNOWN) | 218 if (m_pBarcodeEngine || m_type == BC_UNKNOWN) |
| 220 return; | 219 return; |
| 221 | 220 |
| 222 std::unique_ptr<CFX_Barcode> pBarcode(new CFX_Barcode); | 221 std::unique_ptr<CFX_Barcode> pBarcode(new CFX_Barcode); |
| 223 if (pBarcode->Create(m_type)) | 222 if (pBarcode->Create(m_type)) |
| 224 m_pBarcodeEngine = std::move(pBarcode); | 223 m_pBarcodeEngine = std::move(pBarcode); |
| 225 } | 224 } |
| OLD | NEW |