101 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
102 EXPECT_TRUE(GetCPWLEdit()->GetText().IsEmpty());
103 EXPECT_TRUE(GetCFFLFormFiller()->OnChar(GetCPDFSDKAnnot(),
'a', {}));
104 EXPECT_TRUE(GetCFFLFormFiller()->OnChar(GetCPDFSDKAnnot(),
'b', {}));
105 EXPECT_TRUE(GetCFFLFormFiller()->OnChar(GetCPDFSDKAnnot(),
'c', {}));
107 EXPECT_STREQ(L"abc", GetCPWLEdit()->GetText().c_str());
111 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
116 GetCPWLEdit()->SetSelection(0, 3);
117 EXPECT_TRUE(GetCPWLEdit()->GetSelectedText().IsEmpty());
119 EXPECT_TRUE(GetCFFLFormFiller()->OnChar(GetCPDFSDKAnnot(),
'a', {}));
120 EXPECT_TRUE(GetCFFLFormFiller()->OnChar(GetCPDFSDKAnnot(),
'b', {}));
121 EXPECT_TRUE(GetCFFLFormFiller()->OnChar(GetCPDFSDKAnnot(),
'c', {}));
122 GetCPWLEdit()->SetSelection(0, 2);
124 EXPECT_STREQ(L"ab", GetCPWLEdit()->GetSelectedText().c_str());
128 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
129 TypeTextIntoTextField(50);
131 GetCPWLEdit()->SetSelection(0, 0);
132 EXPECT_TRUE(GetCPWLEdit()->GetSelectedText().IsEmpty());
134 GetCPWLEdit()->SetSelection(0, 1);
135 EXPECT_STREQ(L"A", GetCPWLEdit()->GetSelectedText().c_str());
137 GetCPWLEdit()->SetSelection(0, -1);
138 EXPECT_STREQ(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqr",
139 GetCPWLEdit()->GetSelectedText().c_str());
141 GetCPWLEdit()->SetSelection(-8, -1);
142 EXPECT_TRUE(GetCPWLEdit()->GetSelectedText().IsEmpty());
144 GetCPWLEdit()->SetSelection(23, 12);
145 EXPECT_STREQ(L"MNOPQRSTUVW", GetCPWLEdit()->GetSelectedText().c_str());
147 GetCPWLEdit()->SetSelection(12, 23);
148 EXPECT_STREQ(L"MNOPQRSTUVW", GetCPWLEdit()->GetSelectedText().c_str());
150 GetCPWLEdit()->SetSelection(49, 50);
151 EXPECT_STREQ(L"r", GetCPWLEdit()->GetSelectedText().c_str());
153 GetCPWLEdit()->SetSelection(49, 55);
154 EXPECT_STREQ(L"r", GetCPWLEdit()->GetSelectedText().c_str());
158 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
159 TypeTextIntoTextField(50);
161 GetCPWLEdit()->SetSelection(0, -1);
162 EXPECT_STREQ(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqr",
163 GetCPWLEdit()->GetSelectedText().c_str());
165 GetCPWLEdit()->ReplaceSelection(L"");
166 EXPECT_TRUE(GetCPWLEdit()->GetText().IsEmpty());
170 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
171 TypeTextIntoTextField(50);
173 GetCPWLEdit()->SetSelection(12, 23);
174 EXPECT_STREQ(L"MNOPQRSTUVW", GetCPWLEdit()->GetSelectedText().c_str());
176 GetCPWLEdit()->ReplaceSelection(L"");
177 EXPECT_STREQ(L"ABCDEFGHIJKLXYZ[\\]^_`abcdefghijklmnopqr",
178 GetCPWLEdit()->GetText().c_str());
182 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
183 TypeTextIntoTextField(50);
185 GetCPWLEdit()->SetSelection(0, 5);
186 EXPECT_STREQ(L"ABCDE", GetCPWLEdit()->GetSelectedText().c_str());
188 GetCPWLEdit()->ReplaceSelection(L"");
189 EXPECT_STREQ(L"FGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqr",
190 GetCPWLEdit()->GetText().c_str());
194 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
195 TypeTextIntoTextField(50);
197 GetCPWLEdit()->SetSelection(45, 50);
198 EXPECT_STREQ(L"nopqr", GetCPWLEdit()->GetSelectedText().c_str());
200 GetCPWLEdit()->ReplaceSelection(L"");
201 EXPECT_STREQ(L"ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklm",
202 GetCPWLEdit()->GetText().c_str());
254 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
255 TypeTextIntoTextField(10);
257 GetCPWLEdit()->SetSelection(0, -1);
258 EXPECT_STREQ(L"ABCDEFGHIJ", GetCPWLEdit()->GetSelectedText().c_str());
259 GetCPWLEdit()->ReplaceSelection(L"Hello");
260 EXPECT_STREQ(L"Hello", GetCPWLEdit()->GetText().c_str());
265 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
266 TypeTextIntoTextField(10);
268 GetCPWLEdit()->SetSelection(0, 5);
269 EXPECT_STREQ(L"ABCDE", GetCPWLEdit()->GetSelectedText().c_str());
270 GetCPWLEdit()->ReplaceSelection(L"Hello");
271 EXPECT_STREQ(L"HelloFGHIJ", GetCPWLEdit()->GetText().c_str());
276 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
277 TypeTextIntoTextField(10);
279 GetCPWLEdit()->SetSelection(2, 7);
280 EXPECT_STREQ(L"CDEFG", GetCPWLEdit()->GetSelectedText().c_str());
281 GetCPWLEdit()->ReplaceSelection(L"Hello");
282 EXPECT_STREQ(L"ABHelloHIJ", GetCPWLEdit()->GetText().c_str());
287 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
288 TypeTextIntoTextField(10);
290 GetCPWLEdit()->SetSelection(5, 10);
291 EXPECT_STREQ(L"FGHIJ", GetCPWLEdit()->GetSelectedText().c_str());
292 GetCPWLEdit()->ReplaceSelection(L"Hello");
293 EXPECT_STREQ(L"ABCDEHello", GetCPWLEdit()->GetText().c_str());
297 FormFillerAndWindowSetup(GetCPDFSDKAnnotCharLimit());
298 GetCPWLEdit()->SetSelection(0, -1);
299 EXPECT_STREQ(L"Elephant", GetCPWLEdit()->GetSelectedText().c_str());
300 GetCPWLEdit()->ReplaceSelection(L"");
302 GetCPWLEdit()->ReplaceSelection(L"Hippopotamus");
303 EXPECT_STREQ(L"Hippopotam", GetCPWLEdit()->GetText().c_str());
307 FormFillerAndWindowSetup(GetCPDFSDKAnnotCharLimit());
308 GetCPWLEdit()->SetSelection(0, -1);
309 EXPECT_STREQ(L"Elephant", GetCPWLEdit()->GetSelectedText().c_str());
310 GetCPWLEdit()->ReplaceSelection(L"");
312 GetCPWLEdit()->ReplaceSelection(L"Zebra");
313 EXPECT_STREQ(L"Zebra", GetCPWLEdit()->GetText().c_str());
427 FormFillerAndWindowSetup(GetCPDFSDKAnnot());
428 TypeTextIntoTextField(10);
430 GetCPWLEdit()->SetSelection(1, 3);
431 EXPECT_STREQ(L"ABCDEFGHIJ", GetCPWLEdit()->GetText().c_str());
432 GetCPWLEdit()->ReplaceAndKeepSelection(L"xyz");
433 EXPECT_STREQ(L"AxyzDEFGHIJ", GetCPWLEdit()->GetText().c_str());
434 EXPECT_STREQ(L"xyz", GetCPWLEdit()->GetSelectedText().c_str());
435 EXPECT_EQ(GetCPWLEdit()->GetSelection(),
std::make_pair(1, 4));
437 GetCPWLEdit()->SetSelection(4, 1);
438 GetCPWLEdit()->ReplaceAndKeepSelection(L"12");
439 EXPECT_STREQ(L"A12DEFGHIJ", GetCPWLEdit()->GetText().c_str());
440 EXPECT_STREQ(L"12", GetCPWLEdit()->GetSelectedText().c_str());
441 EXPECT_EQ(GetCPWLEdit()->GetSelection(),
std::make_pair(1, 3));