[iOS] Compilation fix.

This commit is contained in:
vng 2015-03-12 12:24:52 +03:00 committed by Alex Zolotarev
parent 893328a289
commit 280ad574e5
2 changed files with 12 additions and 6 deletions

View file

@ -255,11 +255,13 @@
[self.containerView.placePage setState:PlacePageStateHidden animated:YES withCallback:YES];
}
- (void)onUserMarkClicked:(UserMarkCopy *)mark
- (void)onUserMarkClicked:(unique_ptr<UserMarkCopy>)mark
{
if (self.searchView.state != SearchViewStateFullscreen)
{
[self.containerView.placePage showUserMark:mark];
// This function will take ownership for the passed user mark pointer.
[self.containerView.placePage showUserMark:mark.release()];
[self.containerView.placePage setState:PlacePageStatePreview animated:YES withCallback:YES];
}
}
@ -658,7 +660,7 @@
{
Framework & f = GetFramework();
typedef void (*UserMarkActivatedFnT)(id, SEL, UserMarkCopy *);
typedef void (*UserMarkActivatedFnT)(id, SEL, unique_ptr<UserMarkCopy>);
typedef void (*PlacePageDismissedFnT)(id, SEL);
PinClickManager & manager = f.GetBalloonManager();
@ -1102,7 +1104,10 @@
{
BookmarkCategory const * category = GetFramework().GetBookmarkManager().GetBmCategory(bookmarkAndCategory.first);
Bookmark const * bookmark = category->GetBookmark(bookmarkAndCategory.second);
[self.containerView.placePage showUserMark:bookmark->Copy()];
// This function will take ownership for the passed user mark pointer.
[self.containerView.placePage showUserMark:bookmark->Copy().release()];
[self.containerView.placePage setState:self.containerView.placePage.state animated:YES withCallback:NO];
}

View file

@ -1058,7 +1058,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
}
size_t const bookmarkIndex = framework.GetBookmarkManager().AddBookmark(m_categoryIndex, [self pinPoint], *m_bookmarkData);
m_mark.reset(category->GetBookmark(bookmarkIndex)->Copy());
m_mark = category->GetBookmark(bookmarkIndex)->Copy();
}
else
{
@ -1066,8 +1066,9 @@ typedef NS_ENUM(NSUInteger, CellRow)
BookmarkData data = BookmarkData([[self newBookmarkName] UTF8String], framework.LastEditedBMType());
size_t const bookmarkIndex = framework.AddBookmark(categoryIndex, [self pinPoint], data);
BookmarkCategory const * category = framework.GetBmCategory(categoryIndex);
m_mark.reset(category->GetBookmark(bookmarkIndex)->Copy());
m_mark = category->GetBookmark(bookmarkIndex)->Copy();
}
framework.ActivateUserMark([self userMark]);
framework.Invalidate();