diff options
author | vng <viktor.govako@gmail.com> | 2013-03-23 21:07:40 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:52:17 +0300 |
commit | 67888547103f3111a73f188575a438f55088ef7d (patch) | |
tree | d6adc37e8229ce499896d035c3ff99f1f33a015c /map/bookmark.cpp | |
parent | ad977f5b33b832a62ec2acfb510c696c37c1a46b (diff) |
Keep scale and timestamp when editing (replacing) bookmark in category.
Diffstat (limited to 'map/bookmark.cpp')
-rw-r--r-- | map/bookmark.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/map/bookmark.cpp b/map/bookmark.cpp index 9b7e820d51..ae6898dee0 100644 --- a/map/bookmark.cpp +++ b/map/bookmark.cpp @@ -27,16 +27,23 @@ void BookmarkCategory::ReplaceBookmark(size_t index, Bookmark const & bm) ASSERT_LESS ( index, m_bookmarks.size(), () ); if (index < m_bookmarks.size()) { + Bookmark * p = new Bookmark(bm); + AssignPrivateParams(index, *p); + delete m_bookmarks[index]; - m_bookmarks[index] = new Bookmark(bm); + m_bookmarks[index] = p; } } -void BookmarkCategory::AssignTimeStamp(size_t index, Bookmark & bm) const +void BookmarkCategory::AssignPrivateParams(size_t index, Bookmark & bm) const { ASSERT_LESS ( index, m_bookmarks.size(), () ); if (index < m_bookmarks.size()) - bm.SetTimeStamp(m_bookmarks[index]->GetTimeStamp()); + { + Bookmark const * p = m_bookmarks[index]; + bm.SetTimeStamp(p->GetTimeStamp()); + bm.SetScale(p->GetScale()); + } } BookmarkCategory::~BookmarkCategory() |