summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_fontdata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/parser/cxfa_fontdata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_fontdata.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/cxfa_fontdata.cpp b/xfa/fxfa/parser/cxfa_fontdata.cpp
index 87bea1714f..afe73538c8 100644
--- a/xfa/fxfa/parser/cxfa_fontdata.cpp
+++ b/xfa/fxfa/parser/cxfa_fontdata.cpp
@@ -20,25 +20,22 @@ float CXFA_FontData::GetBaselineShift() {
}
float CXFA_FontData::GetHorizontalScale() {
- WideString wsValue;
- m_pNode->JSNode()->TryCData(XFA_Attribute::FontHorizontalScale, wsValue,
- true);
+ WideString wsValue =
+ m_pNode->JSNode()->GetCData(XFA_Attribute::FontHorizontalScale);
int32_t iScale = FXSYS_wtoi(wsValue.c_str());
return iScale > 0 ? (float)iScale : 100.0f;
}
float CXFA_FontData::GetVerticalScale() {
- WideString wsValue;
- m_pNode->JSNode()->TryCData(XFA_Attribute::FontVerticalScale, wsValue, true);
+ WideString wsValue =
+ m_pNode->JSNode()->GetCData(XFA_Attribute::FontVerticalScale);
int32_t iScale = FXSYS_wtoi(wsValue.c_str());
return iScale > 0 ? (float)iScale : 100.0f;
}
float CXFA_FontData::GetLetterSpacing() {
- WideString wsValue;
- if (!m_pNode->JSNode()->TryCData(XFA_Attribute::LetterSpacing, wsValue, true))
- return 0;
-
+ WideString wsValue =
+ m_pNode->JSNode()->GetCData(XFA_Attribute::LetterSpacing);
CXFA_Measurement ms(wsValue.AsStringView());
if (ms.GetUnit() == XFA_Unit::Em)
return ms.GetValue() * GetFontSize();
@@ -70,7 +67,7 @@ float CXFA_FontData::GetFontSize() {
}
void CXFA_FontData::GetTypeface(WideString& wsTypeFace) {
- m_pNode->JSNode()->TryCData(XFA_Attribute::Typeface, wsTypeFace, true);
+ wsTypeFace = m_pNode->JSNode()->GetCData(XFA_Attribute::Typeface);
}
bool CXFA_FontData::IsBold() {