Ejemplo n.º 1
0
FX_BOOL CXFA_FFConfigAcc::GetFontInfo(int32_t index,
                                      CFX_WideString& wsFontFamily,
                                      CFX_WideString& wsPsName,
                                      FX_BOOL bBold,
                                      FX_BOOL bItalic) {
  if (index < 0 || index >= CountChildren()) {
    return FALSE;
  }
  CXFA_Node* pFontNode = m_pPsMapNode->GetChild(index, XFA_ELEMENT_Font);
  if (pFontNode == NULL) {
    return FALSE;
  }
  wsFontFamily.Empty();
  wsPsName.Empty();
  bBold = FALSE;
  bItalic = FALSE;
  pFontNode->GetAttribute(XFA_ATTRIBUTE_Typeface, wsFontFamily);
  pFontNode->GetAttribute(XFA_ATTRIBUTE_PsName, wsPsName);
  CFX_WideString wsValue;
  pFontNode->GetAttribute(XFA_ATTRIBUTE_Weight, wsValue);
  wsValue.MakeLower();
  if (wsValue == FX_WSTRC(L"bold")) {
    bBold = TRUE;
  }
  pFontNode->GetAttribute(XFA_ATTRIBUTE_Posture, wsValue);
  wsValue.MakeLower();
  if (wsValue == FX_WSTRC(L"italic")) {
    bItalic = TRUE;
  }
  return wsFontFamily.GetLength() > 0;
}
Ejemplo n.º 2
0
CXFA_FFWidget* CXFA_FFTabOrderPageWidgetIterator::GetTraverseWidget(
    CXFA_FFWidget* pWidget) {
  CXFA_WidgetAcc* pAcc = pWidget->GetDataAcc();
  CXFA_Node* pTraversal = pAcc->GetNode()->GetChild(0, XFA_Element::Traversal);
  if (pTraversal) {
    CXFA_Node* pTraverse = pTraversal->GetChild(0, XFA_Element::Traverse);
    if (pTraverse) {
      CFX_WideString wsTraverseWidgetName;
      if (pTraverse->GetAttribute(XFA_ATTRIBUTE_Ref, wsTraverseWidgetName)) {
        return FindWidgetByName(wsTraverseWidgetName, pWidget);
      }
    }
  }
  return nullptr;
}