Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: xfa/fxfa/app/xfa_ffdoc.cpp

Issue 2539203002: Convert loose FX_Create* functions into static methods (Closed)
Patch Set: last batch Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_ffdoc.h" 7 #include "xfa/fxfa/xfa_ffdoc.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 410 }
411 } 411 }
412 412
413 CPDF_Stream* pStream = ToStream(pObject); 413 CPDF_Stream* pStream = ToStream(pObject);
414 if (!pStream) 414 if (!pStream)
415 return nullptr; 415 return nullptr;
416 416
417 CPDF_StreamAcc streamAcc; 417 CPDF_StreamAcc streamAcc;
418 streamAcc.LoadAllData(pStream); 418 streamAcc.LoadAllData(pStream);
419 419
420 IFX_SeekableReadStream* pImageFileRead = 420 IFX_SeekableReadStream* pImageFileRead = IFX_MemoryStream::Create(
421 FX_CreateMemoryStream((uint8_t*)streamAcc.GetData(), streamAcc.GetSize()); 421 (uint8_t*)streamAcc.GetData(), streamAcc.GetSize());
422 422
423 CFX_DIBitmap* pDibSource = XFA_LoadImageFromBuffer( 423 CFX_DIBitmap* pDibSource = XFA_LoadImageFromBuffer(
424 pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi); 424 pImageFileRead, FXCODEC_IMAGE_UNKNOWN, iImageXDpi, iImageYDpi);
425 m_HashToDibDpiMap[dwHash] = {pDibSource, iImageXDpi, iImageYDpi}; 425 m_HashToDibDpiMap[dwHash] = {pDibSource, iImageXDpi, iImageYDpi};
426 pImageFileRead->Release(); 426 pImageFileRead->Release();
427 return pDibSource; 427 return pDibSource;
428 } 428 }
429 429
430 bool CXFA_FFDoc::SavePackage(XFA_HashCode code, 430 bool CXFA_FFDoc::SavePackage(XFA_HashCode code,
431 IFX_SeekableWriteStream* pFile, 431 IFX_SeekableWriteStream* pFile,
(...skipping 12 matching lines...) Expand all
444 444
445 return !!pExport->Export( 445 return !!pExport->Export(
446 pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr); 446 pFile, pNode, 0, bsChecksum.GetLength() ? bsChecksum.c_str() : nullptr);
447 } 447 }
448 448
449 bool CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, bool bXDP) { 449 bool CXFA_FFDoc::ImportData(IFX_SeekableReadStream* pStream, bool bXDP) {
450 std::unique_ptr<CXFA_DataImporter> importer( 450 std::unique_ptr<CXFA_DataImporter> importer(
451 new CXFA_DataImporter(m_pDocumentParser->GetDocument())); 451 new CXFA_DataImporter(m_pDocumentParser->GetDocument()));
452 return importer->ImportData(pStream); 452 return importer->ImportData(pStream);
453 } 453 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698