summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller')
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp11
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.h1
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp6
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.h1
4 files changed, 19 insertions, 0 deletions
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index dcbe0181f3..32bbcb73d2 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -219,6 +219,17 @@ bool CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot,
return pWnd && pWnd->OnChar(nChar, nFlags);
}
+WideString CFFL_FormFiller::GetText(CPDFSDK_Annot* pAnnot) {
+ if (!IsValid())
+ return WideString();
+
+ CPDFSDK_PageView* pPageView = GetCurPageView(true);
+ ASSERT(pPageView);
+
+ CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false);
+ return pWnd ? pWnd->GetText() : WideString();
+}
+
WideString CFFL_FormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) {
if (!IsValid())
return WideString();
diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h
index 0dfb0bb177..a9d90ab902 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.h
+++ b/fpdfsdk/formfiller/cffl_formfiller.h
@@ -75,6 +75,7 @@ class CFFL_FormFiller : public CPWL_Wnd::ProviderIface,
uint32_t nFlags);
virtual bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags);
+ WideString GetText(CPDFSDK_Annot* pAnnot);
WideString GetSelectedText(CPDFSDK_Annot* pAnnot);
void ReplaceSelection(CPDFSDK_Annot* pAnnot, const WideString& text);
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 83b425725a..5972d1dd67 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -511,6 +511,12 @@ CFFL_FormFiller* CFFL_InteractiveFormFiller::GetFormFiller(
return pFormFiller;
}
+WideString CFFL_InteractiveFormFiller::GetText(CPDFSDK_Annot* pAnnot) {
+ ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
+ CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
+ return pFormFiller ? pFormFiller->GetText(pAnnot) : WideString();
+}
+
WideString CFFL_InteractiveFormFiller::GetSelectedText(CPDFSDK_Annot* pAnnot) {
ASSERT(pAnnot->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET);
CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, false);
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
index 94ca59d284..bb0d2233fc 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -82,6 +82,7 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, bool bRegister);
+ WideString GetText(CPDFSDK_Annot* pAnnot);
WideString GetSelectedText(CPDFSDK_Annot* pAnnot);
void ReplaceSelection(CPDFSDK_Annot* pAnnot, const WideString& text);