summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffwidgetacc.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-21 11:06:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 11:06:27 -0700
commitacd0d59e3c09f04bffd178aecd3638d3e189faba (patch)
tree39e30a37353f74aeb775834967eb86779c0bbdcd /xfa/fxfa/app/xfa_ffwidgetacc.cpp
parent4f70b53efb39e9b9b868d99999582282be57fe50 (diff)
downloadpdfium-acd0d59e3c09f04bffd178aecd3638d3e189faba.tar.xz
Cleanup FDE interfaces.
This CL removes IFDE_TextOut, IFDE_Path, IFDE_RenderContext, IFDE_RenderDevice, and IFDE_VisualSetIterator in favour of the concrete classes. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1896893003
Diffstat (limited to 'xfa/fxfa/app/xfa_ffwidgetacc.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index b1214dd685..561db255d8 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -142,7 +142,7 @@ class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData {
}
CXFA_TextLayout* m_pCapTextLayout;
CXFA_TextProvider* m_pCapTextProvider;
- IFDE_TextOut* m_pTextOut;
+ CFDE_TextOut* m_pTextOut;
CFX_FloatArray* m_pFieldSplitArray;
};
class CXFA_TextEditData : public CXFA_FieldLayoutData {
@@ -882,9 +882,12 @@ void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) {
if (wsLast == wcEnter) {
wsText = wsText + wcEnter;
}
- if (!((CXFA_FieldLayoutData*)m_pLayoutData)->m_pTextOut) {
- ((CXFA_FieldLayoutData*)m_pLayoutData)->m_pTextOut = IFDE_TextOut::Create();
- IFDE_TextOut* pTextOut = ((CXFA_FieldLayoutData*)m_pLayoutData)->m_pTextOut;
+
+ CXFA_FieldLayoutData* layoutData =
+ static_cast<CXFA_FieldLayoutData*>(m_pLayoutData);
+ if (!layoutData->m_pTextOut) {
+ layoutData->m_pTextOut = new CFDE_TextOut;
+ CFDE_TextOut* pTextOut = layoutData->m_pTextOut;
pTextOut->SetFont(GetFDEFont());
pTextOut->SetFontSize(fFontSize);
pTextOut->SetLineBreakTolerance(fFontSize * 0.2f);
@@ -895,8 +898,8 @@ void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) {
}
pTextOut->SetStyles(dwStyles);
}
- ((CXFA_FieldLayoutData*)m_pLayoutData)
- ->m_pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), size);
+ layoutData->m_pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(),
+ size);
}
FX_BOOL CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
if (size.x > 0) {