[MSPAINT] Add const to SelectionModel methods (#4191)

Add const keywords to some methods of SelectionModel class. CORE-17931
This commit is contained in:
Katayama Hirofumi MZ 2021-12-27 20:07:23 +09:00 committed by GitHub
parent ce54a8a5f2
commit b5536e448a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View file

@ -224,12 +224,12 @@ void SelectionModel::RotateNTimes90Degrees(int iN)
NotifyRefreshNeeded(); NotifyRefreshNeeded();
} }
HBITMAP SelectionModel::GetBitmap() HBITMAP SelectionModel::GetBitmap() const
{ {
return m_hBm; return m_hBm;
} }
int SelectionModel::PtStackSize() int SelectionModel::PtStackSize() const
{ {
return m_iPtSP; return m_iPtSP;
} }
@ -253,7 +253,7 @@ void SelectionModel::SetSrcRectSizeToZero()
m_rcSrc.bottom = m_rcSrc.top; m_rcSrc.bottom = m_rcSrc.top;
} }
BOOL SelectionModel::IsSrcRectSizeNonzero() BOOL SelectionModel::IsSrcRectSizeNonzero() const
{ {
return (RECT_WIDTH(m_rcSrc) != 0) && (RECT_HEIGHT(m_rcSrc) != 0); return (RECT_WIDTH(m_rcSrc) != 0) && (RECT_HEIGHT(m_rcSrc) != 0);
} }
@ -318,22 +318,22 @@ void SelectionModel::ModifyDestRect(POINT& ptDelta, int iAction)
ptDelta.y -= ptDeltaUsed.y; ptDelta.y -= ptDeltaUsed.y;
} }
LONG SelectionModel::GetDestRectWidth() LONG SelectionModel::GetDestRectWidth() const
{ {
return m_rcDest.right - m_rcDest.left; return m_rcDest.right - m_rcDest.left;
} }
LONG SelectionModel::GetDestRectHeight() LONG SelectionModel::GetDestRectHeight() const
{ {
return m_rcDest.bottom - m_rcDest.top; return m_rcDest.bottom - m_rcDest.top;
} }
LONG SelectionModel::GetDestRectLeft() LONG SelectionModel::GetDestRectLeft() const
{ {
return m_rcDest.left; return m_rcDest.left;
} }
LONG SelectionModel::GetDestRectTop() LONG SelectionModel::GetDestRectTop() const
{ {
return m_rcDest.top; return m_rcDest.top;
} }

View file

@ -54,17 +54,17 @@ public:
void FlipHorizontally(); void FlipHorizontally();
void FlipVertically(); void FlipVertically();
void RotateNTimes90Degrees(int iN); void RotateNTimes90Degrees(int iN);
HBITMAP GetBitmap(); HBITMAP GetBitmap() const;
int PtStackSize(); int PtStackSize() const;
void DrawFramePoly(HDC hDCImage); void DrawFramePoly(HDC hDCImage);
void SetSrcAndDestRectFromPoints(const POINT& ptFrom, const POINT& ptTo); void SetSrcAndDestRectFromPoints(const POINT& ptFrom, const POINT& ptTo);
void SetSrcRectSizeToZero(); void SetSrcRectSizeToZero();
BOOL IsSrcRectSizeNonzero(); BOOL IsSrcRectSizeNonzero() const;
void ModifyDestRect(POINT& ptDelta, int iAction); void ModifyDestRect(POINT& ptDelta, int iAction);
LONG GetDestRectWidth(); LONG GetDestRectWidth() const;
LONG GetDestRectHeight(); LONG GetDestRectHeight() const;
LONG GetDestRectLeft(); LONG GetDestRectLeft() const;
LONG GetDestRectTop(); LONG GetDestRectTop() const;
void DrawTextToolText(HDC hDCImage, COLORREF crFg, COLORREF crBg, BOOL bBgTransparent = FALSE); void DrawTextToolText(HDC hDCImage, COLORREF crFg, COLORREF crBg, BOOL bBgTransparent = FALSE);
private: private: