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/xfa_ffwidget.h" | 7 #include "xfa/fxfa/xfa_ffwidget.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 IFX_SeekableReadStream* pImageFileRead = nullptr; | 1059 IFX_SeekableReadStream* pImageFileRead = nullptr; |
1060 if (wsImage.GetLength() > 0) { | 1060 if (wsImage.GetLength() > 0) { |
1061 XFA_ATTRIBUTEENUM iEncoding = | 1061 XFA_ATTRIBUTEENUM iEncoding = |
1062 (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); | 1062 (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); |
1063 if (iEncoding == XFA_ATTRIBUTEENUM_Base64) { | 1063 if (iEncoding == XFA_ATTRIBUTEENUM_Base64) { |
1064 CFX_ByteString bsData = wsImage.UTF8Encode(); | 1064 CFX_ByteString bsData = wsImage.UTF8Encode(); |
1065 int32_t iLength = bsData.GetLength(); | 1065 int32_t iLength = bsData.GetLength(); |
1066 pImageBuffer = FX_Alloc(uint8_t, iLength); | 1066 pImageBuffer = FX_Alloc(uint8_t, iLength); |
1067 int32_t iRead = XFA_Base64Decode(bsData.c_str(), pImageBuffer); | 1067 int32_t iRead = XFA_Base64Decode(bsData.c_str(), pImageBuffer); |
1068 if (iRead > 0) { | 1068 if (iRead > 0) { |
1069 pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead); | 1069 pImageFileRead = IFX_MemoryStream::Create(pImageBuffer, iRead); |
1070 } | 1070 } |
1071 } else { | 1071 } else { |
1072 bsContent = CFX_ByteString::FromUnicode(wsImage); | 1072 bsContent = CFX_ByteString::FromUnicode(wsImage); |
1073 pImageFileRead = FX_CreateMemoryStream( | 1073 pImageFileRead = IFX_MemoryStream::Create( |
1074 const_cast<uint8_t*>(bsContent.raw_str()), bsContent.GetLength()); | 1074 const_cast<uint8_t*>(bsContent.raw_str()), bsContent.GetLength()); |
1075 } | 1075 } |
1076 } else { | 1076 } else { |
1077 CFX_WideString wsURL = wsHref; | 1077 CFX_WideString wsURL = wsHref; |
1078 if (wsURL.Left(7) != FX_WSTRC(L"http://") && | 1078 if (wsURL.Left(7) != FX_WSTRC(L"http://") && |
1079 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { | 1079 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { |
1080 CFX_DIBitmap* pBitmap = | 1080 CFX_DIBitmap* pBitmap = |
1081 pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); | 1081 pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); |
1082 if (pBitmap) { | 1082 if (pBitmap) { |
1083 bNameImage = true; | 1083 bNameImage = true; |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2045 } | 2045 } |
2046 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 2046 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
2047 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 2047 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
2048 } | 2048 } |
2049 | 2049 |
2050 CXFA_CalcData::CXFA_CalcData() : m_iRefCount(0) {} | 2050 CXFA_CalcData::CXFA_CalcData() : m_iRefCount(0) {} |
2051 | 2051 |
2052 CXFA_CalcData::~CXFA_CalcData() { | 2052 CXFA_CalcData::~CXFA_CalcData() { |
2053 m_Globals.RemoveAll(); | 2053 m_Globals.RemoveAll(); |
2054 } | 2054 } |
OLD | NEW |