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 | 10 |
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 CFX_ByteString bsContent; | 984 CFX_ByteString bsContent; |
985 uint8_t* pImageBuffer = NULL; | 985 uint8_t* pImageBuffer = NULL; |
986 IFX_FileRead* pImageFileRead = NULL; | 986 IFX_FileRead* pImageFileRead = NULL; |
987 if (wsImage.GetLength() > 0) { | 987 if (wsImage.GetLength() > 0) { |
988 XFA_ATTRIBUTEENUM iEncoding = | 988 XFA_ATTRIBUTEENUM iEncoding = |
989 (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); | 989 (XFA_ATTRIBUTEENUM)pImage->GetTransferEncoding(); |
990 if (iEncoding == XFA_ATTRIBUTEENUM_Base64) { | 990 if (iEncoding == XFA_ATTRIBUTEENUM_Base64) { |
991 CFX_ByteString bsData = wsImage.UTF8Encode(); | 991 CFX_ByteString bsData = wsImage.UTF8Encode(); |
992 int32_t iLength = bsData.GetLength(); | 992 int32_t iLength = bsData.GetLength(); |
993 pImageBuffer = FX_Alloc(uint8_t, iLength); | 993 pImageBuffer = FX_Alloc(uint8_t, iLength); |
994 int32_t iRead = XFA_Base64Decode((const FX_CHAR*)bsData, pImageBuffer); | 994 int32_t iRead = XFA_Base64Decode(bsData.c_str(), pImageBuffer); |
995 if (iRead > 0) { | 995 if (iRead > 0) { |
996 pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead); | 996 pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead); |
997 } | 997 } |
998 } else { | 998 } else { |
999 bsContent = CFX_ByteString::FromUnicode(wsImage); | 999 bsContent = CFX_ByteString::FromUnicode(wsImage); |
1000 pImageFileRead = FX_CreateMemoryStream( | 1000 pImageFileRead = FX_CreateMemoryStream( |
1001 const_cast<uint8_t*>(bsContent.raw_str()), bsContent.GetLength()); | 1001 const_cast<uint8_t*>(bsContent.raw_str()), bsContent.GetLength()); |
1002 } | 1002 } |
1003 } else { | 1003 } else { |
1004 CFX_WideString wsURL = wsHref; | 1004 CFX_WideString wsURL = wsHref; |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 iType != XFA_ELEMENT_Rectangle) { | 1958 iType != XFA_ELEMENT_Rectangle) { |
1959 return; | 1959 return; |
1960 } | 1960 } |
1961 CXFA_StrokeArray strokes; | 1961 CXFA_StrokeArray strokes; |
1962 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { | 1962 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { |
1963 box.GetStrokes(strokes); | 1963 box.GetStrokes(strokes); |
1964 } | 1964 } |
1965 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1965 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1966 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1966 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1967 } | 1967 } |
OLD | NEW |