summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-01-06 14:58:50 -0800
committerLei Zhang <thestig@chromium.org>2016-01-06 14:58:50 -0800
commitcbed99098ad4cdc3f9f260cc1e8521f67c12d35d (patch)
tree4647ee4cc1d8edd615ec641cf597d3985107467d /fpdfsdk/src
parentdcac57bc8b64fdc870d79d11a498ae7021cf8ae7 (diff)
downloadpdfium-cbed99098ad4cdc3f9f260cc1e8521f67c12d35d.tar.xz
Return const-ref object in a few CPWL_Wnd getters.
Also remove a bunch of dead code. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1565803003 .
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Utils.cpp1
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_Wnd.cpp52
2 files changed, 8 insertions, 45 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
index 2c9ec99dc8..3b0f3beff9 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp
@@ -1469,7 +1469,6 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
const CPWL_Color& crLeftTop,
const CPWL_Color& crRightBottom,
int32_t nStyle,
- const CPWL_Dash& dash,
int32_t nTransparancy) {
FX_FLOAT fLeft = rect.left;
FX_FLOAT fRight = rect.right;
diff --git a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
index 5bedad127a..d0aaa78ea4 100644
--- a/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_Wnd.cpp
@@ -302,14 +302,6 @@ void CPWL_Wnd::InvalidateRectMove(const CPDF_Rect& rcOld,
InvalidateRect(&rcUnion);
}
-void CPWL_Wnd::GetAppearanceStream(CFX_ByteString& sAppStream) {
- if (IsValid()) {
- CFX_ByteTextBuf sTextBuf;
- GetAppearanceStream(sTextBuf);
- sAppStream += sTextBuf.GetByteString();
- }
-}
-
void CPWL_Wnd::GetAppearanceStream(CFX_ByteTextBuf& sAppStream) {
if (IsValid() && IsVisible()) {
GetThisAppearanceStream(sAppStream);
@@ -366,11 +358,11 @@ void CPWL_Wnd::DrawThisAppearance(CFX_RenderDevice* pDevice,
}
if (HasFlag(PWS_BORDER))
- CPWL_Utils::DrawBorder(
- pDevice, pUser2Device, rectWnd, (FX_FLOAT)GetBorderWidth(),
- GetBorderColor(), GetBorderLeftTopColor(GetBorderStyle()),
- GetBorderRightBottomColor(GetBorderStyle()), GetBorderStyle(),
- GetBorderDash(), GetTransparency());
+ CPWL_Utils::DrawBorder(pDevice, pUser2Device, rectWnd,
+ (FX_FLOAT)GetBorderWidth(), GetBorderColor(),
+ GetBorderLeftTopColor(GetBorderStyle()),
+ GetBorderRightBottomColor(GetBorderStyle()),
+ GetBorderStyle(), GetTransparency());
}
}
@@ -528,7 +520,7 @@ FX_BOOL CPWL_Wnd::IsValid() const {
return m_bCreated;
}
-PWL_CREATEPARAM CPWL_Wnd::GetCreationParam() const {
+const PWL_CREATEPARAM& CPWL_Wnd::GetCreationParam() const {
return m_sPrivateParam;
}
@@ -536,10 +528,6 @@ CPWL_Wnd* CPWL_Wnd::GetParentWindow() const {
return m_sPrivateParam.pParentWnd;
}
-CPDF_Rect CPWL_Wnd::GetOriginWindowRect() const {
- return m_sPrivateParam.rcRectWnd;
-}
-
CPDF_Rect CPWL_Wnd::GetWindowRect() const {
return m_rcWindow;
}
@@ -561,15 +549,6 @@ CPDF_Point CPWL_Wnd::GetCenterPoint() const {
(rcClient.top + rcClient.bottom) * 0.5f);
}
-CPDF_Rect CPWL_Wnd::GetClientCenterSquare() const {
- return CPWL_Utils::GetCenterSquare(GetClientRect());
-}
-
-CPDF_Rect CPWL_Wnd::GetWindowCenterSquare() const {
- return CPWL_Utils::GetCenterSquare(
- CPWL_Utils::DeflateRect(GetWindowRect(), 0.1f));
-}
-
FX_BOOL CPWL_Wnd::HasFlag(FX_DWORD dwFlags) const {
return (m_sPrivateParam.dwFlags & dwFlags) != 0;
}
@@ -626,11 +605,6 @@ int32_t CPWL_Wnd::GetInnerBorderWidth() const {
return 0;
}
-void CPWL_Wnd::SetBorderWidth(int32_t nBorderWidth) {
- if (HasFlag(PWS_BORDER))
- m_sPrivateParam.dwBorderWidth = nBorderWidth;
-}
-
CPWL_Color CPWL_Wnd::GetBorderColor() const {
if (HasFlag(PWS_BORDER))
return m_sPrivateParam.sBorderColor;
@@ -638,12 +612,7 @@ CPWL_Color CPWL_Wnd::GetBorderColor() const {
return CPWL_Color();
}
-void CPWL_Wnd::SetBorderColor(const CPWL_Color& color) {
- if (HasFlag(PWS_BORDER))
- m_sPrivateParam.sBorderColor = color;
-}
-
-CPWL_Dash CPWL_Wnd::GetBorderDash() const {
+const CPWL_Dash& CPWL_Wnd::GetBorderDash() const {
return m_sPrivateParam.sDash;
}
@@ -651,11 +620,6 @@ void* CPWL_Wnd::GetAttachedData() const {
return m_sPrivateParam.pAttachedData;
}
-void CPWL_Wnd::SetBorderDash(const CPWL_Dash& sDash) {
- if (HasFlag(PWS_BORDER))
- m_sPrivateParam.sDash = sDash;
-}
-
CPWL_ScrollBar* CPWL_Wnd::GetVScrollBar() const {
if (HasFlag(PWS_VSCROLL))
return m_pVScrollBar;
@@ -754,7 +718,7 @@ void CPWL_Wnd::SetClipRect(const CPDF_Rect& rect) {
m_rcClip.Normalize();
}
-CPDF_Rect CPWL_Wnd::GetClipRect() const {
+const CPDF_Rect& CPWL_Wnd::GetClipRect() const {
return m_rcClip;
}