| 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/fxfa/include/xfa_ffwidget.h" | 7 #include "xfa/fxfa/include/xfa_ffwidget.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 const CFX_RectF& rtBorder, | 146 const CFX_RectF& rtBorder, |
| 147 CFX_Matrix* pMatrix, | 147 CFX_Matrix* pMatrix, |
| 148 uint32_t dwFlags) { | 148 uint32_t dwFlags) { |
| 149 XFA_DrawBox(box, pGS, rtBorder, pMatrix, dwFlags); | 149 XFA_DrawBox(box, pGS, rtBorder, pMatrix, dwFlags); |
| 150 } | 150 } |
| 151 void CXFA_FFWidget::InvalidateWidget(const CFX_RectF* pRect) { | 151 void CXFA_FFWidget::InvalidateWidget(const CFX_RectF* pRect) { |
| 152 if (!pRect) { | 152 if (!pRect) { |
| 153 CFX_RectF rtWidget; | 153 CFX_RectF rtWidget; |
| 154 GetBBox(rtWidget, XFA_WidgetStatus_Focused); | 154 GetBBox(rtWidget, XFA_WidgetStatus_Focused); |
| 155 rtWidget.Inflate(2, 2); | 155 rtWidget.Inflate(2, 2); |
| 156 GetDoc()->GetDocProvider()->InvalidateRect(m_pPageView, rtWidget, | 156 GetDoc()->GetDocEnvironment()->InvalidateRect(m_pPageView, rtWidget, |
| 157 XFA_INVALIDATE_CurrentPage); | 157 XFA_INVALIDATE_CurrentPage); |
| 158 } else { | 158 } else { |
| 159 GetDoc()->GetDocProvider()->InvalidateRect(m_pPageView, *pRect, | 159 GetDoc()->GetDocEnvironment()->InvalidateRect(m_pPageView, *pRect, |
| 160 XFA_INVALIDATE_CurrentPage); | 160 XFA_INVALIDATE_CurrentPage); |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 void CXFA_FFWidget::AddInvalidateRect(const CFX_RectF* pRect) { | 163 void CXFA_FFWidget::AddInvalidateRect(const CFX_RectF* pRect) { |
| 164 CFX_RectF rtWidget; | 164 CFX_RectF rtWidget; |
| 165 if (pRect) { | 165 if (pRect) { |
| 166 rtWidget = *pRect; | 166 rtWidget = *pRect; |
| 167 } else { | 167 } else { |
| 168 GetBBox(rtWidget, XFA_WidgetStatus_Focused); | 168 GetBBox(rtWidget, XFA_WidgetStatus_Focused); |
| 169 rtWidget.Inflate(2, 2); | 169 rtWidget.Inflate(2, 2); |
| 170 } | 170 } |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 CFX_WideString wsURL = wsHref; | 1076 CFX_WideString wsURL = wsHref; |
| 1077 if (wsURL.Left(7) != FX_WSTRC(L"http://") && | 1077 if (wsURL.Left(7) != FX_WSTRC(L"http://") && |
| 1078 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { | 1078 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { |
| 1079 CFX_DIBitmap* pBitmap = | 1079 CFX_DIBitmap* pBitmap = |
| 1080 pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); | 1080 pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); |
| 1081 if (pBitmap) { | 1081 if (pBitmap) { |
| 1082 bNameImage = TRUE; | 1082 bNameImage = TRUE; |
| 1083 return pBitmap; | 1083 return pBitmap; |
| 1084 } | 1084 } |
| 1085 } | 1085 } |
| 1086 pImageFileRead = pDoc->GetDocProvider()->OpenLinkedFile(pDoc, wsURL); | 1086 pImageFileRead = pDoc->GetDocEnvironment()->OpenLinkedFile(pDoc, wsURL); |
| 1087 } | 1087 } |
| 1088 if (!pImageFileRead) { | 1088 if (!pImageFileRead) { |
| 1089 FX_Free(pImageBuffer); | 1089 FX_Free(pImageBuffer); |
| 1090 return nullptr; | 1090 return nullptr; |
| 1091 } | 1091 } |
| 1092 bNameImage = FALSE; | 1092 bNameImage = FALSE; |
| 1093 CFX_DIBitmap* pBitmap = | 1093 CFX_DIBitmap* pBitmap = |
| 1094 XFA_LoadImageFromBuffer(pImageFileRead, type, iImageXDpi, iImageYDpi); | 1094 XFA_LoadImageFromBuffer(pImageFileRead, type, iImageXDpi, iImageYDpi); |
| 1095 FX_Free(pImageBuffer); | 1095 FX_Free(pImageBuffer); |
| 1096 pImageFileRead->Release(); | 1096 pImageFileRead->Release(); |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2044 } | 2044 } |
| 2045 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 2045 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
| 2046 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 2046 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
| 2047 } | 2047 } |
| 2048 | 2048 |
| 2049 CXFA_CalcData::CXFA_CalcData() : m_iRefCount(0) {} | 2049 CXFA_CalcData::CXFA_CalcData() : m_iRefCount(0) {} |
| 2050 | 2050 |
| 2051 CXFA_CalcData::~CXFA_CalcData() { | 2051 CXFA_CalcData::~CXFA_CalcData() { |
| 2052 m_Globals.RemoveAll(); | 2052 m_Globals.RemoveAll(); |
| 2053 } | 2053 } |
| OLD | NEW |