diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-03 11:11:16 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-03 17:21:40 +0000 |
commit | cbd4410908e2a4898fdd5e0d6d17591fc2c71f54 (patch) | |
tree | 85ee81736d4c8de97e117a6500fafe6ac3c726fb /xfa/fxfa/cxfa_fftext.cpp | |
parent | cf3d40d10276686f972761bafd005a7715f6eb1c (diff) | |
download | pdfium-cbd4410908e2a4898fdd5e0d6d17591fc2c71f54.tar.xz |
Fold CXFA_MarginData into CXFA_Marginchromium/3311
This CL removes the CXFA_MarginData wrapper and moves the methods
directly to CXFA_Margin.
Change-Id: I7c9e979fb78d0d356605f1318489daabcb8c32cd
Reviewed-on: https://pdfium-review.googlesource.com/22110
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_fftext.cpp')
-rw-r--r-- | xfa/fxfa/cxfa_fftext.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/xfa/fxfa/cxfa_fftext.cpp b/xfa/fxfa/cxfa_fftext.cpp index 606c22e130..46a58c24c9 100644 --- a/xfa/fxfa/cxfa_fftext.cpp +++ b/xfa/fxfa/cxfa_fftext.cpp @@ -17,6 +17,7 @@ #include "xfa/fxfa/cxfa_pieceline.h" #include "xfa/fxfa/cxfa_textlayout.h" #include "xfa/fxfa/cxfa_textpiece.h" +#include "xfa/fxfa/parser/cxfa_margin.h" #include "xfa/fxgraphics/cxfa_graphics.h" CXFA_FFText::CXFA_FFText(CXFA_WidgetAcc* pDataAcc) : CXFA_FFDraw(pDataAcc) {} @@ -40,21 +41,21 @@ void CXFA_FFText::RenderWidget(CXFA_Graphics* pGS, CFX_RenderDevice* pRenderDevice = pGS->GetRenderDevice(); CFX_RectF rtText = GetRectWithoutRotate(); - CXFA_MarginData marginData = m_pDataAcc->GetMarginData(); - if (marginData.HasValidNode()) { + CXFA_Margin* margin = m_pDataAcc->GetMargin(); + if (margin) { CXFA_LayoutItem* pItem = this; if (!pItem->GetPrev() && !pItem->GetNext()) { - XFA_RectWidthoutMargin(rtText, marginData); + XFA_RectWidthoutMargin(rtText, margin); } else { float fTopInset = 0; float fBottomInset = 0; if (!pItem->GetPrev()) - fTopInset = marginData.GetTopInset(); + fTopInset = margin->GetTopInset(); else if (!pItem->GetNext()) - fBottomInset = marginData.GetBottomInset(); + fBottomInset = margin->GetBottomInset(); - rtText.Deflate(marginData.GetLeftInset(), fTopInset, - marginData.GetRightInset(), fBottomInset); + rtText.Deflate(margin->GetLeftInset(), fTopInset, margin->GetRightInset(), + fBottomInset); } } @@ -85,12 +86,12 @@ bool CXFA_FFText::PerformLayout() { pItem = pItem->GetFirst(); while (pItem) { CFX_RectF rtText = pItem->GetRect(false); - CXFA_MarginData marginData = m_pDataAcc->GetMarginData(); - if (marginData.HasValidNode()) { + CXFA_Margin* margin = m_pDataAcc->GetMargin(); + if (margin) { if (!pItem->GetPrev()) - rtText.height -= marginData.GetTopInset(); + rtText.height -= margin->GetTopInset(); else if (!pItem->GetNext()) - rtText.height -= marginData.GetBottomInset(); + rtText.height -= margin->GetBottomInset(); } pTextLayout->ItemBlocks(rtText, pItem->GetIndex()); pItem = pItem->GetNext(); |