Deprecate wxTipProvider::PreprocessTip().
It is completely useless, and there is no reason to keep it. Closes #15916. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -44,14 +44,15 @@ public:
|
|||||||
// from where to start the next time)
|
// from where to start the next time)
|
||||||
size_t GetCurrentTip() const { return m_currentTip; }
|
size_t GetCurrentTip() const { return m_currentTip; }
|
||||||
|
|
||||||
// Allows any user-derived class to optionally override this function to
|
|
||||||
// modify the tip as soon as it is read. If return wxEmptyString, then
|
|
||||||
// the tip is skipped, and the next one is read.
|
|
||||||
virtual wxString PreprocessTip(const wxString& tip) { return tip; }
|
|
||||||
|
|
||||||
// virtual dtor for the base class
|
// virtual dtor for the base class
|
||||||
virtual ~wxTipProvider() { }
|
virtual ~wxTipProvider() { }
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WXWIN_COMPATIBILITY_3_0
|
||||||
|
wxDEPRECATED_MSG("this method does nothing, simply don't call it")
|
||||||
|
wxString PreprocessTip(const wxString& tip) { return tip; }
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
size_t m_currentTip;
|
size_t m_currentTip;
|
||||||
};
|
};
|
||||||
|
@@ -50,18 +50,6 @@ public:
|
|||||||
This function is pure virtual, it should be implemented in the derived classes.
|
This function is pure virtual, it should be implemented in the derived classes.
|
||||||
*/
|
*/
|
||||||
virtual wxString GetTip() = 0;
|
virtual wxString GetTip() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
Returns a modified tip.
|
|
||||||
|
|
||||||
This function will be called immediately after read, and before being check
|
|
||||||
whether it is a comment, an empty string or a string to translate.
|
|
||||||
You can optionally override this in your custom user-derived class
|
|
||||||
to optionally to modify the tip as soon as it is read. You can return any
|
|
||||||
modification to the string. If you return wxEmptyString, then this tip is
|
|
||||||
skipped, and the next one is read.
|
|
||||||
*/
|
|
||||||
virtual wxString PreprocessTip(const wxString& tip);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -159,9 +159,8 @@ wxString wxFileTipProvider::GetTip()
|
|||||||
// Comments start with a # symbol.
|
// Comments start with a # symbol.
|
||||||
// Loop reading lines until get the first one that isn't a comment.
|
// Loop reading lines until get the first one that isn't a comment.
|
||||||
// The max number of loop executions is the number of lines in the
|
// The max number of loop executions is the number of lines in the
|
||||||
// textfile so that can't go into an eternal loop in the [oddball]
|
// textfile so that can't go into an infinite loop in the [oddball]
|
||||||
// case of a comment-only tips file, or the developer has vetoed
|
// case of a comment-only tips file.
|
||||||
// them all via PreprecessTip().
|
|
||||||
for ( size_t i=0; i < count; i++ )
|
for ( size_t i=0; i < count; i++ )
|
||||||
{
|
{
|
||||||
// The current tip may be at the last line of the textfile, (or
|
// The current tip may be at the last line of the textfile, (or
|
||||||
@@ -177,10 +176,6 @@ wxString wxFileTipProvider::GetTip()
|
|||||||
// Read the tip, and increment the current tip counter.
|
// Read the tip, and increment the current tip counter.
|
||||||
tip = m_textfile.GetLine(m_currentTip++);
|
tip = m_textfile.GetLine(m_currentTip++);
|
||||||
|
|
||||||
// Allow a derived class's overrided virtual to modify the tip
|
|
||||||
// now if so desired.
|
|
||||||
tip = PreprocessTip(tip);
|
|
||||||
|
|
||||||
// Break if tip isn't a comment, and isn't an empty string
|
// Break if tip isn't a comment, and isn't an empty string
|
||||||
// (or only stray space characters).
|
// (or only stray space characters).
|
||||||
if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) )
|
if ( !tip.StartsWith(wxT("#")) && (tip.Trim() != wxEmptyString) )
|
||||||
|
Reference in New Issue
Block a user