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

Side by Side Diff: fpdfsdk/fsdk_baseform.cpp

Issue 2152473002: Removing default params from CFX_Edit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@ifx_cleanup_2
Patch Set: Rebase to master Created 4 years, 5 months 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 "fpdfsdk/include/fsdk_baseform.h" 7 #include "fpdfsdk/include/fsdk_baseform.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 CPDFSDK_Document* pDoc = m_pInterForm->GetDocument(); 1369 CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
1370 CPDFDoc_Environment* pEnv = pDoc->GetEnv(); 1370 CPDFDoc_Environment* pEnv = pDoc->GetEnv();
1371 CBA_FontMap font_map(this, pEnv->GetSysHandler()); 1371 CBA_FontMap font_map(this, pEnv->GetSysHandler());
1372 pEdit->SetFontMap(&font_map); 1372 pEdit->SetFontMap(&font_map);
1373 1373
1374 CFX_FloatRect rcEdit = rcClient; 1374 CFX_FloatRect rcEdit = rcClient;
1375 rcEdit.right = rcButton.left; 1375 rcEdit.right = rcButton.left;
1376 rcEdit.Normalize(); 1376 rcEdit.Normalize();
1377 1377
1378 pEdit->SetPlateRect(rcEdit); 1378 pEdit->SetPlateRect(rcEdit);
1379 pEdit->SetAlignmentV(1); 1379 pEdit->SetAlignmentV(1, TRUE);
1380 1380
1381 FX_FLOAT fFontSize = GetFontSize(); 1381 FX_FLOAT fFontSize = GetFontSize();
1382 if (IsFloatZero(fFontSize)) 1382 if (IsFloatZero(fFontSize))
1383 pEdit->SetAutoFontSize(TRUE); 1383 pEdit->SetAutoFontSize(TRUE, TRUE);
1384 else 1384 else
1385 pEdit->SetFontSize(fFontSize); 1385 pEdit->SetFontSize(fFontSize);
1386 1386
1387 pEdit->Initialize(); 1387 pEdit->Initialize();
1388 1388
1389 if (sValue) { 1389 if (sValue) {
1390 pEdit->SetText(sValue); 1390 pEdit->SetText(sValue);
1391 } else { 1391 } else {
1392 int32_t nCurSel = pField->GetSelectedIndex(0); 1392 int32_t nCurSel = pField->GetSelectedIndex(0);
1393 1393
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 pEdit->EnableRefresh(FALSE); 1521 pEdit->EnableRefresh(FALSE);
1522 1522
1523 CPDFSDK_Document* pDoc = m_pInterForm->GetDocument(); 1523 CPDFSDK_Document* pDoc = m_pInterForm->GetDocument();
1524 CPDFDoc_Environment* pEnv = pDoc->GetEnv(); 1524 CPDFDoc_Environment* pEnv = pDoc->GetEnv();
1525 1525
1526 CBA_FontMap font_map(this, pEnv->GetSysHandler()); 1526 CBA_FontMap font_map(this, pEnv->GetSysHandler());
1527 pEdit->SetFontMap(&font_map); 1527 pEdit->SetFontMap(&font_map);
1528 1528
1529 CFX_FloatRect rcClient = GetClientRect(); 1529 CFX_FloatRect rcClient = GetClientRect();
1530 pEdit->SetPlateRect(rcClient); 1530 pEdit->SetPlateRect(rcClient);
1531 pEdit->SetAlignmentH(pControl->GetControlAlignment()); 1531 pEdit->SetAlignmentH(pControl->GetControlAlignment(), TRUE);
1532 1532
1533 uint32_t dwFieldFlags = pField->GetFieldFlags(); 1533 uint32_t dwFieldFlags = pField->GetFieldFlags();
1534 FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1; 1534 FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1;
1535 1535
1536 if (bMultiLine) { 1536 if (bMultiLine) {
1537 pEdit->SetMultiLine(TRUE); 1537 pEdit->SetMultiLine(TRUE, TRUE);
1538 pEdit->SetAutoReturn(TRUE); 1538 pEdit->SetAutoReturn(TRUE, TRUE);
1539 } else { 1539 } else {
1540 pEdit->SetAlignmentV(1); 1540 pEdit->SetAlignmentV(1, TRUE);
1541 } 1541 }
1542 1542
1543 uint16_t subWord = 0; 1543 uint16_t subWord = 0;
1544 if ((dwFieldFlags >> 13) & 1) { 1544 if ((dwFieldFlags >> 13) & 1) {
1545 subWord = '*'; 1545 subWord = '*';
1546 pEdit->SetPasswordChar(subWord); 1546 pEdit->SetPasswordChar(subWord, TRUE);
1547 } 1547 }
1548 1548
1549 int nMaxLen = pField->GetMaxLen(); 1549 int nMaxLen = pField->GetMaxLen();
1550 FX_BOOL bCharArray = (dwFieldFlags >> 24) & 1; 1550 FX_BOOL bCharArray = (dwFieldFlags >> 24) & 1;
1551 FX_FLOAT fFontSize = GetFontSize(); 1551 FX_FLOAT fFontSize = GetFontSize();
1552 1552
1553 #ifdef PDF_ENABLE_XFA 1553 #ifdef PDF_ENABLE_XFA
1554 CFX_WideString sValueTmp; 1554 CFX_WideString sValueTmp;
1555 if (!sValue && GetMixXFAWidget()) { 1555 if (!sValue && GetMixXFAWidget()) {
1556 sValueTmp = GetValue(TRUE); 1556 sValueTmp = GetValue(TRUE);
(...skipping 10 matching lines...) Expand all
1567 rcClient, nMaxLen); 1567 rcClient, nMaxLen);
1568 } 1568 }
1569 } else { 1569 } else {
1570 if (sValue) 1570 if (sValue)
1571 nMaxLen = wcslen((const wchar_t*)sValue); 1571 nMaxLen = wcslen((const wchar_t*)sValue);
1572 pEdit->SetLimitChar(nMaxLen); 1572 pEdit->SetLimitChar(nMaxLen);
1573 } 1573 }
1574 } 1574 }
1575 1575
1576 if (IsFloatZero(fFontSize)) 1576 if (IsFloatZero(fFontSize))
1577 pEdit->SetAutoFontSize(TRUE); 1577 pEdit->SetAutoFontSize(TRUE, TRUE);
1578 else 1578 else
1579 pEdit->SetFontSize(fFontSize); 1579 pEdit->SetFontSize(fFontSize);
1580 1580
1581 pEdit->Initialize(); 1581 pEdit->Initialize();
1582 1582
1583 if (sValue) 1583 if (sValue)
1584 pEdit->SetText(sValue); 1584 pEdit->SetText(sValue);
1585 else 1585 else
1586 pEdit->SetText(pField->GetValue().c_str()); 1586 pEdit->SetText(pField->GetValue().c_str());
1587 1587
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after
2827 break; 2827 break;
2828 } 2828 }
2829 } 2829 }
2830 } 2830 }
2831 2831
2832 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) { 2832 CFX_FloatRect CBA_AnnotIterator::GetAnnotRect(const CPDFSDK_Annot* pAnnot) {
2833 CFX_FloatRect rcAnnot; 2833 CFX_FloatRect rcAnnot;
2834 pAnnot->GetPDFAnnot()->GetRect(rcAnnot); 2834 pAnnot->GetPDFAnnot()->GetRect(rcAnnot);
2835 return rcAnnot; 2835 return rcAnnot;
2836 } 2836 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698