summaryrefslogtreecommitdiff
path: root/xfa/fwl/core/cfwl_widget.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-12-07 17:58:41 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 17:58:41 -0800
commit442997cbb3a9e970946dd294acd1498e9fa9bfc7 (patch)
tree99041d1d439501ee4616efa87ee2ab76b3d2fca0 /xfa/fwl/core/cfwl_widget.cpp
parent31559c91c4983b42361415d30b0b2a518c7ef383 (diff)
downloadpdfium-442997cbb3a9e970946dd294acd1498e9fa9bfc7.tar.xz
Cleanup FWL default values part II.
This CL cleans up the remaining default values in the fwl/core directory. Some methods are renamed to better represent what they do. Review-Url: https://codereview.chromium.org/2557103002
Diffstat (limited to 'xfa/fwl/core/cfwl_widget.cpp')
-rw-r--r--xfa/fwl/core/cfwl_widget.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/xfa/fwl/core/cfwl_widget.cpp b/xfa/fwl/core/cfwl_widget.cpp
index 8989563112..2dff10adc7 100644
--- a/xfa/fwl/core/cfwl_widget.cpp
+++ b/xfa/fwl/core/cfwl_widget.cpp
@@ -76,7 +76,7 @@ void CFWL_Widget::GetWidgetRect(CFX_RectF& rect, bool bAutoSize) {
rect.Inflate(fEdge, fEdge);
}
if (HasBorder()) {
- FX_FLOAT fBorder = GetBorderSize();
+ FX_FLOAT fBorder = GetBorderSize(true);
rect.Inflate(fBorder, fBorder);
}
}
@@ -317,7 +317,7 @@ void CFWL_Widget::GetEdgeRect(CFX_RectF& rtEdge) {
rtEdge = m_pProperties->m_rtWidget;
rtEdge.left = rtEdge.top = 0;
if (HasBorder()) {
- FX_FLOAT fCX = GetBorderSize();
+ FX_FLOAT fCX = GetBorderSize(true);
FX_FLOAT fCY = GetBorderSize(false);
rtEdge.Deflate(fCX, fCY);
}
@@ -399,8 +399,7 @@ CFWL_Widget* CFWL_Widget::GetRootOuter() {
CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText,
IFWL_ThemeProvider* pTheme,
- bool bMultiLine,
- int32_t iLineWidth) {
+ bool bMultiLine) {
if (!pTheme)
return CFX_SizeF();
@@ -411,10 +410,8 @@ CFX_SizeF CFWL_Widget::CalcTextSize(const CFX_WideString& wsText,
bMultiLine ? FDE_TTOSTYLE_LineWrap : FDE_TTOSTYLE_SingleLine;
calPart.m_iTTOAlign = FDE_TTOALIGNMENT_TopLeft;
CFX_RectF rect;
- FX_FLOAT fWidth = bMultiLine
- ? (iLineWidth > 0 ? (FX_FLOAT)iLineWidth
- : FWL_WGT_CalcMultiLineDefWidth)
- : FWL_WGT_CalcWidth;
+ FX_FLOAT fWidth =
+ bMultiLine ? FWL_WGT_CalcMultiLineDefWidth : FWL_WGT_CalcWidth;
rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight);
pTheme->CalcTextRect(&calPart, rect);
return CFX_SizeF(rect.width, rect.height);