summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_fftext.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-20 22:23:50 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-20 22:23:50 +0000
commit120c19b6a19377c341658c342c4351eccbb59741 (patch)
tree6799a4d504efd2eb1c7a036bf7959a9352c199e4 /xfa/fxfa/cxfa_fftext.cpp
parent2501ae2474c1f097a06634d647de2eb3fb730864 (diff)
downloadpdfium-120c19b6a19377c341658c342c4351eccbb59741.tar.xz
Rename CXFA_MarginData methodschromium/3274
This CL renames the CXFA_MarginData::Get*Inset methods to CXFA_MarginData::Try*Inset to match the fact that they may fail. The default value has been removed and all the callers correctly set the default values. Change-Id: Ib0dc8dc35807b60a0ddc0e5724604cb39845fcea Reviewed-on: https://pdfium-review.googlesource.com/18771 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.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/xfa/fxfa/cxfa_fftext.cpp b/xfa/fxfa/cxfa_fftext.cpp
index 1eac4fd309..6242b8ec17 100644
--- a/xfa/fxfa/cxfa_fftext.cpp
+++ b/xfa/fxfa/cxfa_fftext.cpp
@@ -46,16 +46,16 @@ void CXFA_FFText::RenderWidget(CXFA_Graphics* pGS,
if (!pItem->GetPrev() && !pItem->GetNext()) {
XFA_RectWidthoutMargin(rtText, marginData);
} else {
- float fLeftInset;
- float fRightInset;
+ float fLeftInset = 0;
+ float fRightInset = 0;
float fTopInset = 0;
float fBottomInset = 0;
- marginData.GetLeftInset(fLeftInset);
- marginData.GetRightInset(fRightInset);
+ marginData.TryLeftInset(fLeftInset);
+ marginData.TryRightInset(fRightInset);
if (!pItem->GetPrev())
- marginData.GetTopInset(fTopInset);
+ marginData.TryTopInset(fTopInset);
else if (!pItem->GetNext())
- marginData.GetBottomInset(fBottomInset);
+ marginData.TryBottomInset(fBottomInset);
rtText.Deflate(fLeftInset, fTopInset, fRightInset, fBottomInset);
}
@@ -91,12 +91,12 @@ bool CXFA_FFText::PerformLayout() {
CXFA_MarginData marginData = m_pDataAcc->GetMarginData();
if (marginData.HasValidNode()) {
if (!pItem->GetPrev()) {
- float fTopInset;
- marginData.GetTopInset(fTopInset);
+ float fTopInset = 0;
+ marginData.TryTopInset(fTopInset);
rtText.height -= fTopInset;
} else if (!pItem->GetNext()) {
- float fBottomInset;
- marginData.GetBottomInset(fBottomInset);
+ float fBottomInset = 0;
+ marginData.TryBottomInset(fBottomInset);
rtText.height -= fBottomInset;
}
}