summaryrefslogtreecommitdiff
path: root/xfa/src/fwl/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fwl/src/core')
-rw-r--r--xfa/src/fwl/src/core/fwl_formimp.cpp15
-rw-r--r--xfa/src/fwl/src/core/fwl_noteimp.cpp9
-rw-r--r--xfa/src/fwl/src/core/fwl_widgetimp.cpp28
3 files changed, 19 insertions, 33 deletions
diff --git a/xfa/src/fwl/src/core/fwl_formimp.cpp b/xfa/src/fwl/src/core/fwl_formimp.cpp
index b111cbbe28..8622f2081c 100644
--- a/xfa/src/fwl/src/core/fwl_formimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_formimp.cpp
@@ -83,15 +83,10 @@ CFWL_FormImp::CFWL_FormImp(const CFWL_WidgetImpProperties& properties,
m_rtRestore.Reset();
m_rtCaptionText.Reset();
m_rtIcon.Reset();
- m_InfoStart.m_ptStart.Reset();
- m_InfoStart.m_szStart.Reset();
}
CFWL_FormImp::~CFWL_FormImp() {
RemoveSysButtons();
- if (m_pNoteLoop) {
- delete m_pNoteLoop;
- m_pNoteLoop = NULL;
- }
+ delete m_pNoteLoop;
}
FWL_ERR CFWL_FormImp::GetClassName(CFX_WideString& wsClass) const {
wsClass = FWL_CLASS_Form;
@@ -1036,10 +1031,10 @@ void CFWL_FormImpDelegate::OnLButtonDown(CFWL_MsgMouse* pMsg) {
!m_pOwner->m_bMaximized) {
m_pOwner->SetCursor(pMsg->m_fx, pMsg->m_fy);
}
- m_pOwner->m_InfoStart.m_ptStart.Set(pMsg->m_fx, pMsg->m_fy);
- m_pOwner->m_InfoStart.m_szStart.Set(
- m_pOwner->m_pProperties->m_rtWidget.width,
- m_pOwner->m_pProperties->m_rtWidget.height);
+ m_pOwner->m_InfoStart.m_ptStart = CFX_PointF(pMsg->m_fx, pMsg->m_fy);
+ m_pOwner->m_InfoStart.m_szStart =
+ CFX_SizeF(m_pOwner->m_pProperties->m_rtWidget.width,
+ m_pOwner->m_pProperties->m_rtWidget.height);
}
void CFWL_FormImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) {
m_pOwner->SetGrab(FALSE);
diff --git a/xfa/src/fwl/src/core/fwl_noteimp.cpp b/xfa/src/fwl/src/core/fwl_noteimp.cpp
index 9bdb04f1a5..8de329a5cc 100644
--- a/xfa/src/fwl/src/core/fwl_noteimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_noteimp.cpp
@@ -839,9 +839,7 @@ CFX_DIBitmap* CFWL_CoreToopTipDP::GetToolTipIcon(IFWL_Widget* pWidget) {
return NULL;
}
CFX_SizeF CFWL_CoreToopTipDP::GetToolTipIconSize(IFWL_Widget* pWidget) {
- CFX_SizeF sz;
- sz.Set(0, 0);
- return sz;
+ return CFX_SizeF();
}
CFX_RectF CFWL_CoreToopTipDP::GetAnchor() {
return m_fAnchor;
@@ -1007,9 +1005,7 @@ FX_BOOL CFWL_ToolTipContainer::ProcessEnter(CFWL_EvtMouse* pEvt,
m_ToolTipDp->m_wsCaption = wsCaption;
}
CFX_RectF rt;
- rt.Reset();
CFX_SizeF sz;
- sz.Reset();
pCurTarget->GetToolTipSize(sz);
if (sz.x > 0 && sz.y > 0) {
rt.width = sz.x;
@@ -1020,8 +1016,7 @@ FX_BOOL CFWL_ToolTipContainer::ProcessEnter(CFWL_EvtMouse* pEvt,
rt.width = r.width;
rt.height = r.height;
}
- CFX_PointF pt;
- pt.Set(pEvt->m_fx, pEvt->m_fy);
+ CFX_PointF pt(pEvt->m_fx, pEvt->m_fy);
if (pCurTarget->GetToolTipPos(pt) == FWL_ERR_Succeeded) {
rt.left = pt.x;
rt.top = pt.y;
diff --git a/xfa/src/fwl/src/core/fwl_widgetimp.cpp b/xfa/src/fwl/src/core/fwl_widgetimp.cpp
index eb180a19e0..a4678c2c70 100644
--- a/xfa/src/fwl/src/core/fwl_widgetimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_widgetimp.cpp
@@ -652,10 +652,9 @@ CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString& wsText,
IFWL_ThemeProvider* pTheme,
FX_BOOL bMultiLine,
int32_t iLineWidth) {
- CFX_SizeF sz;
- sz.Set(0, 0);
if (!pTheme)
- return sz;
+ return CFX_SizeF();
+
CFWL_ThemeText calPart;
calPart.m_pWidget = m_pInterface;
calPart.m_wsText = wsText;
@@ -669,9 +668,7 @@ CFX_SizeF CFWL_WidgetImp::CalcTextSize(const CFX_WideString& wsText,
: FWL_WGT_CalcWidth;
rect.Set(0, 0, fWidth, FWL_WGT_CalcHeight);
pTheme->CalcTextRect(&calPart, rect);
- sz.x = rect.width;
- sz.y = rect.height;
- return sz;
+ return CFX_SizeF(rect.width, rect.height);
}
void CFWL_WidgetImp::CalcTextRect(const CFX_WideString& wsText,
IFWL_ThemeProvider* pTheme,
@@ -930,22 +927,21 @@ void CFWL_WidgetImp::NotifyDriver() {
pDriver->NotifyTargetDestroy(m_pInterface);
}
CFX_SizeF CFWL_WidgetImp::GetOffsetFromParent(IFWL_Widget* pParent) {
- CFX_SizeF szRet;
- szRet.Set(0, 0);
- if (pParent == GetInterface()) {
- return szRet;
- }
+ if (pParent == GetInterface())
+ return CFX_SizeF();
+
IFWL_WidgetMgr* pWidgetMgr = FWL_GetWidgetMgr();
if (!pWidgetMgr)
- return szRet;
- szRet.x += m_pProperties->m_rtWidget.left;
- szRet.y += m_pProperties->m_rtWidget.top;
+ return CFX_SizeF();
+
+ CFX_SizeF szRet(m_pProperties->m_rtWidget.left,
+ m_pProperties->m_rtWidget.top);
+
IFWL_Widget* pDstWidget = GetParent();
while (pDstWidget && pDstWidget != pParent) {
CFX_RectF rtDst;
pDstWidget->GetWidgetRect(rtDst);
- szRet.x += rtDst.left;
- szRet.y += rtDst.top;
+ szRet += CFX_SizeF(rtDst.left, rtDst.top);
pDstWidget = pWidgetMgr->GetWidget(pDstWidget, FWL_WGTRELATION_Parent);
}
return szRet;