Some minor fixes.

This commit is contained in:
vng 2012-05-14 20:31:43 +03:00 committed by Alex Zolotarev
parent f7262cabd4
commit cceb6ac23b
4 changed files with 11 additions and 11 deletions

View file

@ -162,7 +162,7 @@
BookmarkCategory * cat = GetFramework().GetBmCategory([m_balloon.setName UTF8String]);
if (cat)
{
cat->RemoveBookmark(indexPath.row);
cat->DeleteBookmark(indexPath.row);
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
// Disable edit mode if no bookmarks are left
if (cat->GetBookmarksCount() == 0)

View file

@ -28,10 +28,13 @@ void BookmarkCategory::ClearBookmarks()
m_bookmarks.clear();
}
void BookmarkCategory::RemoveBookmark(size_t index)
void BookmarkCategory::DeleteBookmark(size_t index)
{
if (index < m_bookmarks.size())
{
delete m_bookmarks[index];
m_bookmarks.erase(m_bookmarks.begin() + index);
}
}
Bookmark const * BookmarkCategory::GetBookmark(size_t index) const

View file

@ -47,7 +47,7 @@ public:
inline size_t GetBookmarksCount() const { return m_bookmarks.size(); }
Bookmark const * GetBookmark(size_t index) const;
void RemoveBookmark(size_t index);
void DeleteBookmark(size_t index);
void LoadFromKML(ReaderPtr<Reader> const & reader);
void SaveToKML(ostream & s);

View file

@ -218,16 +218,13 @@ BookmarkCategory * Framework::GetBmCategory(string const & name)
bool Framework::DeleteBmCategory(size_t index)
{
for (vector<BookmarkCategory *>::iterator it = m_bookmarks.begin(); it != m_bookmarks.end(); ++it)
if (index < m_bookmarks.size())
{
if (index-- == 0)
{
delete *it;
m_bookmarks.erase(it);
return true;
}
delete m_bookmarks[index];
m_bookmarks.erase(m_bookmarks.begin() + index);
return true;
}
return false;
else return false;
}
Bookmark const * Framework::GetBookmark(m2::PointD pt) const