| 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/core/ifwl_picturebox.h" | 7 #include "xfa/fwl/core/ifwl_picturebox.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 return FWL_Type::PictureBox; | 28 return FWL_Type::PictureBox; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void IFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { | 31 void IFWL_PictureBox::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) { |
| 32 if (!bAutoSize) { | 32 if (!bAutoSize) { |
| 33 rect = m_pProperties->m_rtWidget; | 33 rect = m_pProperties->m_rtWidget; |
| 34 return; | 34 return; |
| 35 } | 35 } |
| 36 | 36 |
| 37 rect.Set(0, 0, 0, 0); | 37 rect.Set(0, 0, 0, 0); |
| 38 if (!m_pProperties->m_pDataProvider) | 38 |
| 39 return; | |
| 40 IFWL_Widget::GetWidgetRect(rect, true); | 39 IFWL_Widget::GetWidgetRect(rect, true); |
| 41 } | 40 } |
| 42 | 41 |
| 43 void IFWL_PictureBox::Update() { | 42 void IFWL_PictureBox::Update() { |
| 44 if (IsLocked()) | 43 if (IsLocked()) |
| 45 return; | 44 return; |
| 46 if (!m_pProperties->m_pThemeProvider) | 45 if (!m_pProperties->m_pThemeProvider) |
| 47 m_pProperties->m_pThemeProvider = GetAvailableTheme(); | 46 m_pProperties->m_pThemeProvider = GetAvailableTheme(); |
| 48 | 47 |
| 49 GetClientRect(m_rtClient); | 48 GetClientRect(m_rtClient); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 60 if (HasBorder()) | 59 if (HasBorder()) |
| 61 DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); | 60 DrawBorder(pGraphics, CFWL_Part::Border, pTheme, pMatrix); |
| 62 if (HasEdge()) | 61 if (HasEdge()) |
| 63 DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); | 62 DrawEdge(pGraphics, CFWL_Part::Edge, pTheme, pMatrix); |
| 64 } | 63 } |
| 65 | 64 |
| 66 void IFWL_PictureBox::OnDrawWidget(CFX_Graphics* pGraphics, | 65 void IFWL_PictureBox::OnDrawWidget(CFX_Graphics* pGraphics, |
| 67 const CFX_Matrix* pMatrix) { | 66 const CFX_Matrix* pMatrix) { |
| 68 DrawWidget(pGraphics, pMatrix); | 67 DrawWidget(pGraphics, pMatrix); |
| 69 } | 68 } |
| OLD | NEW |