summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_textlayout.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-04 15:43:00 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-04 21:03:11 +0000
commitb7e315c203c2af29ae56c2a6287547bc702c4cd3 (patch)
tree4965b798ff7aa821ebd803458ba7f53bc0d5d039 /xfa/fxfa/cxfa_textlayout.cpp
parent24d779283af803077d8377fbdc49d9d07da335e7 (diff)
downloadpdfium-b7e315c203c2af29ae56c2a6287547bc702c4cd3.tar.xz
Remove CXFA_FFDocView from CXFA_WidgetAcc.
This CL removes the CXFA_FFDocView parameter from CXFA_WidgetAcc and passes in the document to the methods which require a document. Change-Id: I7b264caf0ed89d0453ae0b74c27f2ee0f31f61af Reviewed-on: https://pdfium-review.googlesource.com/22260 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
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;