From a244529a4fa4c49d26a65648971ab6061bd5e7ac Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Sat, 27 Sep 2008 15:55:20 +0000 Subject: [PATCH] Renamed actualTracks to tracks, removed dead code (the out-commented empty function purgeUnused), replaced "Error" with NULL (This gives a localized error-string) for MessageBox in one place. --- editor/syncdocument.cpp | 9 --------- editor/syncdocument.h | 7 ++++--- editor/synctracker2.cpp | 2 +- sync/data.cpp | 12 ++++++------ sync/data.h | 10 +++++----- 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/editor/syncdocument.cpp b/editor/syncdocument.cpp index 6056c7a..8f6b13a 100644 --- a/editor/syncdocument.cpp +++ b/editor/syncdocument.cpp @@ -6,15 +6,6 @@ SyncDocument::~SyncDocument() clearRedoStack(); } -size_t SyncDocument::getTrackIndexFromPos(size_t track) const -{ - return track; -} - -/* void SyncDocument::purgeUnusedTracks() -{ -} */ - #import named_guids bool SyncDocument::load(const std::string &fileName) diff --git a/editor/syncdocument.h b/editor/syncdocument.h index b499624..394f951 100644 --- a/editor/syncdocument.h +++ b/editor/syncdocument.h @@ -265,9 +265,10 @@ public: return cmd; } - size_t getTrackIndexFromPos(size_t track) const; - -/* void purgeUnused(); */ + size_t getTrackIndexFromPos(size_t track) const + { + return track; + } bool load(const std::string &fileName); bool save(const std::string &fileName); diff --git a/editor/synctracker2.cpp b/editor/synctracker2.cpp index ea19e73..fa0ed35 100644 --- a/editor/synctracker2.cpp +++ b/editor/synctracker2.cpp @@ -437,7 +437,7 @@ int _tmain(int argc, _TCHAR* argv[]) if (NULL == hwnd) { - MessageBox(NULL, _T("Window Creation Failed!"), _T("Error!"), MB_OK | MB_ICONEXCLAMATION | MB_SETFOREGROUND); + MessageBox(NULL, _T("Window Creation Failed!"), NULL, MB_OK | MB_ICONEXCLAMATION | MB_SETFOREGROUND); return -1; } diff --git a/sync/data.cpp b/sync/data.cpp index a623d94..d4fa11e 100644 --- a/sync/data.cpp +++ b/sync/data.cpp @@ -8,17 +8,17 @@ using namespace sync; Data::~Data() { - for (size_t i = 0; i < actualTracks.size(); ++i) - delete actualTracks[i]; + for (size_t i = 0; i < tracks.size(); ++i) + delete tracks[i]; } size_t Data::createTrack(const std::basic_string &name) { assert(0 > getTrackIndex(name)); - size_t index = actualTracks.size(); + size_t index = tracks.size(); // insert new track - actualTracks.push_back(new sync::Track(name)); + tracks.push_back(new sync::Track(name)); return index; } @@ -27,9 +27,9 @@ int Data::getTrackIndex(const std::basic_string &name) { // search for track size_t index; - for (index = 0; index < actualTracks.size(); ++index) + for (index = 0; index < tracks.size(); ++index) { - if (name == actualTracks[index]->getName()) return int(index); + if (name == tracks[index]->getName()) return int(index); } // not found diff --git a/sync/data.h b/sync/data.h index f87fe2b..34b8e85 100644 --- a/sync/data.h +++ b/sync/data.h @@ -36,18 +36,18 @@ namespace sync Track & getTrack(size_t track) { - assert(track < actualTracks.size()); - assert(NULL != actualTracks[track]); - return *actualTracks[track]; + assert(track < tracks.size()); + assert(NULL != tracks[track]); + return *tracks[track]; } size_t getTrackCount() const { - return actualTracks.size(); + return tracks.size(); } protected: - std::vector actualTracks; + std::vector tracks; }; }