summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_textlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa/cxfa_textlayout.cpp')
-rw-r--r--xfa/fxfa/cxfa_textlayout.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp
index 6f19e8add1..3be45352f7 100644
--- a/xfa/fxfa/cxfa_textlayout.cpp
+++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -33,8 +33,10 @@
#define XFA_LOADERCNTXTFLG_FILTERSPACE 0x001
-CXFA_TextLayout::CXFA_TextLayout(CXFA_TextProvider* pTextProvider)
+CXFA_TextLayout::CXFA_TextLayout(CXFA_FFDoc* doc,
+ CXFA_TextProvider* pTextProvider)
: m_bHasBlock(false),
+ m_pDoc(doc),
m_pTextProvider(pTextProvider),
m_pTextDataNode(nullptr),
m_bRichText(false),
@@ -96,7 +98,7 @@ std::unique_ptr<CFX_RTFBreak> CXFA_TextLayout::CreateBreak(bool bDefault) {
auto pBreak = pdfium::MakeUnique<CFX_RTFBreak>(dwStyle);
pBreak->SetLineBreakTolerance(1);
- pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, nullptr));
+ pBreak->SetFont(m_textParser.GetFont(m_pDoc, m_pTextProvider, nullptr));
pBreak->SetFontSize(m_textParser.GetFontSize(m_pTextProvider, nullptr));
return pBreak;
}
@@ -158,7 +160,7 @@ void CXFA_TextLayout::InitBreak(float fLineWidth) {
float fFontSize = m_textParser.GetFontSize(m_pTextProvider, nullptr);
m_pBreak->SetFontSize(fFontSize);
- m_pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, nullptr));
+ m_pBreak->SetFont(m_textParser.GetFont(m_pDoc, m_pTextProvider, nullptr));
m_pBreak->SetLineBreakTolerance(fFontSize * 0.2f);
}
@@ -238,7 +240,7 @@ void CXFA_TextLayout::InitBreak(CFX_CSSComputedStyle* pStyle,
float fFontSize = m_textParser.GetFontSize(m_pTextProvider, pStyle);
m_pBreak->SetFontSize(fFontSize);
m_pBreak->SetLineBreakTolerance(fFontSize * 0.2f);
- m_pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, pStyle));
+ m_pBreak->SetFont(m_textParser.GetFont(m_pDoc, m_pTextProvider, pStyle));
m_pBreak->SetHorizontalScale(
m_textParser.GetHorScale(m_pTextProvider, pStyle, pXMLNode));
m_pBreak->SetVerticalScale(m_textParser.GetVerScale(m_pTextProvider, pStyle));
@@ -1031,7 +1033,7 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
m_textParser.GetLinethrough(m_pTextProvider, pStyle.Get(),
pTP->iLineThrough);
pTP->dwColor = m_textParser.GetColor(m_pTextProvider, pStyle.Get());
- pTP->pFont = m_textParser.GetFont(m_pTextProvider, pStyle.Get());
+ pTP->pFont = m_textParser.GetFont(m_pDoc, m_pTextProvider, pStyle.Get());
pTP->fFontSize = m_textParser.GetFontSize(m_pTextProvider, pStyle.Get());
pTP->rtPiece.left = pPiece->m_iStartPos / 20000.0f;
pTP->rtPiece.width = pPiece->m_iWidth / 20000.0f;