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

Side by Side Diff: core/src/fpdfdoc/doc_formfield.cpp

Issue 1471323004: Inflict PPDF_ENABLE_XFA ifdefs on XFA core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 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 "core/include/fpdfdoc/fpdf_doc.h" 7 #include "core/include/fpdfdoc/fpdf_doc.h"
8 #include "doc_utils.h" 8 #include "doc_utils.h"
9 9
10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField* pField) { 10 FX_BOOL PDF_FormField_IsUnison(CPDF_FormField* pField) {
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 } 732 }
733 int iCount = CountOptions(); 733 int iCount = CountOptions();
734 for (; iStartIndex < iCount; iStartIndex++) { 734 for (; iStartIndex < iCount; iStartIndex++) {
735 CFX_WideString csValue = GetOptionValue(iStartIndex); 735 CFX_WideString csValue = GetOptionValue(iStartIndex);
736 if (csValue == csOptValue) { 736 if (csValue == csOptValue) {
737 return iStartIndex; 737 return iStartIndex;
738 } 738 }
739 } 739 }
740 return -1; 740 return -1;
741 } 741 }
742 #ifdef PDF_ENABLE_XFA
742 int CPDF_FormField::InsertOption(CFX_WideString csOptLabel, 743 int CPDF_FormField::InsertOption(CFX_WideString csOptLabel,
743 int index, 744 int index,
744 FX_BOOL bNotify) { 745 FX_BOOL bNotify) {
745 if (csOptLabel.IsEmpty()) 746 if (csOptLabel.IsEmpty())
746 return -1; 747 return -1;
747 748
748 if (bNotify && m_pForm->m_pFormNotify != NULL) { 749 if (bNotify && m_pForm->m_pFormNotify != NULL) {
749 int iRet = 0; 750 int iRet = 0;
750 if (GetType() == ListBox) 751 if (GetType() == ListBox)
751 iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csOptLabel); 752 iRet = m_pForm->m_pFormNotify->BeforeSelectionChange(this, csOptLabel);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 if (bNotify && m_pForm->m_pFormNotify != NULL) { 810 if (bNotify && m_pForm->m_pFormNotify != NULL) {
810 if (GetType() == ListBox) 811 if (GetType() == ListBox)
811 m_pForm->m_pFormNotify->AfterSelectionChange(this); 812 m_pForm->m_pFormNotify->AfterSelectionChange(this);
812 if (GetType() == ComboBox) 813 if (GetType() == ComboBox)
813 m_pForm->m_pFormNotify->AfterValueChange(this); 814 m_pForm->m_pFormNotify->AfterValueChange(this);
814 } 815 }
815 816
816 m_pForm->m_bUpdated = TRUE; 817 m_pForm->m_bUpdated = TRUE;
817 return TRUE; 818 return TRUE;
818 } 819 }
820 #endif
819 FX_BOOL CPDF_FormField::CheckControl(int iControlIndex, 821 FX_BOOL CPDF_FormField::CheckControl(int iControlIndex,
820 FX_BOOL bChecked, 822 FX_BOOL bChecked,
821 FX_BOOL bNotify) { 823 FX_BOOL bNotify) {
822 ASSERT(GetType() == CheckBox || GetType() == RadioButton); 824 ASSERT(GetType() == CheckBox || GetType() == RadioButton);
823 CPDF_FormControl* pControl = GetControl(iControlIndex); 825 CPDF_FormControl* pControl = GetControl(iControlIndex);
824 if (pControl == NULL) { 826 if (pControl == NULL) {
825 return FALSE; 827 return FALSE;
826 } 828 }
827 if (!bChecked && pControl->IsChecked() == bChecked) { 829 if (!bChecked && pControl->IsChecked() == bChecked) {
828 return FALSE; 830 return FALSE;
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")) 1114 m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font"))
1113 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict( 1115 pFontDict = m_pForm->m_pFormDict->GetDict("DR")->GetDict("Font")->GetDict(
1114 font_name); 1116 font_name);
1115 1117
1116 if (pFontDict == NULL) { 1118 if (pFontDict == NULL) {
1117 return; 1119 return;
1118 } 1120 }
1119 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict); 1121 m_pFont = m_pForm->m_pDocument->LoadFont(pFontDict);
1120 m_FontSize = FX_atof(syntax.GetWord()); 1122 m_FontSize = FX_atof(syntax.GetWord());
1121 } 1123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698