From: <sag...@us...> - 2011-02-27 22:24:08
|
Revision: 806 http://modplug.svn.sourceforge.net/modplug/?rev=806&view=rev Author: saga-games Date: 2011-02-27 22:24:02 +0000 (Sun, 27 Feb 2011) Log Message: ----------- [Fix] Sample Undo didn't preserve the sample name. Modified Paths: -------------- trunk/OpenMPT/mptrack/Undo.cpp trunk/OpenMPT/mptrack/Undo.h Modified: trunk/OpenMPT/mptrack/Undo.cpp =================================================================== --- trunk/OpenMPT/mptrack/Undo.cpp 2011-02-27 17:20:20 UTC (rev 805) +++ trunk/OpenMPT/mptrack/Undo.cpp 2011-02-27 22:24:02 UTC (rev 806) @@ -251,6 +251,7 @@ // Save old sample header memcpy(&sUndo.OldSample, &pSndFile->Samples[nSmp], sizeof(MODSAMPLE)); + memcpy(sUndo.szOldName, pSndFile->m_szNames[nSmp], sizeof(sUndo.szOldName)); sUndo.nChangeType = nChangeType; if(nChangeType == sundo_replace) @@ -386,6 +387,7 @@ // Restore old sample header memcpy(&pSndFile->Samples[nSmp], &pUndo->OldSample, sizeof(MODSAMPLE)); pSndFile->Samples[nSmp].pSample = pCurrentSample; // select the "correct" old sample + memcpy(pSndFile->m_szNames[nSmp], pUndo->szOldName, sizeof(pUndo->szOldName)); if(pNewSample != nullptr) { Modified: trunk/OpenMPT/mptrack/Undo.h =================================================================== --- trunk/OpenMPT/mptrack/Undo.h 2011-02-27 17:20:20 UTC (rev 805) +++ trunk/OpenMPT/mptrack/Undo.h 2011-02-27 22:24:02 UTC (rev 806) @@ -82,6 +82,7 @@ struct SAMPLEUNDOBUFFER { MODSAMPLE OldSample; + CHAR szOldName[MAX_SAMPLENAME]; LPSTR SamplePtr; UINT nChangeStart, nChangeEnd; sampleUndoTypes nChangeType; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |