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

Side by Side Diff: fpdfsdk/src/fsdk_baseform.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 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
« no previous file with comments | « fpdfsdk/src/fsdk_baseannot.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "../../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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (IXFA_Widget* hGroupWidget = GetGroup MixXFAWidget()) 277 if (IXFA_Widget* hGroupWidget = GetGroup MixXFAWidget())
278 { 278 {
279 CXFA_WidgetAcc* pAcc = pXFAWidge tHandler->GetDataAcc(hGroupWidget); 279 CXFA_WidgetAcc* pAcc = pXFAWidge tHandler->GetDataAcc(hGroupWidget);
280 param.m_pTarget = pAcc; 280 param.m_pTarget = pAcc;
281 pXFAWidgetHandler->ProcessEvent( pAcc, &param); 281 pXFAWidgetHandler->ProcessEvent( pAcc, &param);
282 } 282 }
283 283
284 { 284 {
285 CXFA_WidgetAcc* pAcc = pXFAWidge tHandler->GetDataAcc(hWidget); 285 CXFA_WidgetAcc* pAcc = pXFAWidge tHandler->GetDataAcc(hWidget);
286 param.m_pTarget = pAcc; 286 param.m_pTarget = pAcc;
287 » » » » » » FX_INT32 nRet = pXFAWidgetHandle r->ProcessEvent(pAcc, &param);» 287 » » » » » » int32_t nRet = pXFAWidgetHandler ->ProcessEvent(pAcc, &param);»
288 return nRet == XFA_EVENTERROR_Su cess; 288 return nRet == XFA_EVENTERROR_Su cess;
289 } 289 }
290 } 290 }
291 else 291 else
292 { 292 {
293 CXFA_WidgetAcc* pAcc = pXFAWidgetHandler ->GetDataAcc(hWidget); 293 CXFA_WidgetAcc* pAcc = pXFAWidgetHandler ->GetDataAcc(hWidget);
294 param.m_pTarget = pAcc; 294 param.m_pTarget = pAcc;
295 » » » » » FX_INT32 nRet = pXFAWidgetHandler->Proce ssEvent(pAcc, &param);» 295 » » » » » int32_t nRet = pXFAWidgetHandler->Proces sEvent(pAcc, &param);»
296 return nRet == XFA_EVENTERROR_Sucess; 296 return nRet == XFA_EVENTERROR_Sucess;
297 } 297 }
298 298
299 if (IXFA_DocView* pDocView = pDoc->GetXFADocView ()) 299 if (IXFA_DocView* pDocView = pDoc->GetXFADocView ())
300 { 300 {
301 pDocView->UpdateDocView(); 301 pDocView->UpdateDocView();
302 } 302 }
303 } 303 }
304 } 304 }
305 } 305 }
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
1086 ASSERT(m_pInterForm != NULL); 1086 ASSERT(m_pInterForm != NULL);
1087 1087
1088 int nFieldType = GetFieldType(); 1088 int nFieldType = GetFieldType();
1089 if (m_pInterForm->IsNeedHighLight(nFieldType)) 1089 if (m_pInterForm->IsNeedHighLight(nFieldType))
1090 { 1090 {
1091 1091
1092 // if (nFieldType != FIELDTYPE_PUSHBUTTON) 1092 // if (nFieldType != FIELDTYPE_PUSHBUTTON)
1093 // { 1093 // {
1094 CPDF_Rect rc = GetRect(); 1094 CPDF_Rect rc = GetRect();
1095 FX_COLORREF color = m_pInterForm->GetHighlightColor(nFie ldType); 1095 FX_COLORREF color = m_pInterForm->GetHighlightColor(nFie ldType);
1096 » » » FX_BYTE alpha = m_pInterForm->GetHighlightAlpha(); 1096 » » » uint8_t alpha = m_pInterForm->GetHighlightAlpha();
1097 1097
1098 CFX_FloatRect rcDevice; 1098 CFX_FloatRect rcDevice;
1099 ASSERT(m_pInterForm->GetDocument()); 1099 ASSERT(m_pInterForm->GetDocument());
1100 CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()- >GetEnv(); 1100 CPDFDoc_Environment* pEnv = m_pInterForm->GetDocument()- >GetEnv();
1101 if(!pEnv) 1101 if(!pEnv)
1102 return; 1102 return;
1103 CFX_AffineMatrix page2device; 1103 CFX_AffineMatrix page2device;
1104 pPageView->GetCurrentMatrix(page2device); 1104 pPageView->GetCurrentMatrix(page2device);
1105 page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc .bottom), rcDevice.left, rcDevice.bottom); 1105 page2device.Transform(((FX_FLOAT)rc.left), ((FX_FLOAT)rc .bottom), rcDevice.left, rcDevice.bottom);
1106 // pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.lef t, rc.bottom, &rcDevice.left, &rcDevice.bottom); 1106 // pEnv->FFI_PageToDevice(m_pPageView->GetPDFPage(), rc.lef t, rc.bottom, &rcDevice.left, &rcDevice.bottom);
(...skipping 11 matching lines...) Expand all
1118 1118
1119 void CPDFSDK_Widget::ResetAppearance_PushButton() 1119 void CPDFSDK_Widget::ResetAppearance_PushButton()
1120 { 1120 {
1121 CPDF_FormControl* pControl = GetFormControl(); 1121 CPDF_FormControl* pControl = GetFormControl();
1122 ASSERT(pControl != NULL); 1122 ASSERT(pControl != NULL);
1123 1123
1124 1124
1125 1125
1126 CPDF_Rect rcWindow = GetRotatedRect(); 1126 CPDF_Rect rcWindow = GetRotatedRect();
1127 1127
1128 » FX_INT32 nLayout = 0; 1128 » int32_t nLayout = 0;
1129 1129
1130 switch (pControl->GetTextPosition()) 1130 switch (pControl->GetTextPosition())
1131 { 1131 {
1132 case TEXTPOS_ICON: 1132 case TEXTPOS_ICON:
1133 nLayout = PPBL_ICON; 1133 nLayout = PPBL_ICON;
1134 break; 1134 break;
1135 case TEXTPOS_BELOW: 1135 case TEXTPOS_BELOW:
1136 nLayout = PPBL_ICONTOPLABELBOTTOM; 1136 nLayout = PPBL_ICONTOPLABELBOTTOM;
1137 break; 1137 break;
1138 case TEXTPOS_ABOVE: 1138 case TEXTPOS_ABOVE:
(...skipping 20 matching lines...) Expand all
1159 1159
1160 pControl->GetOriginalBackgroundColor(iColorType, fc); 1160 pControl->GetOriginalBackgroundColor(iColorType, fc);
1161 if (iColorType > 0) 1161 if (iColorType > 0)
1162 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] ); 1162 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] );
1163 1163
1164 pControl->GetOriginalBorderColor(iColorType, fc); 1164 pControl->GetOriginalBorderColor(iColorType, fc);
1165 if (iColorType > 0) 1165 if (iColorType > 0)
1166 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1166 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1167 1167
1168 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 1168 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
1169 » FX_INT32 nBorderStyle = 0; 1169 » int32_t nBorderStyle = 0;
1170 CPWL_Dash dsBorder(3,0,0); 1170 CPWL_Dash dsBorder(3,0,0);
1171 CPWL_Color crLeftTop,crRightBottom; 1171 CPWL_Color crLeftTop,crRightBottom;
1172 1172
1173 switch (GetBorderStyle()) 1173 switch (GetBorderStyle())
1174 { 1174 {
1175 case BBS_DASH: 1175 case BBS_DASH:
1176 nBorderStyle = PBS_DASH; 1176 nBorderStyle = PBS_DASH;
1177 dsBorder = CPWL_Dash(3, 3, 0); 1177 dsBorder = CPWL_Dash(3, 3, 0);
1178 break; 1178 break;
1179 case BBS_BEVELED: 1179 case BBS_BEVELED:
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 1365
1366 pControl->GetOriginalBackgroundColor(iColorType, fc); 1366 pControl->GetOriginalBackgroundColor(iColorType, fc);
1367 if (iColorType > 0) 1367 if (iColorType > 0)
1368 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] ); 1368 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] );
1369 1369
1370 pControl->GetOriginalBorderColor(iColorType, fc); 1370 pControl->GetOriginalBorderColor(iColorType, fc);
1371 if (iColorType > 0) 1371 if (iColorType > 0)
1372 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1372 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1373 1373
1374 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 1374 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
1375 » FX_INT32 nBorderStyle = 0; 1375 » int32_t nBorderStyle = 0;
1376 CPWL_Dash dsBorder(3,0,0); 1376 CPWL_Dash dsBorder(3,0,0);
1377 CPWL_Color crLeftTop,crRightBottom; 1377 CPWL_Color crLeftTop,crRightBottom;
1378 1378
1379 switch (GetBorderStyle()) 1379 switch (GetBorderStyle())
1380 { 1380 {
1381 case BBS_DASH: 1381 case BBS_DASH:
1382 nBorderStyle = PBS_DASH; 1382 nBorderStyle = PBS_DASH;
1383 dsBorder = CPWL_Dash(3, 3, 0); 1383 dsBorder = CPWL_Dash(3, 3, 0);
1384 break; 1384 break;
1385 case BBS_BEVELED: 1385 case BBS_BEVELED:
(...skipping 19 matching lines...) Expand all
1405 CPDF_Rect rcWindow = GetRotatedRect(); 1405 CPDF_Rect rcWindow = GetRotatedRect();
1406 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth); 1406 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth);
1407 1407
1408 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance(); 1408 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
1409 if (da.HasColor()) 1409 if (da.HasColor())
1410 { 1410 {
1411 da.GetColor(iColorType, fc); 1411 da.GetColor(iColorType, fc);
1412 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1412 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1413 } 1413 }
1414 1414
1415 » FX_INT32 nStyle = 0; 1415 » int32_t nStyle = 0;
1416 1416
1417 CFX_WideString csWCaption = pControl->GetNormalCaption(); 1417 CFX_WideString csWCaption = pControl->GetNormalCaption();
1418 if (csWCaption.GetLength() > 0) 1418 if (csWCaption.GetLength() > 0)
1419 { 1419 {
1420 switch (csWCaption[0]) 1420 switch (csWCaption[0])
1421 { 1421 {
1422 case L'l': 1422 case L'l':
1423 nStyle = PCS_CIRCLE; 1423 nStyle = PCS_CIRCLE;
1424 break; 1424 break;
1425 case L'8': 1425 case L'8':
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1497 1497
1498 pControl->GetOriginalBackgroundColor(iColorType, fc); 1498 pControl->GetOriginalBackgroundColor(iColorType, fc);
1499 if (iColorType > 0) 1499 if (iColorType > 0)
1500 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] ); 1500 crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3] );
1501 1501
1502 pControl->GetOriginalBorderColor(iColorType, fc); 1502 pControl->GetOriginalBorderColor(iColorType, fc);
1503 if (iColorType > 0) 1503 if (iColorType > 0)
1504 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1504 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1505 1505
1506 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 1506 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
1507 » FX_INT32 nBorderStyle = 0; 1507 » int32_t nBorderStyle = 0;
1508 CPWL_Dash dsBorder(3,0,0); 1508 CPWL_Dash dsBorder(3,0,0);
1509 CPWL_Color crLeftTop,crRightBottom; 1509 CPWL_Color crLeftTop,crRightBottom;
1510 1510
1511 switch (GetBorderStyle()) 1511 switch (GetBorderStyle())
1512 { 1512 {
1513 case BBS_DASH: 1513 case BBS_DASH:
1514 nBorderStyle = PBS_DASH; 1514 nBorderStyle = PBS_DASH;
1515 dsBorder = CPWL_Dash(3, 3, 0); 1515 dsBorder = CPWL_Dash(3, 3, 0);
1516 break; 1516 break;
1517 case BBS_BEVELED: 1517 case BBS_BEVELED:
(...skipping 19 matching lines...) Expand all
1537 CPDF_Rect rcWindow = GetRotatedRect(); 1537 CPDF_Rect rcWindow = GetRotatedRect();
1538 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth); 1538 CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow, fBorderWidth);
1539 1539
1540 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance(); 1540 CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
1541 if (da.HasColor()) 1541 if (da.HasColor())
1542 { 1542 {
1543 da.GetColor(iColorType, fc); 1543 da.GetColor(iColorType, fc);
1544 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 1544 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
1545 } 1545 }
1546 1546
1547 » FX_INT32 nStyle = 0; 1547 » int32_t nStyle = 0;
1548 1548
1549 CFX_WideString csWCaption = pControl->GetNormalCaption(); 1549 CFX_WideString csWCaption = pControl->GetNormalCaption();
1550 if (csWCaption.GetLength() > 0) 1550 if (csWCaption.GetLength() > 0)
1551 { 1551 {
1552 switch (csWCaption[0]) 1552 switch (csWCaption[0])
1553 { 1553 {
1554 default: //L'l': 1554 default: //L'l':
1555 nStyle = PCS_CIRCLE; 1555 nStyle = PCS_CIRCLE;
1556 break; 1556 break;
1557 case L'8': 1557 case L'8':
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 pEdit->SetAutoFontSize(TRUE); 1699 pEdit->SetAutoFontSize(TRUE);
1700 else 1700 else
1701 pEdit->SetFontSize(fFontSize); 1701 pEdit->SetFontSize(fFontSize);
1702 1702
1703 pEdit->Initialize(); 1703 pEdit->Initialize();
1704 1704
1705 if (sValue) 1705 if (sValue)
1706 pEdit->SetText(sValue); 1706 pEdit->SetText(sValue);
1707 else 1707 else
1708 { 1708 {
1709 » » » FX_INT32 nCurSel = pField->GetSelectedIndex(0); 1709 » » » int32_t nCurSel = pField->GetSelectedIndex(0);
1710 1710
1711 if (nCurSel < 0) 1711 if (nCurSel < 0)
1712 pEdit->SetText(pField->GetValue().c_str()); 1712 pEdit->SetText(pField->GetValue().c_str());
1713 else 1713 else
1714 pEdit->SetText(pField->GetOptionLabel(nCurSel).c _str()); 1714 pEdit->SetText(pField->GetOptionLabel(nCurSel).c _str());
1715 } 1715 }
1716 1716
1717 CPDF_Rect rcContent = pEdit->GetContentRect(); 1717 CPDF_Rect rcContent = pEdit->GetContentRect();
1718 1718
1719 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_P oint(0.0f,0.0f)); 1719 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(pEdit,CPDF_P oint(0.0f,0.0f));
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 if (IsFloatZero(fFontSize)) 1773 if (IsFloatZero(fFontSize))
1774 pEdit->SetFontSize(12.0f); 1774 pEdit->SetFontSize(12.0f);
1775 else 1775 else
1776 pEdit->SetFontSize(fFontSize); 1776 pEdit->SetFontSize(fFontSize);
1777 1777
1778 pEdit->Initialize(); 1778 pEdit->Initialize();
1779 1779
1780 CFX_ByteTextBuf sList; 1780 CFX_ByteTextBuf sList;
1781 FX_FLOAT fy = rcClient.top; 1781 FX_FLOAT fy = rcClient.top;
1782 1782
1783 » » FX_INT32 nTop = pField->GetTopVisibleIndex(); 1783 » » int32_t nTop = pField->GetTopVisibleIndex();
1784 » » FX_INT32 nCount = pField->CountOptions(); 1784 » » int32_t nCount = pField->CountOptions();
1785 » » FX_INT32 nSelCount = pField->CountSelectedItems(); 1785 » » int32_t nSelCount = pField->CountSelectedItems();
1786 1786
1787 » » for (FX_INT32 i=nTop; i<nCount; i++) 1787 » » for (int32_t i=nTop; i<nCount; i++)
1788 { 1788 {
1789 FX_BOOL bSelected = FALSE; 1789 FX_BOOL bSelected = FALSE;
1790 » » » for (FX_INT32 j=0; j<nSelCount; j++) 1790 » » » for (int32_t j=0; j<nSelCount; j++)
1791 { 1791 {
1792 if (pField->GetSelectedIndex(j) == i) 1792 if (pField->GetSelectedIndex(j) == i)
1793 { 1793 {
1794 bSelected = TRUE; 1794 bSelected = TRUE;
1795 break; 1795 break;
1796 } 1796 }
1797 } 1797 }
1798 1798
1799 pEdit->SetText(pField->GetOptionLabel(i).c_str()); 1799 pEdit->SetText(pField->GetOptionLabel(i).c_str());
1800 1800
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1947 switch (GetBorderStyle()) 1947 switch (GetBorderStyle())
1948 { 1948 {
1949 case BBS_SOLID: 1949 case BBS_SOLID:
1950 { 1950 {
1951 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE); 1951 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE);
1952 if (sColor.GetLength() > 0) 1952 if (sColor.GetLength() > 0)
1953 { 1953 {
1954 sLines << "q\n" << GetBorderWidt h() << " w\n" 1954 sLines << "q\n" << GetBorderWidt h() << " w\n"
1955 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n"; 1955 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n";
1956 1956
1957 » » » » » » for (FX_INT32 i=1;i<nMaxLen;i++) 1957 » » » » » » for (int32_t i=1;i<nMaxLen;i++)
1958 { 1958 {
1959 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1959 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1960 << rcClient.bott om << " m\n" 1960 << rcClient.bott om << " m\n"
1961 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1961 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1962 << rcClient.top << " l S\n"; 1962 << rcClient.top << " l S\n";
1963 } 1963 }
1964 1964
1965 sLines << "Q\n"; 1965 sLines << "Q\n";
1966 } 1966 }
1967 } 1967 }
1968 break; 1968 break;
1969 case BBS_DASH: 1969 case BBS_DASH:
1970 { 1970 {
1971 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE); 1971 CFX_ByteString sColor = CPWL_Utils::GetC olorAppStream(GetBorderPWLColor(),FALSE);
1972 if (sColor.GetLength() > 0) 1972 if (sColor.GetLength() > 0)
1973 { 1973 {
1974 CPWL_Dash dsBorder = CPWL_Dash(3 , 3, 0); 1974 CPWL_Dash dsBorder = CPWL_Dash(3 , 3, 0);
1975 1975
1976 sLines << "q\n" << GetBorderWidt h() << " w\n" 1976 sLines << "q\n" << GetBorderWidt h() << " w\n"
1977 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE) 1977 << CPWL_Utils::GetColorA ppStream(GetBorderPWLColor(),FALSE)
1978 << "[" << dsBorder.nDash << " " 1978 << "[" << dsBorder.nDash << " "
1979 << dsBorder.nGap << "] " 1979 << dsBorder.nGap << "] "
1980 << dsBorder.nPhase << " d\n"; 1980 << dsBorder.nPhase << " d\n";
1981 1981
1982 » » » » » » for (FX_INT32 i=1;i<nMaxLen;i++) » » » » » 1982 » » » » » » for (int32_t i=1;i<nMaxLen;i++)» » » » »
1983 { 1983 {
1984 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1984 sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1985 << rcClient.bott om << " m\n" 1985 << rcClient.bott om << " m\n"
1986 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " 1986 << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " "
1987 << rcClient.top << " l S\n"; 1987 << rcClient.top << " l S\n";
1988 } 1988 }
1989 1989
1990 sLines << "Q\n"; 1990 sLines << "Q\n";
1991 } 1991 }
1992 } 1992 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
2052 } 2052 }
2053 2053
2054 CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const 2054 CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const
2055 { 2055 {
2056 CPDF_Rect rcWindow = GetRotatedRect(); 2056 CPDF_Rect rcWindow = GetRotatedRect();
2057 CPWL_Color crBorder = GetBorderPWLColor(); 2057 CPWL_Color crBorder = GetBorderPWLColor();
2058 CPWL_Color crBackground = GetFillPWLColor(); 2058 CPWL_Color crBackground = GetFillPWLColor();
2059 CPWL_Color crLeftTop, crRightBottom; 2059 CPWL_Color crLeftTop, crRightBottom;
2060 2060
2061 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth(); 2061 FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
2062 » FX_INT32 nBorderStyle = 0; 2062 » int32_t nBorderStyle = 0;
2063 CPWL_Dash dsBorder(3,0,0); 2063 CPWL_Dash dsBorder(3,0,0);
2064 2064
2065 switch (GetBorderStyle()) 2065 switch (GetBorderStyle())
2066 { 2066 {
2067 case BBS_DASH: 2067 case BBS_DASH:
2068 nBorderStyle = PBS_DASH; 2068 nBorderStyle = PBS_DASH;
2069 dsBorder = CPWL_Dash(3, 3, 0); 2069 dsBorder = CPWL_Dash(3, 3, 0);
2070 break; 2070 break;
2071 case BBS_BEVELED: 2071 case BBS_BEVELED:
2072 nBorderStyle = PBS_BEVELED; 2072 nBorderStyle = PBS_BEVELED;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const 2127 CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const
2128 { 2128 {
2129 CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0); 2129 CPWL_Color crText = CPWL_Color(COLORTYPE_GRAY, 0);
2130 2130
2131 CPDF_FormControl* pFormCtrl = GetFormControl(); 2131 CPDF_FormControl* pFormCtrl = GetFormControl();
2132 ASSERT(pFormCtrl != NULL); 2132 ASSERT(pFormCtrl != NULL);
2133 2133
2134 CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance(); 2134 CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
2135 if (da.HasColor()) 2135 if (da.HasColor())
2136 { 2136 {
2137 » » FX_INT32 iColorType; 2137 » » int32_t iColorType;
2138 FX_FLOAT fc[4]; 2138 FX_FLOAT fc[4];
2139 da.GetColor(iColorType, fc); 2139 da.GetColor(iColorType, fc);
2140 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 2140 crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
2141 } 2141 }
2142 2142
2143 return crText; 2143 return crText;
2144 } 2144 }
2145 2145
2146 CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const 2146 CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const
2147 { 2147 {
2148 CPWL_Color crBorder; 2148 CPWL_Color crBorder;
2149 2149
2150 CPDF_FormControl* pFormCtrl = GetFormControl(); 2150 CPDF_FormControl* pFormCtrl = GetFormControl();
2151 ASSERT(pFormCtrl != NULL); 2151 ASSERT(pFormCtrl != NULL);
2152 2152
2153 » FX_INT32 iColorType; 2153 » int32_t iColorType;
2154 FX_FLOAT fc[4]; 2154 FX_FLOAT fc[4];
2155 pFormCtrl->GetOriginalBorderColor(iColorType, fc); 2155 pFormCtrl->GetOriginalBorderColor(iColorType, fc);
2156 if (iColorType > 0) 2156 if (iColorType > 0)
2157 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 2157 crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
2158 2158
2159 return crBorder; 2159 return crBorder;
2160 } 2160 }
2161 2161
2162 CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const 2162 CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const
2163 { 2163 {
2164 CPWL_Color crFill; 2164 CPWL_Color crFill;
2165 2165
2166 CPDF_FormControl* pFormCtrl = GetFormControl(); 2166 CPDF_FormControl* pFormCtrl = GetFormControl();
2167 ASSERT(pFormCtrl != NULL); 2167 ASSERT(pFormCtrl != NULL);
2168 2168
2169 » FX_INT32 iColorType; 2169 » int32_t iColorType;
2170 FX_FLOAT fc[4]; 2170 FX_FLOAT fc[4];
2171 pFormCtrl->GetOriginalBackgroundColor(iColorType, fc); 2171 pFormCtrl->GetOriginalBackgroundColor(iColorType, fc);
2172 if (iColorType > 0) 2172 if (iColorType > 0)
2173 crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); 2173 crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
2174 2174
2175 return crFill; 2175 return crFill;
2176 } 2176 }
2177 2177
2178 void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St ream* pImage) 2178 void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St ream* pImage)
2179 { 2179 {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
2254 param.m_bModifier = data.bModifier; 2254 param.m_bModifier = data.bModifier;
2255 param.m_wsNewText = data.sValue; 2255 param.m_wsNewText = data.sValue;
2256 if (data.nSelEnd > data.nSelStart) 2256 if (data.nSelEnd > data.nSelStart)
2257 param.m_wsNewText.Delete(data.nSelStart, data.nSelEnd - data.nSelStart); 2257 param.m_wsNewText.Delete(data.nSelStart, data.nSelEnd - data.nSelStart);
2258 for (int i=data.sChange.GetLength() - 1; i>=0; i --) 2258 for (int i=data.sChange.GetLength() - 1; i>=0; i --)
2259 param.m_wsNewText.Insert(data.nSelStart, data.sChange[i]); 2259 param.m_wsNewText.Insert(data.nSelStart, data.sChange[i]);
2260 param.m_wsPrevText = data.sValue; 2260 param.m_wsPrevText = data.sValue;
2261 2261
2262 CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDat aAcc(hWidget); 2262 CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDat aAcc(hWidget);
2263 param.m_pTarget = pAcc; 2263 param.m_pTarget = pAcc;
2264 » » » » FX_INT32 nRet = pXFAWidgetHandler->ProcessEvent( pAcc, &param); 2264 » » » » int32_t nRet = pXFAWidgetHandler->ProcessEvent(p Acc, &param);
2265 2265
2266 if (IXFA_DocView* pDocView = pDoc->GetXFADocView ()) 2266 if (IXFA_DocView* pDocView = pDoc->GetXFADocView ())
2267 { 2267 {
2268 pDocView->UpdateDocView(); 2268 pDocView->UpdateDocView();
2269 } 2269 }
2270 2270
2271 if (nRet == XFA_EVENTERROR_Sucess) 2271 if (nRet == XFA_EVENTERROR_Sucess)
2272 return TRUE; 2272 return TRUE;
2273 } 2273 }
2274 } 2274 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
2322 2322
2323 2323
2324 CFX_WideString CPDFSDK_Widget::GetAlternateName() const 2324 CFX_WideString CPDFSDK_Widget::GetAlternateName() const
2325 { 2325 {
2326 CPDF_FormField* pFormField = GetFormField(); 2326 CPDF_FormField* pFormField = GetFormField();
2327 ASSERT(pFormField != NULL); 2327 ASSERT(pFormField != NULL);
2328 2328
2329 return pFormField->GetAlternateName(); 2329 return pFormField->GetAlternateName();
2330 } 2330 }
2331 2331
2332 FX_INT32» CPDFSDK_Widget::GetAppearanceAge() const 2332 int32_t»CPDFSDK_Widget::GetAppearanceAge() const
2333 { 2333 {
2334 return m_nAppAge; 2334 return m_nAppAge;
2335 } 2335 }
2336 2336
2337 FX_INT32 CPDFSDK_Widget::GetValueAge() const 2337 int32_t CPDFSDK_Widget::GetValueAge() const
2338 { 2338 {
2339 return m_nValueAge; 2339 return m_nValueAge;
2340 } 2340 }
2341 2341
2342 2342
2343 FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY) 2343 FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY)
2344 { 2344 {
2345 CPDF_Annot* pAnnot = GetPDFAnnot(); 2345 CPDF_Annot* pAnnot = GetPDFAnnot();
2346 CFX_FloatRect annotRect; 2346 CFX_FloatRect annotRect;
2347 pAnnot->GetRect(annotRect); 2347 pAnnot->GetRect(annotRect);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2659 pStreamDict->SetAt("BBox", pBBox); 2659 pStreamDict->SetAt("BBox", pBBox);
2660 pBBox->AddInteger(0); 2660 pBBox->AddInteger(0);
2661 pBBox->AddInteger(0); 2661 pBBox->AddInteger(0);
2662 pBBox->AddInteger(nWidth); 2662 pBBox->AddInteger(nWidth);
2663 pBBox->AddInteger(nHeight); 2663 pBBox->AddInteger(nHeight);
2664 pStreamDict->SetAtInteger("FormType", 1); 2664 pStreamDict->SetAtInteger("FormType", 1);
2665 2665
2666 pRetStream = new CPDF_Stream(NULL, 0, NULL); 2666 pRetStream = new CPDF_Stream(NULL, 0, NULL);
2667 CFX_ByteString csStream; 2667 CFX_ByteString csStream;
2668 csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidt h, nHeight); 2668 csStream.Format("q\n%d 0 0 %d 0 0 cm\n/Img Do\nQ", nWidt h, nHeight);
2669 » » » pRetStream->InitStream((FX_BYTE*)csStream.c_str(), csStr eam.GetLength(), pStreamDict); 2669 » » » pRetStream->InitStream((uint8_t*)csStream.c_str(), csStr eam.GetLength(), pStreamDict);
2670 pDocument->AddIndirectObject(pRetStream); 2670 pDocument->AddIndirectObject(pRetStream);
2671 } 2671 }
2672 2672
2673 delete pBmp; 2673 delete pBmp;
2674 } 2674 }
2675 2675
2676 return pRetStream; 2676 return pRetStream;
2677 } 2677 }
2678 #endif 2678 #endif
2679 2679
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
3106 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b .GetLength()); 3106 fdfEncodedData = fdfEncodedData<<name_b.GetBuffer(name_b .GetLength());
3107 name_b.ReleaseBuffer(); 3107 name_b.ReleaseBuffer();
3108 fdfEncodedData = fdfEncodedData<<"="; 3108 fdfEncodedData = fdfEncodedData<<"=";
3109 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV alue_b.GetLength()); 3109 fdfEncodedData = fdfEncodedData<<csValue_b.GetBuffer(csV alue_b.GetLength());
3110 csValue_b.ReleaseBuffer(); 3110 csValue_b.ReleaseBuffer();
3111 if(i != pFields->GetCount()-1) 3111 if(i != pFields->GetCount()-1)
3112 fdfEncodedData = fdfEncodedData<<"&"; 3112 fdfEncodedData = fdfEncodedData<<"&";
3113 } 3113 }
3114 3114
3115 nBufSize = fdfEncodedData.GetLength(); 3115 nBufSize = fdfEncodedData.GetLength();
3116 » » pBuf = FX_Alloc(FX_BYTE, nBufSize); 3116 » » pBuf = FX_Alloc(uint8_t, nBufSize);
3117 FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize); 3117 FXSYS_memcpy(pBuf, fdfEncodedData.GetBuffer(), nBufSize);
3118 } 3118 }
3119 return TRUE; 3119 return TRUE;
3120 } 3120 }
3121 3121
3122 FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,F X_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf) 3122 FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,F X_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf)
3123 { 3123 {
3124 ASSERT(m_pDocument != NULL); 3124 ASSERT(m_pDocument != NULL);
3125 ASSERT(m_pInterForm != NULL); 3125 ASSERT(m_pInterForm != NULL);
3126 3126
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
3776 3776
3777 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot(); 3777 CPDF_Annot* pPDFAnnot = pAnnot->GetPDFAnnot();
3778 ASSERT(pPDFAnnot != NULL); 3778 ASSERT(pPDFAnnot != NULL);
3779 3779
3780 CPDF_Rect rcAnnot; 3780 CPDF_Rect rcAnnot;
3781 pPDFAnnot->GetRect(rcAnnot); 3781 pPDFAnnot->GetRect(rcAnnot);
3782 3782
3783 return rcAnnot; 3783 return rcAnnot;
3784 } 3784 }
3785 3785
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_baseannot.cpp ('k') | fpdfsdk/src/fsdk_mgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698