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_textlayout.h" | 7 #include "xfa/fxfa/app/xfa_textlayout.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 pXMLElement->GetLocalTagName(wsName); | 276 pXMLElement->GetLocalTagName(wsName); |
277 tagProvider.SetTagNameObj(wsName); | 277 tagProvider.SetTagNameObj(wsName); |
278 uint32_t dwHashCode = FX_HashCode_GetW(wsName.AsStringC(), true); | 278 uint32_t dwHashCode = FX_HashCode_GetW(wsName.AsStringC(), true); |
279 static const int32_t s_iCount = sizeof(s_XFATagName) / sizeof(uint32_t); | 279 static const int32_t s_iCount = sizeof(s_XFATagName) / sizeof(uint32_t); |
280 CFX_DSPATemplate<uint32_t> lookup; | 280 CFX_DSPATemplate<uint32_t> lookup; |
281 tagProvider.m_bTagAviliable = | 281 tagProvider.m_bTagAviliable = |
282 lookup.Lookup(dwHashCode, s_XFATagName, s_iCount) > -1; | 282 lookup.Lookup(dwHashCode, s_XFATagName, s_iCount) > -1; |
283 CFX_WideString wsValue; | 283 CFX_WideString wsValue; |
284 pXMLElement->GetString(FX_WSTRC(L"style").c_str(), wsValue); | 284 pXMLElement->GetString(FX_WSTRC(L"style").c_str(), wsValue); |
285 if (!wsValue.IsEmpty()) { | 285 if (!wsValue.IsEmpty()) { |
286 tagProvider.SetAttribute(FX_WSTRC(L"style"), wsValue); | 286 tagProvider.SetAttribute(L"style", wsValue); |
287 } | 287 } |
288 } else if (pXMLNode->GetType() == FDE_XMLNODE_Text) { | 288 } else if (pXMLNode->GetType() == FDE_XMLNODE_Text) { |
289 tagProvider.m_bTagAviliable = TRUE; | 289 tagProvider.m_bTagAviliable = TRUE; |
290 tagProvider.m_bContent = TRUE; | 290 tagProvider.m_bContent = TRUE; |
291 } | 291 } |
292 } | 292 } |
293 | 293 |
294 int32_t CXFA_TextParser::GetVAlign(CXFA_TextProvider* pTextProvider) const { | 294 int32_t CXFA_TextParser::GetVAlign(CXFA_TextProvider* pTextProvider) const { |
295 CXFA_Para para = pTextProvider->GetParaNode(); | 295 CXFA_Para para = pTextProvider->GetParaNode(); |
296 return para ? para.GetVerticalAlign() : XFA_ATTRIBUTEENUM_Top; | 296 return para ? para.GetVerticalAlign() : XFA_ATTRIBUTEENUM_Top; |
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1955 tr.iLength = iLength; | 1955 tr.iLength = iLength; |
1956 tr.fFontSize = pPiece->fFontSize; | 1956 tr.fFontSize = pPiece->fFontSize; |
1957 tr.iBidiLevel = pPiece->iBidiLevel; | 1957 tr.iBidiLevel = pPiece->iBidiLevel; |
1958 tr.iCharRotation = 0; | 1958 tr.iCharRotation = 0; |
1959 tr.wLineBreakChar = L'\n'; | 1959 tr.wLineBreakChar = L'\n'; |
1960 tr.iVerticalScale = pPiece->iVerScale; | 1960 tr.iVerticalScale = pPiece->iVerScale; |
1961 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; | 1961 tr.dwLayoutStyles = FX_RTFLAYOUTSTYLE_ExpandTab; |
1962 tr.iHorizontalScale = pPiece->iHorScale; | 1962 tr.iHorizontalScale = pPiece->iHorScale; |
1963 return TRUE; | 1963 return TRUE; |
1964 } | 1964 } |
OLD | NEW |