diff --git a/include/wx/cmdproc.h b/include/wx/cmdproc.h index 6072e7fda0..4fa3e34c19 100644 --- a/include/wx/cmdproc.h +++ b/include/wx/cmdproc.h @@ -97,10 +97,7 @@ public: virtual void ClearCommands(); // Has the current project been changed? - virtual bool IsDirty() const - { - return m_currentCommand && (m_lastSavedCommand != m_currentCommand); - } + virtual bool IsDirty() const; // Mark the current command as the one where the last save took place void MarkAsSaved() diff --git a/src/common/cmdproc.cpp b/src/common/cmdproc.cpp index 7de08c2790..ed7efb3e3f 100644 --- a/src/common/cmdproc.cpp +++ b/src/common/cmdproc.cpp @@ -328,4 +328,14 @@ void wxCommandProcessor::ClearCommands() m_lastSavedCommand = wxList::compatibility_iterator(); } +bool wxCommandProcessor::IsDirty() const +{ + if ( !m_currentCommand ) + return false; + + if ( !m_lastSavedCommand ) + return true; + + return m_lastSavedCommand != m_currentCommand; +}