summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_textlayout.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-05 12:22:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-05 12:22:15 -0700
commitfc58ad18b7ab32e7b0bb3959b07dbe7538a7cebd (patch)
tree8662b886d373b149fbdd6f5db9570c233cb23ce7 /xfa/fxfa/app/xfa_textlayout.cpp
parentc7a7349cf316af37d4ad4b71c5742159deccbf33 (diff)
downloadpdfium-fc58ad18b7ab32e7b0bb3959b07dbe7538a7cebd.tar.xz
Make down-conversion explicit from CFX_Widetring to CFX_WideStringC.
Companion to https://codereview.chromium.org/1853233002 BUG= Review URL: https://codereview.chromium.org/1857073002
Diffstat (limited to 'xfa/fxfa/app/xfa_textlayout.cpp')
-rw-r--r--xfa/fxfa/app/xfa_textlayout.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp
index 4cbdfd4f8e..cd323633c0 100644
--- a/xfa/fxfa/app/xfa_textlayout.cpp
+++ b/xfa/fxfa/app/xfa_textlayout.cpp
@@ -317,29 +317,26 @@ void CXFA_TextParser::ParseTagInfo(CFDE_XMLNode* pXMLNode,
tagProvider.m_bContent = TRUE;
}
}
+
int32_t CXFA_TextParser::GetVAlgin(CXFA_TextProvider* pTextProvider) const {
- int32_t iAlign = XFA_ATTRIBUTEENUM_Top;
CXFA_Para para = pTextProvider->GetParaNode();
- if (para) {
- iAlign = para.GetVerticalAlign();
- }
- return iAlign;
+ return para ? para.GetVerticalAlign() : XFA_ATTRIBUTEENUM_Top;
}
+
FX_FLOAT CXFA_TextParser::GetTabInterval(IFDE_CSSComputedStyle* pStyle) const {
CFX_WideString wsValue;
- if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"tab-interval"), wsValue)) {
- CXFA_Measurement ms(wsValue);
- return ms.ToUnit(XFA_UNIT_Pt);
- }
+ if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"tab-interval"), wsValue))
+ return CXFA_Measurement(wsValue.AsWideStringC()).ToUnit(XFA_UNIT_Pt);
return 36;
}
+
int32_t CXFA_TextParser::CountTabs(IFDE_CSSComputedStyle* pStyle) const {
CFX_WideString wsValue;
- if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-tab-count"), wsValue)) {
+ if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-tab-count"), wsValue))
return wsValue.GetInteger();
- }
return 0;
}
+
FX_BOOL CXFA_TextParser::IsSpaceRun(IFDE_CSSComputedStyle* pStyle) const {
CFX_WideString wsValue;
if (pStyle && pStyle->GetCustomStyle(FX_WSTRC(L"xfa-spacerun"), wsValue)) {