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 "../../third_party/base/nonstd_unique_ptr.h" | 7 #include "../../third_party/base/nonstd_unique_ptr.h" |
8 #include "../include/fsdk_define.h" | 8 #include "../include/fsdk_define.h" |
9 #include "../include/fpdfxfa/fpdfxfa_doc.h" | 9 #include "../include/fpdfxfa/fpdfxfa_doc.h" |
10 #include "../include/fpdfxfa/fpdfxfa_util.h" | 10 #include "../include/fpdfxfa/fpdfxfa_util.h" |
(...skipping 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(c
sWValue); | 3113 CFX_ByteString csValue_b = CFX_ByteString::FromUnicode(c
sWValue); |
3114 | 3114 |
3115 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b
.GetLength()); | 3115 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b
.GetLength()); |
3116 name_b.ReleaseBuffer(); | 3116 name_b.ReleaseBuffer(); |
3117 fdfEncodedData = fdfEncodedData<<"="; | 3117 fdfEncodedData = fdfEncodedData<<"="; |
3118 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV
alue_b.GetLength()); | 3118 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV
alue_b.GetLength()); |
3119 csValue_b.ReleaseBuffer(); | 3119 csValue_b.ReleaseBuffer(); |
3120 if(i != pFields->GetCount()-1) | 3120 if(i != pFields->GetCount()-1) |
3121 fdfEncodedData = fdfEncodedData<<"&"; | 3121 fdfEncodedData = fdfEncodedData<<"&"; |
3122 } | 3122 } |
3123 » » | 3123 |
3124 nBufSize = fdfEncodedData.GetLength(); | 3124 nBufSize = fdfEncodedData.GetLength(); |
3125 pBuf = FX_Alloc(FX_BYTE, nBufSize); | 3125 pBuf = FX_Alloc(FX_BYTE, nBufSize); |
3126 if(!pBuf) | |
3127 return FALSE; | |
3128 FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize); | 3126 FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize); |
3129 | |
3130 } | 3127 } |
3131 return TRUE; | 3128 return TRUE; |
3132 } | 3129 } |
3133 | 3130 |
3134 FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,F
X_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf) | 3131 FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,F
X_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf) |
3135 { | 3132 { |
3136 ASSERT(m_pDocument != NULL); | 3133 ASSERT(m_pDocument != NULL); |
3137 ASSERT(m_pInterForm != NULL); | 3134 ASSERT(m_pInterForm != NULL); |
3138 | 3135 |
3139 CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(
CFX_PtrArray&)fields, bIncludeOrExclude); | 3136 CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(
CFX_PtrArray&)fields, bIncludeOrExclude); |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3788 | 3785 |
3789 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); | 3786 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); |
3790 ASSERT(pPDFAnnot != NULL); | 3787 ASSERT(pPDFAnnot != NULL); |
3791 | 3788 |
3792 CPDF_Rect rcAnnot; | 3789 CPDF_Rect rcAnnot; |
3793 pPDFAnnot->GetRect(rcAnnot); | 3790 pPDFAnnot->GetRect(rcAnnot); |
3794 | 3791 |
3795 return rcAnnot; | 3792 return rcAnnot; |
3796 } | 3793 } |
3797 | 3794 |
OLD | NEW |