| 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/include/fxfa/xfa_ffwidget.h" | 7 #include "xfa/include/fxfa/xfa_ffwidget.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 out[j++] = g_base64_chars[(limb >> 4) & 63]; | 937 out[j++] = g_base64_chars[(limb >> 4) & 63]; |
| 938 out[j++] = g_base64_chars[(limb << 2) & 63]; | 938 out[j++] = g_base64_chars[(limb << 2) & 63]; |
| 939 out[j++] = '='; | 939 out[j++] = '='; |
| 940 break; | 940 break; |
| 941 default: | 941 default: |
| 942 break; | 942 break; |
| 943 } | 943 } |
| 944 out[j] = '\0'; | 944 out[j] = '\0'; |
| 945 return out; | 945 return out; |
| 946 } | 946 } |
| 947 FXCODEC_IMAGE_TYPE XFA_GetImageType(const CFX_WideStringC& wsType) { | 947 FXCODEC_IMAGE_TYPE XFA_GetImageType(const CFX_WideString& wsType) { |
| 948 CFX_WideString wsContentType(wsType); | 948 CFX_WideString wsContentType(wsType); |
| 949 wsContentType.MakeLower(); | 949 wsContentType.MakeLower(); |
| 950 if (wsContentType == FX_WSTRC(L"image/jpg")) { | 950 if (wsContentType == FX_WSTRC(L"image/jpg")) { |
| 951 return FXCODEC_IMAGE_JPG; | 951 return FXCODEC_IMAGE_JPG; |
| 952 } | 952 } |
| 953 if (wsContentType == FX_WSTRC(L"image/png")) { | 953 if (wsContentType == FX_WSTRC(L"image/png")) { |
| 954 return FXCODEC_IMAGE_PNG; | 954 return FXCODEC_IMAGE_PNG; |
| 955 } | 955 } |
| 956 if (wsContentType == FX_WSTRC(L"image/gif")) { | 956 if (wsContentType == FX_WSTRC(L"image/gif")) { |
| 957 return FXCODEC_IMAGE_GIF; | 957 return FXCODEC_IMAGE_GIF; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 996 } else { | 996 } else { |
| 997 bsContent = CFX_ByteString::FromUnicode(wsImage); | 997 bsContent = CFX_ByteString::FromUnicode(wsImage); |
| 998 pImageFileRead = FX_CreateMemoryStream( | 998 pImageFileRead = FX_CreateMemoryStream( |
| 999 (uint8_t*)(const uint8_t*)bsContent, bsContent.GetLength()); | 999 (uint8_t*)(const uint8_t*)bsContent, bsContent.GetLength()); |
| 1000 } | 1000 } |
| 1001 } else { | 1001 } else { |
| 1002 CFX_WideString wsURL = wsHref; | 1002 CFX_WideString wsURL = wsHref; |
| 1003 if (wsURL.Left(7) != FX_WSTRC(L"http://") && | 1003 if (wsURL.Left(7) != FX_WSTRC(L"http://") && |
| 1004 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { | 1004 wsURL.Left(6) != FX_WSTRC(L"ftp://")) { |
| 1005 CFX_DIBitmap* pBitmap = | 1005 CFX_DIBitmap* pBitmap = |
| 1006 pDoc->GetPDFNamedImage(wsURL, iImageXDpi, iImageYDpi); | 1006 pDoc->GetPDFNamedImage(wsURL.AsWideStringC(), iImageXDpi, iImageYDpi); |
| 1007 if (pBitmap) { | 1007 if (pBitmap) { |
| 1008 bNameImage = TRUE; | 1008 bNameImage = TRUE; |
| 1009 return pBitmap; | 1009 return pBitmap; |
| 1010 } | 1010 } |
| 1011 } | 1011 } |
| 1012 pImageFileRead = pDoc->GetDocProvider()->OpenLinkedFile(pDoc, wsURL); | 1012 pImageFileRead = pDoc->GetDocProvider()->OpenLinkedFile(pDoc, wsURL); |
| 1013 } | 1013 } |
| 1014 if (!pImageFileRead) { | 1014 if (!pImageFileRead) { |
| 1015 FX_Free(pImageBuffer); | 1015 FX_Free(pImageBuffer); |
| 1016 return NULL; | 1016 return NULL; |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1956 iType != XFA_ELEMENT_Rectangle) { | 1956 iType != XFA_ELEMENT_Rectangle) { |
| 1957 return; | 1957 return; |
| 1958 } | 1958 } |
| 1959 CXFA_StrokeArray strokes; | 1959 CXFA_StrokeArray strokes; |
| 1960 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { | 1960 if (!(dwFlags & XFA_DRAWBOX_ForceRound) && iType != XFA_ELEMENT_Arc) { |
| 1961 box.GetStrokes(strokes); | 1961 box.GetStrokes(strokes); |
| 1962 } | 1962 } |
| 1963 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1963 XFA_BOX_Fill(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
| 1964 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); | 1964 XFA_BOX_Stroke(box, strokes, pGS, rtWidget, pMatrix, dwFlags); |
| 1965 } | 1965 } |
| OLD | NEW |