Index: fpdfsdk/src/pdfwindow/PWL_Wnd.cpp |
diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp |
index cf6e6a1709683c2094dde42bfc9019c8f0574778..75e2a59c6e658ae5d9245ed963a6bea4e12b234e 100644 |
--- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp |
+++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp |
@@ -653,24 +653,18 @@ CPDF_Rect CPWL_Wnd::GetClientRect() const |
{ |
CPDF_Rect rcWindow = GetWindowRect(); |
CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth())); |
- |
- if (CPWL_ScrollBar * pVSB = GetVScrollBar()) |
+ if (CPWL_ScrollBar* pVSB = GetVScrollBar()) |
rcClient.right -= pVSB->GetScrollBarWidth(); |
rcClient.Normalize(); |
- |
- if (rcWindow.Contains(rcClient)) |
- return rcClient; |
- else |
- return CPDF_Rect(); |
+ return rcWindow.Contains(rcClient) ? rcClient : CPDF_Rect(); |
} |
CPDF_Point CPWL_Wnd::GetCenterPoint() const |
{ |
CPDF_Rect rcClient = GetClientRect(); |
- |
return CPDF_Point((rcClient.left + rcClient.right) * 0.5f, |
- (rcClient.top + rcClient.bottom) * 0.5f); |
+ (rcClient.top + rcClient.bottom) * 0.5f); |
} |
CPDF_Rect CPWL_Wnd::GetClientCenterSquare() const |
@@ -881,12 +875,12 @@ FX_BOOL CPWL_Wnd::ClientHitTest(const CPDF_Point & point) const |
return IsValid() && IsVisible() && GetClientRect().Contains(point.x,point.y); |
} |
-const CPWL_Wnd * CPWL_Wnd::GetRootWnd() const |
+const CPWL_Wnd* CPWL_Wnd::GetRootWnd() const |
{ |
if (m_sPrivateParam.pParentWnd) |
return m_sPrivateParam.pParentWnd->GetRootWnd(); |
- else |
- return this; |
+ |
+ return this; |
} |
void CPWL_Wnd::SetVisible(FX_BOOL bVisible) |
@@ -1144,12 +1138,10 @@ CPDF_Point CPWL_Wnd::ChildToParent(const CPDF_Point& point) const |
CPDF_Matrix mt = GetChildMatrix(); |
if (mt.IsIdentity()) |
return point; |
- else |
- { |
- CPDF_Point pt = point; |
- mt.Transform(pt.x,pt.y); |
- return pt; |
- } |
+ |
+ CPDF_Point pt = point; |
+ mt.Transform(pt.x,pt.y); |
+ return pt; |
} |
CPDF_Rect CPWL_Wnd::ChildToParent(const CPDF_Rect& rect) const |
@@ -1157,12 +1149,10 @@ CPDF_Rect CPWL_Wnd::ChildToParent(const CPDF_Rect& rect) const |
CPDF_Matrix mt = GetChildMatrix(); |
if (mt.IsIdentity()) |
return rect; |
- else |
- { |
- CPDF_Rect rc = rect; |
- mt.TransformRect(rc); |
- return rc; |
- } |
+ |
+ CPDF_Rect rc = rect; |
+ mt.TransformRect(rc); |
+ return rc; |
} |
CPDF_Point CPWL_Wnd::ParentToChild(const CPDF_Point& point) const |
@@ -1170,13 +1160,11 @@ CPDF_Point CPWL_Wnd::ParentToChild(const CPDF_Point& point) const |
CPDF_Matrix mt = GetChildMatrix(); |
if (mt.IsIdentity()) |
return point; |
- else |
- { |
- mt.SetReverse(mt); |
- CPDF_Point pt = point; |
- mt.Transform(pt.x,pt.y); |
- return pt; |
- } |
+ |
+ mt.SetReverse(mt); |
+ CPDF_Point pt = point; |
+ mt.Transform(pt.x,pt.y); |
+ return pt; |
} |
CPDF_Rect CPWL_Wnd::ParentToChild(const CPDF_Rect& rect) const |
@@ -1184,19 +1172,16 @@ CPDF_Rect CPWL_Wnd::ParentToChild(const CPDF_Rect& rect) const |
CPDF_Matrix mt = GetChildMatrix(); |
if (mt.IsIdentity()) |
return rect; |
- else |
- { |
- mt.SetReverse(mt); |
- CPDF_Rect rc = rect; |
- mt.TransformRect(rc); |
- return rc; |
- } |
+ |
+ mt.SetReverse(mt); |
+ CPDF_Rect rc = rect; |
+ mt.TransformRect(rc); |
+ return rc; |
} |
CPDF_Matrix CPWL_Wnd::GetChildToRoot() const |
{ |
- CPDF_Matrix mt(1,0,0,1,0,0); |
- |
+ CPDF_Matrix mt(1, 0, 0, 1, 0, 0); |
if (HasFlag(PWS_CHILD)) |
{ |
const CPWL_Wnd* pParent = this; |
@@ -1206,7 +1191,6 @@ CPDF_Matrix CPWL_Wnd::GetChildToRoot() const |
pParent = pParent->GetParentWindow(); |
} |
} |
- |
return mt; |
} |