OLD | NEW |
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 "xfa/fxfa/app/xfa_ffwidgetacc.h" | 7 #include "xfa/fxfa/app/xfa_ffwidgetacc.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 } | 192 } |
193 FX_BOOL CXFA_WidgetAcc::ProcessValueChanged() { | 193 FX_BOOL CXFA_WidgetAcc::ProcessValueChanged() { |
194 m_pDocView->AddValidateWidget(this); | 194 m_pDocView->AddValidateWidget(this); |
195 m_pDocView->AddCalculateWidgetAcc(this); | 195 m_pDocView->AddCalculateWidgetAcc(this); |
196 m_pDocView->RunCalculateWidgets(); | 196 m_pDocView->RunCalculateWidgets(); |
197 m_pDocView->RunValidate(); | 197 m_pDocView->RunValidate(); |
198 return TRUE; | 198 return TRUE; |
199 } | 199 } |
200 void CXFA_WidgetAcc::ResetData() { | 200 void CXFA_WidgetAcc::ResetData() { |
201 CFX_WideString wsValue; | 201 CFX_WideString wsValue; |
202 XFA_ELEMENT eUIType = (XFA_ELEMENT)GetUIType(); | 202 XFA_Element eUIType = GetUIType(); |
203 switch (eUIType) { | 203 switch (eUIType) { |
204 case XFA_ELEMENT_ImageEdit: { | 204 case XFA_Element::ImageEdit: { |
205 CXFA_Value imageValue = GetDefaultValue(); | 205 CXFA_Value imageValue = GetDefaultValue(); |
206 CXFA_Image image = imageValue.GetImage(); | 206 CXFA_Image image = imageValue.GetImage(); |
207 CFX_WideString wsContentType, wsHref; | 207 CFX_WideString wsContentType, wsHref; |
208 if (image) { | 208 if (image) { |
209 image.GetContent(wsValue); | 209 image.GetContent(wsValue); |
210 image.GetContentType(wsContentType); | 210 image.GetContentType(wsContentType); |
211 image.GetHref(wsHref); | 211 image.GetHref(wsHref); |
212 } | 212 } |
213 SetImageEdit(wsContentType, wsHref, wsValue); | 213 SetImageEdit(wsContentType, wsHref, wsValue); |
214 } break; | 214 } break; |
215 case XFA_ELEMENT_ExclGroup: { | 215 case XFA_Element::ExclGroup: { |
216 CXFA_Node* pNextChild = m_pNode->GetNodeItem( | 216 CXFA_Node* pNextChild = m_pNode->GetNodeItem( |
217 XFA_NODEITEM_FirstChild, XFA_ObjectType::ContainerNode); | 217 XFA_NODEITEM_FirstChild, XFA_ObjectType::ContainerNode); |
218 while (pNextChild) { | 218 while (pNextChild) { |
219 CXFA_Node* pChild = pNextChild; | 219 CXFA_Node* pChild = pNextChild; |
220 CXFA_WidgetAcc* pAcc = | 220 CXFA_WidgetAcc* pAcc = |
221 static_cast<CXFA_WidgetAcc*>(pChild->GetWidgetData()); | 221 static_cast<CXFA_WidgetAcc*>(pChild->GetWidgetData()); |
222 if (!pAcc) { | 222 if (!pAcc) { |
223 continue; | 223 continue; |
224 } | 224 } |
225 CXFA_Value defValue(NULL); | 225 CXFA_Value defValue(NULL); |
226 if (wsValue.IsEmpty() && (defValue = pAcc->GetDefaultValue())) { | 226 if (wsValue.IsEmpty() && (defValue = pAcc->GetDefaultValue())) { |
227 defValue.GetChildValueContent(wsValue); | 227 defValue.GetChildValueContent(wsValue); |
228 SetValue(wsValue, XFA_VALUEPICTURE_Raw); | 228 SetValue(wsValue, XFA_VALUEPICTURE_Raw); |
229 pAcc->SetValue(wsValue, XFA_VALUEPICTURE_Raw); | 229 pAcc->SetValue(wsValue, XFA_VALUEPICTURE_Raw); |
230 } else { | 230 } else { |
231 CXFA_Node* pItems = pChild->GetChild(0, XFA_ELEMENT_Items); | 231 CXFA_Node* pItems = pChild->GetChild(0, XFA_Element::Items); |
232 if (!pItems) { | 232 if (!pItems) { |
233 continue; | 233 continue; |
234 } | 234 } |
235 CFX_WideString itemText; | 235 CFX_WideString itemText; |
236 if (pItems->CountChildren(XFA_ELEMENT_UNKNOWN) > 1) { | 236 if (pItems->CountChildren(XFA_Element::Unknown) > 1) { |
237 itemText = pItems->GetChild(1, XFA_ELEMENT_UNKNOWN)->GetContent(); | 237 itemText = pItems->GetChild(1, XFA_Element::Unknown)->GetContent(); |
238 } | 238 } |
239 pAcc->SetValue(itemText, XFA_VALUEPICTURE_Raw); | 239 pAcc->SetValue(itemText, XFA_VALUEPICTURE_Raw); |
240 } | 240 } |
241 pNextChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling, | 241 pNextChild = pChild->GetNodeItem(XFA_NODEITEM_NextSibling, |
242 XFA_ObjectType::ContainerNode); | 242 XFA_ObjectType::ContainerNode); |
243 } | 243 } |
244 } break; | 244 } break; |
245 case XFA_ELEMENT_ChoiceList: | 245 case XFA_Element::ChoiceList: |
246 ClearAllSelections(); | 246 ClearAllSelections(); |
247 default: | 247 default: |
248 if (CXFA_Value defValue = GetDefaultValue()) { | 248 if (CXFA_Value defValue = GetDefaultValue()) { |
249 defValue.GetChildValueContent(wsValue); | 249 defValue.GetChildValueContent(wsValue); |
250 } | 250 } |
251 SetValue(wsValue, XFA_VALUEPICTURE_Raw); | 251 SetValue(wsValue, XFA_VALUEPICTURE_Raw); |
252 break; | 252 break; |
253 } | 253 } |
254 } | 254 } |
255 void CXFA_WidgetAcc::SetImageEdit(const CFX_WideString& wsContentType, | 255 void CXFA_WidgetAcc::SetImageEdit(const CFX_WideString& wsContentType, |
(...skipping 18 matching lines...) Expand all Loading... |
274 pHrefNode->SetCData(XFA_ATTRIBUTE_Value, wsHref); | 274 pHrefNode->SetCData(XFA_ATTRIBUTE_Value, wsHref); |
275 } else { | 275 } else { |
276 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); | 276 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); |
277 ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); | 277 ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); |
278 static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"href", wsHref); | 278 static_cast<CFDE_XMLElement*>(pXMLNode)->SetString(L"href", wsHref); |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 CXFA_WidgetAcc* CXFA_WidgetAcc::GetExclGroup() { | 282 CXFA_WidgetAcc* CXFA_WidgetAcc::GetExclGroup() { |
283 CXFA_Node* pExcl = m_pNode->GetNodeItem(XFA_NODEITEM_Parent); | 283 CXFA_Node* pExcl = m_pNode->GetNodeItem(XFA_NODEITEM_Parent); |
284 if (!pExcl || pExcl->GetClassID() != XFA_ELEMENT_ExclGroup) { | 284 if (!pExcl || pExcl->GetClassID() != XFA_Element::ExclGroup) { |
285 return NULL; | 285 return NULL; |
286 } | 286 } |
287 return static_cast<CXFA_WidgetAcc*>(pExcl->GetWidgetData()); | 287 return static_cast<CXFA_WidgetAcc*>(pExcl->GetWidgetData()); |
288 } | 288 } |
289 CXFA_FFDocView* CXFA_WidgetAcc::GetDocView() { | 289 CXFA_FFDocView* CXFA_WidgetAcc::GetDocView() { |
290 return m_pDocView; | 290 return m_pDocView; |
291 } | 291 } |
292 CXFA_FFDoc* CXFA_WidgetAcc::GetDoc() { | 292 CXFA_FFDoc* CXFA_WidgetAcc::GetDoc() { |
293 return m_pDocView->GetDoc(); | 293 return m_pDocView->GetDoc(); |
294 } | 294 } |
295 CXFA_FFApp* CXFA_WidgetAcc::GetApp() { | 295 CXFA_FFApp* CXFA_WidgetAcc::GetApp() { |
296 return GetDoc()->GetApp(); | 296 return GetDoc()->GetApp(); |
297 } | 297 } |
298 IXFA_AppProvider* CXFA_WidgetAcc::GetAppProvider() { | 298 IXFA_AppProvider* CXFA_WidgetAcc::GetAppProvider() { |
299 return GetApp()->GetAppProvider(); | 299 return GetApp()->GetAppProvider(); |
300 } | 300 } |
301 int32_t CXFA_WidgetAcc::ProcessEvent(int32_t iActivity, | 301 int32_t CXFA_WidgetAcc::ProcessEvent(int32_t iActivity, |
302 CXFA_EventParam* pEventParam) { | 302 CXFA_EventParam* pEventParam) { |
303 if (GetClassID() == XFA_ELEMENT_Draw) { | 303 if (GetClassID() == XFA_Element::Draw) { |
304 return XFA_EVENTERROR_NotExist; | 304 return XFA_EVENTERROR_NotExist; |
305 } | 305 } |
306 int32_t iRet = XFA_EVENTERROR_NotExist; | 306 int32_t iRet = XFA_EVENTERROR_NotExist; |
307 CXFA_NodeArray eventArray; | 307 CXFA_NodeArray eventArray; |
308 int32_t iCounts = | 308 int32_t iCounts = |
309 GetEventByActivity(iActivity, eventArray, pEventParam->m_bIsFormReady); | 309 GetEventByActivity(iActivity, eventArray, pEventParam->m_bIsFormReady); |
310 for (int32_t i = 0; i < iCounts; i++) { | 310 for (int32_t i = 0; i < iCounts; i++) { |
311 CXFA_Event event(eventArray[i]); | 311 CXFA_Event event(eventArray[i]); |
312 int32_t result = ProcessEvent(event, pEventParam); | 312 int32_t result = ProcessEvent(event, pEventParam); |
313 if (i == 0) { | 313 if (i == 0) { |
314 iRet = result; | 314 iRet = result; |
315 } else if (result == XFA_EVENTERROR_Success) { | 315 } else if (result == XFA_EVENTERROR_Success) { |
316 iRet = result; | 316 iRet = result; |
317 } | 317 } |
318 } | 318 } |
319 return iRet; | 319 return iRet; |
320 } | 320 } |
321 int32_t CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, | 321 int32_t CXFA_WidgetAcc::ProcessEvent(CXFA_Event& event, |
322 CXFA_EventParam* pEventParam) { | 322 CXFA_EventParam* pEventParam) { |
323 if (!event) { | 323 if (!event) |
324 return XFA_EVENTERROR_NotExist; | 324 return XFA_EVENTERROR_NotExist; |
325 } | 325 |
326 switch (event.GetEventType()) { | 326 switch (event.GetEventType()) { |
327 case XFA_ELEMENT_Execute: | 327 case XFA_Element::Execute: |
328 break; | 328 break; |
329 case XFA_ELEMENT_Script: { | 329 case XFA_Element::Script: { |
330 CXFA_Script script = event.GetScript(); | 330 CXFA_Script script = event.GetScript(); |
331 return ExecuteScript(script, pEventParam); | 331 return ExecuteScript(script, pEventParam); |
332 } break; | 332 } break; |
333 case XFA_ELEMENT_SignData: | 333 case XFA_Element::SignData: |
334 break; | 334 break; |
335 case XFA_ELEMENT_Submit: { | 335 case XFA_Element::Submit: { |
336 CXFA_Submit submit = event.GetSubmit(); | 336 CXFA_Submit submit = event.GetSubmit(); |
337 return GetDoc()->GetDocProvider()->SubmitData(GetDoc(), submit); | 337 return GetDoc()->GetDocProvider()->SubmitData(GetDoc(), submit); |
338 } | 338 } |
339 default: | 339 default: |
340 break; | 340 break; |
341 } | 341 } |
342 return XFA_EVENTERROR_NotExist; | 342 return XFA_EVENTERROR_NotExist; |
343 } | 343 } |
344 | 344 |
345 int32_t CXFA_WidgetAcc::ProcessCalculate() { | 345 int32_t CXFA_WidgetAcc::ProcessCalculate() { |
346 if (GetClassID() == XFA_ELEMENT_Draw) | 346 if (GetClassID() == XFA_Element::Draw) |
347 return XFA_EVENTERROR_NotExist; | 347 return XFA_EVENTERROR_NotExist; |
348 | 348 |
349 CXFA_Calculate calc = GetCalculate(); | 349 CXFA_Calculate calc = GetCalculate(); |
350 if (!calc) | 350 if (!calc) |
351 return XFA_EVENTERROR_NotExist; | 351 return XFA_EVENTERROR_NotExist; |
352 if (GetNode()->IsUserInteractive()) | 352 if (GetNode()->IsUserInteractive()) |
353 return XFA_EVENTERROR_Disabled; | 353 return XFA_EVENTERROR_Disabled; |
354 | 354 |
355 CXFA_EventParam EventParam; | 355 CXFA_EventParam EventParam; |
356 EventParam.m_eType = XFA_EVENT_Calculate; | 356 EventParam.m_eType = XFA_EVENT_Calculate; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 pAppProvider->LoadString(XFA_IDS_ValidateError, wsError); | 562 pAppProvider->LoadString(XFA_IDS_ValidateError, wsError); |
563 wsMessage.Format(wsError.c_str(), wsCaptionName.c_str()); | 563 wsMessage.Format(wsError.c_str(), wsCaptionName.c_str()); |
564 return; | 564 return; |
565 } | 565 } |
566 CFX_WideString wsWarning; | 566 CFX_WideString wsWarning; |
567 pAppProvider->LoadString(XFA_IDS_ValidateWarning, wsWarning); | 567 pAppProvider->LoadString(XFA_IDS_ValidateWarning, wsWarning); |
568 wsMessage.Format(wsWarning.c_str(), wsCaptionName.c_str(), | 568 wsMessage.Format(wsWarning.c_str(), wsCaptionName.c_str(), |
569 wsCaptionName.c_str()); | 569 wsCaptionName.c_str()); |
570 } | 570 } |
571 int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) { | 571 int32_t CXFA_WidgetAcc::ProcessValidate(int32_t iFlags) { |
572 if (GetClassID() == XFA_ELEMENT_Draw) { | 572 if (GetClassID() == XFA_Element::Draw) { |
573 return XFA_EVENTERROR_NotExist; | 573 return XFA_EVENTERROR_NotExist; |
574 } | 574 } |
575 CXFA_Validate validate = GetValidate(); | 575 CXFA_Validate validate = GetValidate(); |
576 if (!validate) { | 576 if (!validate) { |
577 return XFA_EVENTERROR_NotExist; | 577 return XFA_EVENTERROR_NotExist; |
578 } | 578 } |
579 FX_BOOL bInitDoc = validate.GetNode()->NeedsInitApp(); | 579 FX_BOOL bInitDoc = validate.GetNode()->NeedsInitApp(); |
580 FX_BOOL bStatus = | 580 FX_BOOL bStatus = |
581 m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End; | 581 m_pDocView->GetLayoutStatus() < XFA_DOCVIEW_LAYOUTSTATUS_End; |
582 int32_t iFormat = 0; | 582 int32_t iFormat = 0; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 pLayout = pWidget->GetNext(); | 704 pLayout = pWidget->GetNext(); |
705 } else { | 705 } else { |
706 pLayout = m_pDocView->GetXFALayout()->GetLayoutItem(m_pNode); | 706 pLayout = m_pDocView->GetXFALayout()->GetLayoutItem(m_pNode); |
707 } | 707 } |
708 return static_cast<CXFA_FFWidget*>(pLayout); | 708 return static_cast<CXFA_FFWidget*>(pLayout); |
709 } | 709 } |
710 void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { | 710 void CXFA_WidgetAcc::UpdateUIDisplay(CXFA_FFWidget* pExcept) { |
711 CXFA_FFWidget* pWidget = NULL; | 711 CXFA_FFWidget* pWidget = NULL; |
712 while ((pWidget = GetNextWidget(pWidget)) != nullptr) { | 712 while ((pWidget = GetNextWidget(pWidget)) != nullptr) { |
713 if (pWidget == pExcept || !pWidget->IsLoaded() || | 713 if (pWidget == pExcept || !pWidget->IsLoaded() || |
714 (GetUIType() != XFA_ELEMENT_CheckButton && pWidget->IsFocused())) { | 714 (GetUIType() != XFA_Element::CheckButton && pWidget->IsFocused())) { |
715 continue; | 715 continue; |
716 } | 716 } |
717 pWidget->UpdateFWLData(); | 717 pWidget->UpdateFWLData(); |
718 pWidget->AddInvalidateRect(); | 718 pWidget->AddInvalidateRect(); |
719 } | 719 } |
720 } | 720 } |
721 | 721 |
722 void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) { | 722 void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) { |
723 CXFA_Caption caption = GetCaption(); | 723 CXFA_Caption caption = GetCaption(); |
724 if (!caption || caption.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { | 724 if (!caption || caption.GetPresence() != XFA_ATTRIBUTEENUM_Visible) { |
725 return; | 725 return; |
726 } | 726 } |
727 LoadCaption(); | 727 LoadCaption(); |
728 XFA_ELEMENT eUIType = (XFA_ELEMENT)GetUIType(); | 728 XFA_Element eUIType = GetUIType(); |
729 int32_t iCapPlacement = caption.GetPlacementType(); | 729 int32_t iCapPlacement = caption.GetPlacementType(); |
730 FX_FLOAT fCapReserve = caption.GetReserve(); | 730 FX_FLOAT fCapReserve = caption.GetReserve(); |
731 const bool bVert = iCapPlacement == XFA_ATTRIBUTEENUM_Top || | 731 const bool bVert = iCapPlacement == XFA_ATTRIBUTEENUM_Top || |
732 iCapPlacement == XFA_ATTRIBUTEENUM_Bottom; | 732 iCapPlacement == XFA_ATTRIBUTEENUM_Bottom; |
733 const bool bReserveExit = fCapReserve > 0.01; | 733 const bool bReserveExit = fCapReserve > 0.01; |
734 CXFA_TextLayout* pCapTextLayout = | 734 CXFA_TextLayout* pCapTextLayout = |
735 static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()) | 735 static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()) |
736 ->m_pCapTextLayout.get(); | 736 ->m_pCapTextLayout.get(); |
737 if (pCapTextLayout) { | 737 if (pCapTextLayout) { |
738 if (!bVert && eUIType != XFA_ELEMENT_Button) { | 738 if (!bVert && eUIType != XFA_Element::Button) { |
739 szCap.x = fCapReserve; | 739 szCap.x = fCapReserve; |
740 } | 740 } |
741 CFX_SizeF minSize; | 741 CFX_SizeF minSize; |
742 pCapTextLayout->CalcSize(minSize, szCap, szCap); | 742 pCapTextLayout->CalcSize(minSize, szCap, szCap); |
743 if (bReserveExit) { | 743 if (bReserveExit) { |
744 bVert ? szCap.y = fCapReserve : szCap.x = fCapReserve; | 744 bVert ? szCap.y = fCapReserve : szCap.x = fCapReserve; |
745 } | 745 } |
746 } else { | 746 } else { |
747 FX_FLOAT fFontSize = 10.0f; | 747 FX_FLOAT fFontSize = 10.0f; |
748 if (CXFA_Font font = caption.GetFont()) { | 748 if (CXFA_Font font = caption.GetFont()) { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
856 CXFA_FieldLayoutData* layoutData = | 856 CXFA_FieldLayoutData* layoutData = |
857 static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()); | 857 static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get()); |
858 if (!layoutData->m_pTextOut) { | 858 if (!layoutData->m_pTextOut) { |
859 layoutData->m_pTextOut.reset(new CFDE_TextOut); | 859 layoutData->m_pTextOut.reset(new CFDE_TextOut); |
860 CFDE_TextOut* pTextOut = layoutData->m_pTextOut.get(); | 860 CFDE_TextOut* pTextOut = layoutData->m_pTextOut.get(); |
861 pTextOut->SetFont(GetFDEFont()); | 861 pTextOut->SetFont(GetFDEFont()); |
862 pTextOut->SetFontSize(fFontSize); | 862 pTextOut->SetFontSize(fFontSize); |
863 pTextOut->SetLineBreakTolerance(fFontSize * 0.2f); | 863 pTextOut->SetLineBreakTolerance(fFontSize * 0.2f); |
864 pTextOut->SetLineSpace(GetLineHeight()); | 864 pTextOut->SetLineSpace(GetLineHeight()); |
865 uint32_t dwStyles = FDE_TTOSTYLE_LastLineHeight; | 865 uint32_t dwStyles = FDE_TTOSTYLE_LastLineHeight; |
866 if (GetUIType() == XFA_ELEMENT_TextEdit && IsMultiLine()) { | 866 if (GetUIType() == XFA_Element::TextEdit && IsMultiLine()) { |
867 dwStyles |= FDE_TTOSTYLE_LineWrap; | 867 dwStyles |= FDE_TTOSTYLE_LineWrap; |
868 } | 868 } |
869 pTextOut->SetStyles(dwStyles); | 869 pTextOut->SetStyles(dwStyles); |
870 } | 870 } |
871 layoutData->m_pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), | 871 layoutData->m_pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), |
872 size); | 872 size); |
873 } | 873 } |
874 FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { | 874 FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) { |
875 if (size.x > 0) { | 875 if (size.x > 0) { |
876 CFX_SizeF szOrz = size; | 876 CFX_SizeF szOrz = size; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 FX_FLOAT fTopInset, fBottomInset; | 1080 FX_FLOAT fTopInset, fBottomInset; |
1081 mgWidget.GetTopInset(fTopInset); | 1081 mgWidget.GetTopInset(fTopInset); |
1082 mgWidget.GetBottomInset(fBottomInset); | 1082 mgWidget.GetBottomInset(fBottomInset); |
1083 fHeightCalc -= fTopInset + fBottomInset; | 1083 fHeightCalc -= fTopInset + fBottomInset; |
1084 } | 1084 } |
1085 return fHeightCalc; | 1085 return fHeightCalc; |
1086 } | 1086 } |
1087 void CXFA_WidgetAcc::StartWidgetLayout(FX_FLOAT& fCalcWidth, | 1087 void CXFA_WidgetAcc::StartWidgetLayout(FX_FLOAT& fCalcWidth, |
1088 FX_FLOAT& fCalcHeight) { | 1088 FX_FLOAT& fCalcHeight) { |
1089 InitLayoutData(); | 1089 InitLayoutData(); |
1090 XFA_ELEMENT eUIType = GetUIType(); | 1090 XFA_Element eUIType = GetUIType(); |
1091 if (eUIType == XFA_ELEMENT_Text) { | 1091 if (eUIType == XFA_Element::Text) { |
1092 m_pLayoutData->m_fWidgetHeight = -1; | 1092 m_pLayoutData->m_fWidgetHeight = -1; |
1093 GetHeight(m_pLayoutData->m_fWidgetHeight); | 1093 GetHeight(m_pLayoutData->m_fWidgetHeight); |
1094 StartTextLayout(fCalcWidth, fCalcHeight); | 1094 StartTextLayout(fCalcWidth, fCalcHeight); |
1095 return; | 1095 return; |
1096 } | 1096 } |
1097 if (fCalcWidth > 0 && fCalcHeight > 0) { | 1097 if (fCalcWidth > 0 && fCalcHeight > 0) { |
1098 return; | 1098 return; |
1099 } | 1099 } |
1100 m_pLayoutData->m_fWidgetHeight = -1; | 1100 m_pLayoutData->m_fWidgetHeight = -1; |
1101 FX_FLOAT fWidth = 0; | 1101 FX_FLOAT fWidth = 0; |
1102 if (fCalcWidth > 0 && fCalcHeight < 0) { | 1102 if (fCalcWidth > 0 && fCalcHeight < 0) { |
1103 if (!GetHeight(fCalcHeight)) { | 1103 if (!GetHeight(fCalcHeight)) { |
1104 CalculateAccWidthAndHeight(eUIType, fCalcWidth, fCalcHeight); | 1104 CalculateAccWidthAndHeight(eUIType, fCalcWidth, fCalcHeight); |
1105 } | 1105 } |
1106 m_pLayoutData->m_fWidgetHeight = fCalcHeight; | 1106 m_pLayoutData->m_fWidgetHeight = fCalcHeight; |
1107 return; | 1107 return; |
1108 } | 1108 } |
1109 if (fCalcWidth < 0 && fCalcHeight < 0) { | 1109 if (fCalcWidth < 0 && fCalcHeight < 0) { |
1110 if (!GetWidth(fWidth) || !GetHeight(fCalcHeight)) { | 1110 if (!GetWidth(fWidth) || !GetHeight(fCalcHeight)) { |
1111 CalculateAccWidthAndHeight(eUIType, fWidth, fCalcHeight); | 1111 CalculateAccWidthAndHeight(eUIType, fWidth, fCalcHeight); |
1112 } | 1112 } |
1113 fCalcWidth = fWidth; | 1113 fCalcWidth = fWidth; |
1114 } | 1114 } |
1115 m_pLayoutData->m_fWidgetHeight = fCalcHeight; | 1115 m_pLayoutData->m_fWidgetHeight = fCalcHeight; |
1116 } | 1116 } |
1117 void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_ELEMENT eUIType, | 1117 void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_Element eUIType, |
1118 FX_FLOAT& fWidth, | 1118 FX_FLOAT& fWidth, |
1119 FX_FLOAT& fCalcHeight) { | 1119 FX_FLOAT& fCalcHeight) { |
1120 CFX_SizeF sz(fWidth, m_pLayoutData->m_fWidgetHeight); | 1120 CFX_SizeF sz(fWidth, m_pLayoutData->m_fWidgetHeight); |
1121 switch (eUIType) { | 1121 switch (eUIType) { |
1122 case XFA_ELEMENT_Barcode: | 1122 case XFA_Element::Barcode: |
1123 case XFA_ELEMENT_ChoiceList: | 1123 case XFA_Element::ChoiceList: |
1124 case XFA_ELEMENT_Signature: | 1124 case XFA_Element::Signature: |
1125 CalculateFieldAutoSize(sz); | 1125 CalculateFieldAutoSize(sz); |
1126 break; | 1126 break; |
1127 case XFA_ELEMENT_ImageEdit: | 1127 case XFA_Element::ImageEdit: |
1128 CalculateImageEditAutoSize(sz); | 1128 CalculateImageEditAutoSize(sz); |
1129 break; | 1129 break; |
1130 case XFA_ELEMENT_Button: | 1130 case XFA_Element::Button: |
1131 CalculatePushButtonAutoSize(sz); | 1131 CalculatePushButtonAutoSize(sz); |
1132 break; | 1132 break; |
1133 case XFA_ELEMENT_CheckButton: | 1133 case XFA_Element::CheckButton: |
1134 CalculateCheckButtonAutoSize(sz); | 1134 CalculateCheckButtonAutoSize(sz); |
1135 break; | 1135 break; |
1136 case XFA_ELEMENT_DateTimeEdit: | 1136 case XFA_Element::DateTimeEdit: |
1137 case XFA_ELEMENT_NumericEdit: | 1137 case XFA_Element::NumericEdit: |
1138 case XFA_ELEMENT_PasswordEdit: | 1138 case XFA_Element::PasswordEdit: |
1139 case XFA_ELEMENT_TextEdit: | 1139 case XFA_Element::TextEdit: |
1140 CalculateTextEditAutoSize(sz); | 1140 CalculateTextEditAutoSize(sz); |
1141 break; | 1141 break; |
1142 case XFA_ELEMENT_Image: | 1142 case XFA_Element::Image: |
1143 CalculateImageAutoSize(sz); | 1143 CalculateImageAutoSize(sz); |
1144 break; | 1144 break; |
1145 case XFA_ELEMENT_Arc: | 1145 case XFA_Element::Arc: |
1146 case XFA_ELEMENT_Line: | 1146 case XFA_Element::Line: |
1147 case XFA_ELEMENT_Rectangle: | 1147 case XFA_Element::Rectangle: |
1148 case XFA_ELEMENT_Subform: | 1148 case XFA_Element::Subform: |
1149 case XFA_ELEMENT_ExclGroup: | 1149 case XFA_Element::ExclGroup: |
1150 CalculateWidgetAutoSize(sz); | 1150 CalculateWidgetAutoSize(sz); |
1151 break; | 1151 break; |
1152 default: | 1152 default: |
1153 break; | 1153 break; |
1154 } | 1154 } |
1155 fWidth = sz.x; | 1155 fWidth = sz.x; |
1156 m_pLayoutData->m_fWidgetHeight = sz.y; | 1156 m_pLayoutData->m_fWidgetHeight = sz.y; |
1157 fCalcHeight = sz.y; | 1157 fCalcHeight = sz.y; |
1158 } | 1158 } |
1159 FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, | 1159 FX_BOOL CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, |
1160 FX_FLOAT& fCalcHeight) { | 1160 FX_FLOAT& fCalcHeight) { |
1161 XFA_ELEMENT eUIType = (XFA_ELEMENT)GetUIType(); | 1161 XFA_Element eUIType = GetUIType(); |
1162 if (eUIType == XFA_ELEMENT_Subform) { | 1162 if (eUIType == XFA_Element::Subform) { |
1163 return FALSE; | 1163 return FALSE; |
1164 } | 1164 } |
1165 if (eUIType != XFA_ELEMENT_Text && eUIType != XFA_ELEMENT_TextEdit && | 1165 if (eUIType != XFA_Element::Text && eUIType != XFA_Element::TextEdit && |
1166 eUIType != XFA_ELEMENT_NumericEdit && | 1166 eUIType != XFA_Element::NumericEdit && |
1167 eUIType != XFA_ELEMENT_PasswordEdit) { | 1167 eUIType != XFA_Element::PasswordEdit) { |
1168 fCalcHeight = 0; | 1168 fCalcHeight = 0; |
1169 return TRUE; | 1169 return TRUE; |
1170 } | 1170 } |
1171 FX_FLOAT fTopInset = 0; | 1171 FX_FLOAT fTopInset = 0; |
1172 FX_FLOAT fBottomInset = 0; | 1172 FX_FLOAT fBottomInset = 0; |
1173 if (iBlockIndex == 0) { | 1173 if (iBlockIndex == 0) { |
1174 CXFA_Margin mgWidget = GetMargin(); | 1174 CXFA_Margin mgWidget = GetMargin(); |
1175 if (mgWidget) { | 1175 if (mgWidget) { |
1176 mgWidget.GetTopInset(fTopInset); | 1176 mgWidget.GetTopInset(fTopInset); |
1177 mgWidget.GetBottomInset(fBottomInset); | 1177 mgWidget.GetBottomInset(fBottomInset); |
1178 } | 1178 } |
1179 CFX_RectF rtUIMargin; | 1179 CFX_RectF rtUIMargin; |
1180 GetUIMargin(rtUIMargin); | 1180 GetUIMargin(rtUIMargin); |
1181 fTopInset += rtUIMargin.top; | 1181 fTopInset += rtUIMargin.top; |
1182 fBottomInset += rtUIMargin.width; | 1182 fBottomInset += rtUIMargin.width; |
1183 } | 1183 } |
1184 if (eUIType == XFA_ELEMENT_Text) { | 1184 if (eUIType == XFA_Element::Text) { |
1185 FX_FLOAT fHeight = fCalcHeight; | 1185 FX_FLOAT fHeight = fCalcHeight; |
1186 if (iBlockIndex == 0) { | 1186 if (iBlockIndex == 0) { |
1187 fCalcHeight = fCalcHeight - fTopInset; | 1187 fCalcHeight = fCalcHeight - fTopInset; |
1188 if (fCalcHeight < 0) { | 1188 if (fCalcHeight < 0) { |
1189 fCalcHeight = 0; | 1189 fCalcHeight = 0; |
1190 } | 1190 } |
1191 } | 1191 } |
1192 CXFA_TextLayout* pTextLayout = | 1192 CXFA_TextLayout* pTextLayout = |
1193 static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get())->GetTextLayout(); | 1193 static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get())->GetTextLayout(); |
1194 pTextLayout->DoLayout(iBlockIndex, fCalcHeight, fCalcHeight, | 1194 pTextLayout->DoLayout(iBlockIndex, fCalcHeight, fCalcHeight, |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 } | 1385 } |
1386 } | 1386 } |
1387 fCalcHeight = 0; | 1387 fCalcHeight = 0; |
1388 return TRUE; | 1388 return TRUE; |
1389 } | 1389 } |
1390 void CXFA_WidgetAcc::InitLayoutData() { | 1390 void CXFA_WidgetAcc::InitLayoutData() { |
1391 if (m_pLayoutData) { | 1391 if (m_pLayoutData) { |
1392 return; | 1392 return; |
1393 } | 1393 } |
1394 switch (GetUIType()) { | 1394 switch (GetUIType()) { |
1395 case XFA_ELEMENT_Text: | 1395 case XFA_Element::Text: |
1396 m_pLayoutData.reset(new CXFA_TextLayoutData); | 1396 m_pLayoutData.reset(new CXFA_TextLayoutData); |
1397 return; | 1397 return; |
1398 case XFA_ELEMENT_TextEdit: | 1398 case XFA_Element::TextEdit: |
1399 m_pLayoutData.reset(new CXFA_TextEditData); | 1399 m_pLayoutData.reset(new CXFA_TextEditData); |
1400 return; | 1400 return; |
1401 case XFA_ELEMENT_Image: | 1401 case XFA_Element::Image: |
1402 m_pLayoutData.reset(new CXFA_ImageLayoutData); | 1402 m_pLayoutData.reset(new CXFA_ImageLayoutData); |
1403 return; | 1403 return; |
1404 case XFA_ELEMENT_ImageEdit: | 1404 case XFA_Element::ImageEdit: |
1405 m_pLayoutData.reset(new CXFA_ImageEditData); | 1405 m_pLayoutData.reset(new CXFA_ImageEditData); |
1406 return; | 1406 return; |
1407 default: | 1407 default: |
1408 break; | 1408 break; |
1409 } | 1409 } |
1410 if (GetClassID() == XFA_ELEMENT_Field) { | 1410 if (GetClassID() == XFA_Element::Field) { |
1411 m_pLayoutData.reset(new CXFA_FieldLayoutData); | 1411 m_pLayoutData.reset(new CXFA_FieldLayoutData); |
1412 return; | 1412 return; |
1413 } | 1413 } |
1414 m_pLayoutData.reset(new CXFA_WidgetLayoutData); | 1414 m_pLayoutData.reset(new CXFA_WidgetLayoutData); |
1415 } | 1415 } |
1416 | 1416 |
1417 void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth, | 1417 void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth, |
1418 FX_FLOAT& fCalcHeight) { | 1418 FX_FLOAT& fCalcHeight) { |
1419 LoadText(); | 1419 LoadText(); |
1420 CXFA_TextLayout* pTextLayout = | 1420 CXFA_TextLayout* pTextLayout = |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 } | 1549 } |
1550 FX_ARGB CXFA_WidgetAcc::GetTextColor() { | 1550 FX_ARGB CXFA_WidgetAcc::GetTextColor() { |
1551 if (CXFA_Font font = GetFont()) { | 1551 if (CXFA_Font font = GetFont()) { |
1552 return font.GetColor(); | 1552 return font.GetColor(); |
1553 } | 1553 } |
1554 return 0xFF000000; | 1554 return 0xFF000000; |
1555 } | 1555 } |
1556 CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { | 1556 CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { |
1557 bRichText = FALSE; | 1557 bRichText = FALSE; |
1558 if (m_pTextNode) { | 1558 if (m_pTextNode) { |
1559 if (m_pTextNode->GetClassID() == XFA_ELEMENT_ExData) { | 1559 if (m_pTextNode->GetClassID() == XFA_Element::ExData) { |
1560 CFX_WideString wsContentType; | 1560 CFX_WideString wsContentType; |
1561 m_pTextNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, | 1561 m_pTextNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, |
1562 FALSE); | 1562 FALSE); |
1563 if (wsContentType == FX_WSTRC(L"text/html")) { | 1563 if (wsContentType == FX_WSTRC(L"text/html")) { |
1564 bRichText = TRUE; | 1564 bRichText = TRUE; |
1565 } | 1565 } |
1566 } | 1566 } |
1567 return m_pTextNode; | 1567 return m_pTextNode; |
1568 } | 1568 } |
1569 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { | 1569 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { |
1570 CXFA_Node* pElementNode = m_pWidgetAcc->GetNode(); | 1570 CXFA_Node* pElementNode = m_pWidgetAcc->GetNode(); |
1571 CXFA_Node* pValueNode = pElementNode->GetChild(0, XFA_ELEMENT_Value); | 1571 CXFA_Node* pValueNode = pElementNode->GetChild(0, XFA_Element::Value); |
1572 if (!pValueNode) { | 1572 if (!pValueNode) { |
1573 return NULL; | 1573 return NULL; |
1574 } | 1574 } |
1575 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1575 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
1576 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { | 1576 if (pChildNode && pChildNode->GetClassID() == XFA_Element::ExData) { |
1577 CFX_WideString wsContentType; | 1577 CFX_WideString wsContentType; |
1578 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); | 1578 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); |
1579 if (wsContentType == FX_WSTRC(L"text/html")) { | 1579 if (wsContentType == FX_WSTRC(L"text/html")) { |
1580 bRichText = TRUE; | 1580 bRichText = TRUE; |
1581 } | 1581 } |
1582 } | 1582 } |
1583 return pChildNode; | 1583 return pChildNode; |
1584 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { | 1584 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { |
1585 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); | 1585 CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); |
1586 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); | 1586 CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); |
1587 ASSERT(pXMLNode); | 1587 ASSERT(pXMLNode); |
1588 for (CFDE_XMLNode* pXMLChild = | 1588 for (CFDE_XMLNode* pXMLChild = |
1589 pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); | 1589 pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); |
1590 pXMLChild; | 1590 pXMLChild; |
1591 pXMLChild = pXMLChild->GetNodeItem(CFDE_XMLNode::NextSibling)) { | 1591 pXMLChild = pXMLChild->GetNodeItem(CFDE_XMLNode::NextSibling)) { |
1592 if (pXMLChild->GetType() == FDE_XMLNODE_Element) { | 1592 if (pXMLChild->GetType() == FDE_XMLNODE_Element) { |
1593 CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLChild); | 1593 CFDE_XMLElement* pElement = static_cast<CFDE_XMLElement*>(pXMLChild); |
1594 if (XFA_RecognizeRichText(pElement)) { | 1594 if (XFA_RecognizeRichText(pElement)) { |
1595 bRichText = TRUE; | 1595 bRichText = TRUE; |
1596 } | 1596 } |
1597 } | 1597 } |
1598 } | 1598 } |
1599 return pBind; | 1599 return pBind; |
1600 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) { | 1600 } else if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) { |
1601 CXFA_Node* pCaptionNode = | 1601 CXFA_Node* pCaptionNode = |
1602 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); | 1602 m_pWidgetAcc->GetNode()->GetChild(0, XFA_Element::Caption); |
1603 if (pCaptionNode == NULL) { | 1603 if (pCaptionNode == NULL) { |
1604 return NULL; | 1604 return NULL; |
1605 } | 1605 } |
1606 CXFA_Node* pValueNode = pCaptionNode->GetChild(0, XFA_ELEMENT_Value); | 1606 CXFA_Node* pValueNode = pCaptionNode->GetChild(0, XFA_Element::Value); |
1607 if (pValueNode == NULL) { | 1607 if (pValueNode == NULL) { |
1608 return NULL; | 1608 return NULL; |
1609 } | 1609 } |
1610 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1610 CXFA_Node* pChildNode = pValueNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
1611 if (pChildNode && pChildNode->GetClassID() == XFA_ELEMENT_ExData) { | 1611 if (pChildNode && pChildNode->GetClassID() == XFA_Element::ExData) { |
1612 CFX_WideString wsContentType; | 1612 CFX_WideString wsContentType; |
1613 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); | 1613 pChildNode->GetAttribute(XFA_ATTRIBUTE_ContentType, wsContentType, FALSE); |
1614 if (wsContentType == FX_WSTRC(L"text/html")) { | 1614 if (wsContentType == FX_WSTRC(L"text/html")) { |
1615 bRichText = TRUE; | 1615 bRichText = TRUE; |
1616 } | 1616 } |
1617 } | 1617 } |
1618 return pChildNode; | 1618 return pChildNode; |
1619 } | 1619 } |
1620 CXFA_Node* pItemNode = | 1620 CXFA_Node* pItemNode = |
1621 m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Items); | 1621 m_pWidgetAcc->GetNode()->GetChild(0, XFA_Element::Items); |
1622 if (pItemNode == NULL) { | 1622 if (pItemNode == NULL) { |
1623 return NULL; | 1623 return NULL; |
1624 } | 1624 } |
1625 CXFA_Node* pNode = pItemNode->GetNodeItem(XFA_NODEITEM_FirstChild); | 1625 CXFA_Node* pNode = pItemNode->GetNodeItem(XFA_NODEITEM_FirstChild); |
1626 while (pNode) { | 1626 while (pNode) { |
1627 CFX_WideStringC wsName; | 1627 CFX_WideStringC wsName; |
1628 pNode->TryCData(XFA_ATTRIBUTE_Name, wsName); | 1628 pNode->TryCData(XFA_ATTRIBUTE_Name, wsName); |
1629 if (m_eType == XFA_TEXTPROVIDERTYPE_Rollover && | 1629 if (m_eType == XFA_TEXTPROVIDERTYPE_Rollover && |
1630 wsName == FX_WSTRC(L"rollover")) { | 1630 wsName == FX_WSTRC(L"rollover")) { |
1631 return pNode; | 1631 return pNode; |
1632 } | 1632 } |
1633 if (m_eType == XFA_TEXTPROVIDERTYPE_Down && wsName == FX_WSTRC(L"down")) { | 1633 if (m_eType == XFA_TEXTPROVIDERTYPE_Down && wsName == FX_WSTRC(L"down")) { |
1634 return pNode; | 1634 return pNode; |
1635 } | 1635 } |
1636 pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling); | 1636 pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling); |
1637 } | 1637 } |
1638 return NULL; | 1638 return NULL; |
1639 } | 1639 } |
1640 CXFA_Para CXFA_TextProvider::GetParaNode() { | 1640 CXFA_Para CXFA_TextProvider::GetParaNode() { |
1641 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { | 1641 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { |
1642 return m_pWidgetAcc->GetPara(); | 1642 return m_pWidgetAcc->GetPara(); |
1643 } | 1643 } |
1644 CXFA_Node* pNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); | 1644 CXFA_Node* pNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_Element::Caption); |
1645 return CXFA_Para(pNode->GetChild(0, XFA_ELEMENT_Para)); | 1645 return CXFA_Para(pNode->GetChild(0, XFA_Element::Para)); |
1646 } | 1646 } |
1647 CXFA_Font CXFA_TextProvider::GetFontNode() { | 1647 CXFA_Font CXFA_TextProvider::GetFontNode() { |
1648 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { | 1648 if (m_eType == XFA_TEXTPROVIDERTYPE_Text) { |
1649 return m_pWidgetAcc->GetFont(); | 1649 return m_pWidgetAcc->GetFont(); |
1650 } | 1650 } |
1651 CXFA_Node* pNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_ELEMENT_Caption); | 1651 CXFA_Node* pNode = m_pWidgetAcc->GetNode()->GetChild(0, XFA_Element::Caption); |
1652 pNode = pNode->GetChild(0, XFA_ELEMENT_Font); | 1652 pNode = pNode->GetChild(0, XFA_Element::Font); |
1653 if (pNode) { | 1653 if (pNode) { |
1654 return CXFA_Font(pNode); | 1654 return CXFA_Font(pNode); |
1655 } | 1655 } |
1656 return m_pWidgetAcc->GetFont(); | 1656 return m_pWidgetAcc->GetFont(); |
1657 } | 1657 } |
1658 FX_BOOL CXFA_TextProvider::IsCheckButtonAndAutoWidth() { | 1658 FX_BOOL CXFA_TextProvider::IsCheckButtonAndAutoWidth() { |
1659 XFA_ELEMENT eType = m_pWidgetAcc->GetUIType(); | 1659 XFA_Element eType = m_pWidgetAcc->GetUIType(); |
1660 if (eType == XFA_ELEMENT_CheckButton) { | 1660 if (eType == XFA_Element::CheckButton) { |
1661 FX_FLOAT fWidth = 0; | 1661 FX_FLOAT fWidth = 0; |
1662 return !m_pWidgetAcc->GetWidth(fWidth); | 1662 return !m_pWidgetAcc->GetWidth(fWidth); |
1663 } | 1663 } |
1664 return FALSE; | 1664 return FALSE; |
1665 } | 1665 } |
1666 FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI, | 1666 FX_BOOL CXFA_TextProvider::GetEmbbedObj(FX_BOOL bURI, |
1667 FX_BOOL bRaw, | 1667 FX_BOOL bRaw, |
1668 const CFX_WideString& wsAttr, | 1668 const CFX_WideString& wsAttr, |
1669 CFX_WideString& wsValue) { | 1669 CFX_WideString& wsValue) { |
1670 if (m_eType != XFA_TEXTPROVIDERTYPE_Text) { | 1670 if (m_eType != XFA_TEXTPROVIDERTYPE_Text) { |
(...skipping 16 matching lines...) Expand all Loading... |
1687 if (pIDNode) { | 1687 if (pIDNode) { |
1688 pEmbAcc = static_cast<CXFA_WidgetAcc*>(pIDNode->GetWidgetData()); | 1688 pEmbAcc = static_cast<CXFA_WidgetAcc*>(pIDNode->GetWidgetData()); |
1689 } | 1689 } |
1690 if (pEmbAcc) { | 1690 if (pEmbAcc) { |
1691 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); | 1691 pEmbAcc->GetValue(wsValue, XFA_VALUEPICTURE_Display); |
1692 return TRUE; | 1692 return TRUE; |
1693 } | 1693 } |
1694 } | 1694 } |
1695 return FALSE; | 1695 return FALSE; |
1696 } | 1696 } |
OLD | NEW |