Make wxCaret init functions private

Init functions are not supposed to be called by derived classes,
they have already been called by the base ctors.
This commit is contained in:
Paul Cornett
2022-03-27 13:07:37 -07:00
parent 9dc7248b1d
commit 0993d4f18e
2 changed files with 13 additions and 16 deletions

View File

@@ -164,15 +164,6 @@ protected:
virtual void DoMove() = 0;
virtual void DoSize() { }
// the common initialization
void Init()
{
m_window = NULL;
m_x = m_y = 0;
m_width = m_height = 0;
m_countVisible = 0;
}
// the size of the caret
int m_width, m_height;
@@ -186,6 +177,14 @@ protected:
int m_countVisible;
private:
void Init()
{
m_window = NULL;
m_x = m_y = 0;
m_width = m_height = 0;
m_countVisible = 0;
}
wxDECLARE_NO_COPY_CLASS(wxCaretBase);
};

View File

@@ -36,13 +36,6 @@ public:
virtual void OnKillFocus() wxOVERRIDE;
protected:
void Init()
{
wxCaretBase::Init();
m_hasCaret = false;
}
// override base class virtuals
virtual void DoMove() wxOVERRIDE;
virtual void DoShow() wxOVERRIDE;
@@ -53,6 +46,11 @@ protected:
bool MSWCreateCaret();
private:
void Init()
{
m_hasCaret = false;
}
bool m_hasCaret;
wxDECLARE_NO_COPY_CLASS(wxCaret);