summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_baseform.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-08 14:24:37 -0800
committerLei Zhang <thestig@chromium.org>2016-01-08 14:24:37 -0800
commit1b97664bc5b84c7a2b87cc656f8c6a0476f9b71f (patch)
tree11c6727d7fa3d2dac36b879c3bbd106326c7ca43 /fpdfsdk/src/fsdk_baseform.cpp
parent6a1c51b9eb666f2e120ec098d900663627ebcb3e (diff)
downloadpdfium-1b97664bc5b84c7a2b87cc656f8c6a0476f9b71f.tar.xz
Merge to XFA: Clean up misc nits found while fixing bugs.
Some bits regressed in commit 338805f. Also merge: IWYU fix after commit c5a8933. R=tsepez@chromium.org TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1544963002 . Review URL: https://codereview.chromium.org/1570973002 . (cherry picked from commit c5a8933f260ca1034fde902058442984e55c0f7a) (cherry picked from commit e6bd31873c3dba3f79c5ebbbefed636948629cc9) Review URL: https://codereview.chromium.org/1577453002 .
Diffstat (limited to 'fpdfsdk/src/fsdk_baseform.cpp')
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index 2f0fb42928..66e843473d 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -2189,66 +2189,6 @@ void CPDFSDK_InterForm::XfaSetValidationsEnabled(FX_BOOL bEnabled) {
}
#endif // PDF_ENABLE_XFA
-#ifdef _WIN32
-CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile) {
- CPDF_Document* pDocument = m_pDocument->GetPDFDocument();
- CPDF_Stream* pRetStream = NULL;
-
- if (CFX_DIBitmap* pBmp = CFX_WindowsDIB::LoadFromFile(sFile.c_str())) {
- int nWidth = pBmp->GetWidth();
- int nHeight = pBmp->GetHeight();
-
- CPDF_Image Image(pDocument);
- Image.SetImage(pBmp, FALSE);
- CPDF_Stream* pImageStream = Image.GetStream();
- if (pImageStream) {
- if (pImageStream->GetObjNum() == 0)
- pDocument->AddIndirectObject(pImageStream);
-
- CPDF_Dictionary* pStreamDict = new CPDF_Dictionary();
- pStreamDict->SetAtName("Subtype", "Form");
- pStreamDict->SetAtName("Name", "IMG");
- CPDF_Array* pMatrix = new CPDF_Array();
- pStreamDict->SetAt("Matrix", pMatrix);
- pMatrix->AddInteger(1);
- pMatrix->AddInteger(0);
- pMatrix->AddInteger(0);
- pMatrix->AddInteger(1);
- pMatrix->AddInteger(-nWidth / 2);
- pMatrix->AddInteger(-nHeight / 2);
- CPDF_Dictionary* pResource = new CPDF_Dictionary();
- pStreamDict->SetAt("Resources", pResource);
- CPDF_Dictionary* pXObject = new CPDF_Dictionary();
- pResource->SetAt("XObject", pXObject);
- pXObject->SetAtReference("Img", pDocument, pImageStream);
- CPDF_Array* pProcSet = new CPDF_Array();
- pResource->SetAt("ProcSet", pProcSet);
- pProcSet->AddName("PDF");
- pProcSet->AddName("ImageC");
- pStreamDict->SetAtName("Type", "XObject");
- CPDF_Array* pBBox = new CPDF_Array();
- pStreamDict->SetAt("BBox", pBBox);
- pBBox->AddInteger(0);
- pBBox->AddInteger(0);
- pBBox->AddInteger(nWidth);
- pBBox->AddInteger(nHeight);
- pStreamDict->SetAtInteger("FormType", 1);
-
- pRetStream = new CPDF_Stream(NULL, 0, NULL);
- CFX_ByteString csStream;
- csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidth, nHeight);
- pRetStream->InitStream((uint8_t*)csStream.c_str(), csStream.GetLength(),
- pStreamDict);
- pDocument->AddIndirectObject(pRetStream);
- }
-
- delete pBmp;
- }
-
- return pRetStream;
-}
-#endif // _WIN32
-
void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) {
CPDFDoc_Environment* pEnv = m_pDocument->GetEnv();
ASSERT(pEnv);