summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_widgetacc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-07 20:49:20 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-07 20:49:20 +0000
commit2a69b9ef97ddf46fe01de432bd0ccc1b7ce92bcb (patch)
treed0138d82b52cc63e0956a12faebf6433dd9303fd /xfa/fxfa/cxfa_widgetacc.cpp
parentc5a729ec5ada8ef0edc3f4d9976e96865f516598 (diff)
downloadpdfium-2a69b9ef97ddf46fe01de432bd0ccc1b7ce92bcb.tar.xz
Rename CXFA_Margin to CXFA_MarginData
This CL renames CXFA_Margin to CXFA_MarginData to reflect the fact this is part of the data hierarchy. Change-Id: I50d82d01fcaf35c621f13b8b68bc04d850ec885a Reviewed-on: https://pdfium-review.googlesource.com/17986 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_widgetacc.cpp')
-rw-r--r--xfa/fxfa/cxfa_widgetacc.cpp87
1 files changed, 47 insertions, 40 deletions
diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp
index c28f6d4185..7453a145b3 100644
--- a/xfa/fxfa/cxfa_widgetacc.cpp
+++ b/xfa/fxfa/cxfa_widgetacc.cpp
@@ -726,12 +726,12 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
szCap.height = fFontSize;
}
}
- if (CXFA_Margin mgCap = captionData.GetMargin()) {
+ if (CXFA_MarginData captionMarginData = captionData.GetMarginData()) {
float fLeftInset, fTopInset, fRightInset, fBottomInset;
- mgCap.GetLeftInset(fLeftInset);
- mgCap.GetTopInset(fTopInset);
- mgCap.GetRightInset(fRightInset);
- mgCap.GetBottomInset(fBottomInset);
+ captionMarginData.GetLeftInset(fLeftInset);
+ captionMarginData.GetTopInset(fTopInset);
+ captionMarginData.GetRightInset(fRightInset);
+ captionMarginData.GetBottomInset(fBottomInset);
if (bReserveExit) {
bVert ? (szCap.width += fLeftInset + fRightInset)
: (szCap.height += fTopInset + fBottomInset);
@@ -770,16 +770,17 @@ bool CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) {
}
bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
- CXFA_Margin mgWidget = GetMargin();
- if (mgWidget) {
+ CXFA_MarginData marginData = GetMarginData();
+ if (marginData) {
float fLeftInset, fTopInset, fRightInset, fBottomInset;
- mgWidget.GetLeftInset(fLeftInset);
- mgWidget.GetTopInset(fTopInset);
- mgWidget.GetRightInset(fRightInset);
- mgWidget.GetBottomInset(fBottomInset);
+ marginData.GetLeftInset(fLeftInset);
+ marginData.GetTopInset(fTopInset);
+ marginData.GetRightInset(fRightInset);
+ marginData.GetBottomInset(fBottomInset);
size.width += fLeftInset + fRightInset;
size.height += fTopInset + fBottomInset;
}
+
CXFA_Para para = GetPara();
if (para)
size.width += para.GetMarginLeft() + para.GetTextIndent();
@@ -864,11 +865,12 @@ bool CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
}
CFX_RectF rtUIMargin = GetUIMargin();
size.width -= rtUIMargin.left + rtUIMargin.width;
- CXFA_Margin mgWidget = GetMargin();
- if (mgWidget) {
- float fLeftInset, fRightInset;
- mgWidget.GetLeftInset(fLeftInset);
- mgWidget.GetRightInset(fRightInset);
+ CXFA_MarginData marginData = GetMarginData();
+ if (marginData) {
+ float fLeftInset;
+ float fRightInset;
+ marginData.GetLeftInset(fLeftInset);
+ marginData.GetRightInset(fRightInset);
size.width -= fLeftInset + fRightInset;
}
CalculateTextContentSize(size);
@@ -1010,11 +1012,12 @@ void CXFA_WidgetAcc::LoadText() {
}
float CXFA_WidgetAcc::CalculateWidgetAutoWidth(float fWidthCalc) {
- CXFA_Margin mgWidget = GetMargin();
- if (mgWidget) {
- float fLeftInset, fRightInset;
- mgWidget.GetLeftInset(fLeftInset);
- mgWidget.GetRightInset(fRightInset);
+ CXFA_MarginData marginData = GetMarginData();
+ if (marginData) {
+ float fLeftInset;
+ float fRightInset;
+ marginData.GetLeftInset(fLeftInset);
+ marginData.GetRightInset(fRightInset);
fWidthCalc += fLeftInset + fRightInset;
}
@@ -1028,22 +1031,24 @@ float CXFA_WidgetAcc::CalculateWidgetAutoWidth(float fWidthCalc) {
}
float CXFA_WidgetAcc::GetWidthWithoutMargin(float fWidthCalc) {
- CXFA_Margin mgWidget = GetMargin();
- if (mgWidget) {
- float fLeftInset, fRightInset;
- mgWidget.GetLeftInset(fLeftInset);
- mgWidget.GetRightInset(fRightInset);
+ CXFA_MarginData marginData = GetMarginData();
+ if (marginData) {
+ float fLeftInset;
+ float fRightInset;
+ marginData.GetLeftInset(fLeftInset);
+ marginData.GetRightInset(fRightInset);
fWidthCalc -= fLeftInset + fRightInset;
}
return fWidthCalc;
}
float CXFA_WidgetAcc::CalculateWidgetAutoHeight(float fHeightCalc) {
- CXFA_Margin mgWidget = GetMargin();
- if (mgWidget) {
- float fTopInset, fBottomInset;
- mgWidget.GetTopInset(fTopInset);
- mgWidget.GetBottomInset(fBottomInset);
+ CXFA_MarginData marginData = GetMarginData();
+ if (marginData) {
+ float fTopInset;
+ float fBottomInset;
+ marginData.GetTopInset(fTopInset);
+ marginData.GetBottomInset(fBottomInset);
fHeightCalc += fTopInset + fBottomInset;
}
@@ -1057,11 +1062,12 @@ float CXFA_WidgetAcc::CalculateWidgetAutoHeight(float fHeightCalc) {
}
float CXFA_WidgetAcc::GetHeightWithoutMargin(float fHeightCalc) {
- CXFA_Margin mgWidget = GetMargin();
- if (mgWidget) {
- float fTopInset, fBottomInset;
- mgWidget.GetTopInset(fTopInset);
- mgWidget.GetBottomInset(fBottomInset);
+ CXFA_MarginData marginData = GetMarginData();
+ if (marginData) {
+ float fTopInset;
+ float fBottomInset;
+ marginData.GetTopInset(fTopInset);
+ marginData.GetBottomInset(fBottomInset);
fHeightCalc -= fTopInset + fBottomInset;
}
return fHeightCalc;
@@ -1155,11 +1161,12 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, float& fCalcHeight) {
float fTopInset = 0;
float fBottomInset = 0;
if (iBlockIndex == 0) {
- CXFA_Margin mgWidget = GetMargin();
- if (mgWidget) {
- mgWidget.GetTopInset(fTopInset);
- mgWidget.GetBottomInset(fBottomInset);
+ CXFA_MarginData marginData = GetMarginData();
+ if (marginData) {
+ marginData.GetTopInset(fTopInset);
+ marginData.GetBottomInset(fBottomInset);
}
+
CFX_RectF rtUIMargin = GetUIMargin();
fTopInset += rtUIMargin.top;
fBottomInset += rtUIMargin.width;