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 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 CFX_ByteString bsData = wsImage.UTF8Encode(); | 990 CFX_ByteString bsData = wsImage.UTF8Encode(); |
991 int32_t iLength = bsData.GetLength(); | 991 int32_t iLength = bsData.GetLength(); |
992 pImageBuffer = FX_Alloc(uint8_t, iLength); | 992 pImageBuffer = FX_Alloc(uint8_t, iLength); |
993 int32_t iRead = XFA_Base64Decode((const FX_CHAR*)bsData, pImageBuffer); | 993 int32_t iRead = XFA_Base64Decode((const FX_CHAR*)bsData, pImageBuffer); |
994 if (iRead > 0) { | 994 if (iRead > 0) { |
995 pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead); | 995 pImageFileRead = FX_CreateMemoryStream(pImageBuffer, iRead); |
996 } | 996 } |
997 } else { | 997 } else { |
998 bsContent = CFX_ByteString::FromUnicode(wsImage); | 998 bsContent = CFX_ByteString::FromUnicode(wsImage); |
999 pImageFileRead = FX_CreateMemoryStream( | 999 pImageFileRead = FX_CreateMemoryStream( |
1000 (uint8_t*)(const uint8_t*)bsContent, bsContent.GetLength()); | 1000 const_cast<uint8_t*>(bsContent.raw_str()), bsContent.GetLength()); |
1001 } | 1001 } |
1002 } else { | 1002 } else { |
1003 CFX_WideString wsURL = wsHref; | 1003 CFX_WideString wsURL = wsHref; |
1004 if (wsURL.Left(7) != FX_WSTRC(L"http://") && | 1004 if (wsURL.Left(7) != FX_WSTRC(L"http://") && |
1005 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { | 1005 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { |
1006 CFX_DIBitmap* pBitmap = | 1006 CFX_DIBitmap* pBitmap = |
1007 pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); | 1007 pDoc->GetPDFNamedImage(wsURL.AsStringC(), iImageXDpi, iImageYDpi); |
1008 if (pBitmap) { | 1008 if (pBitmap) { |
1009 bNameImage = TRUE; | 1009 bNameImage = TRUE; |
1010 return pBitmap; | 1010 return pBitmap; |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1957 iType != XFA_ELEMENT_Rectangle) { | 1957 iType != XFA_ELEMENT_Rectangle) { |
1958 return; | 1958 return; |
1959 } | 1959 } |
1960 CXFA_StrokeArray strokes; | 1960 CXFA_StrokeArray strokes; |
1961 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { | 1961 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { |
1962 box.GetStrokes(strokes); | 1962 box.GetStrokes(strokes); |
1963 } | 1963 } |
1964 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1964 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1965 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1965 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
1966 } | 1966 } |
OLD | NEW |