Make wxControlBase::DoEllipsizeSingleLine() private function

This function doesn't need to be a method of wxControl, so don't make it
one.

No real changes, just improve the encapsulation.
This commit is contained in:
Vadim Zeitlin 2019-06-20 01:44:27 +02:00
parent 8fcedbed7b
commit 05627cf54c
2 changed files with 6 additions and 11 deletions

View File

@ -178,11 +178,6 @@ protected:
// initialize the common fields of wxCommandEvent
void InitCommandEvent(wxCommandEvent& event) const;
// Ellipsize() helper:
static wxString DoEllipsizeSingleLine(const wxString& label, const wxDC& dc,
wxEllipsizeMode mode, int maxWidth,
int replacementWidth);
#if wxUSE_MARKUP
// Remove markup from the given string, returns empty string on error i.e.
// if markup was syntactically invalid.

View File

@ -403,12 +403,9 @@ struct EllipsizeCalculator
bool m_isOk;
};
} // anonymous namespace
/* static and protected */
wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxDC& dc,
wxEllipsizeMode mode, int maxFinalWidthPx,
int replacementWidthPx)
wxString DoEllipsizeSingleLine(const wxString& curLine, const wxDC& dc,
wxEllipsizeMode mode, int maxFinalWidthPx,
int replacementWidthPx)
{
wxASSERT_MSG(replacementWidthPx > 0, "Invalid parameters");
wxASSERT_LEVEL_2_MSG(!curLine.Contains('\n'),
@ -523,6 +520,9 @@ wxString wxControlBase::DoEllipsizeSingleLine(const wxString& curLine, const wxD
return calc.GetEllipsizedText();
}
} // anonymous namespace
/* static */
wxString wxControlBase::Ellipsize(const wxString& label, const wxDC& dc,
wxEllipsizeMode mode, int maxFinalWidth,