From 3e9e41f62720317d01011127529d457eb3600704 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Mon, 15 Oct 2012 12:55:13 +0300 Subject: [PATCH] [ios] Removed unnecessary member variable --- iphone/Maps/Bookmarks/BalloonView.h | 4 +--- iphone/Maps/Bookmarks/BalloonView.mm | 18 +++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/iphone/Maps/Bookmarks/BalloonView.h b/iphone/Maps/Bookmarks/BalloonView.h index e96e6f6c7f..34b3200770 100644 --- a/iphone/Maps/Bookmarks/BalloonView.h +++ b/iphone/Maps/Bookmarks/BalloonView.h @@ -7,9 +7,6 @@ UIImageView * m_titleView; id m_target; SEL m_selector; - - // If we clicked already existing bookmark, it will be here - BookmarkAndCategory m_editedBookmark; } @property(nonatomic, retain) NSString * title; @@ -24,6 +21,7 @@ @property(nonatomic, retain) NSString * setName; @property(nonatomic, assign, readonly) BOOL isDisplayed; @property(nonatomic, assign) CGPoint globalPosition; +// If we clicked already existing bookmark, it will be here @property(nonatomic, assign) BookmarkAndCategory editedBookmark; - (id) initWithTarget:(id)target andSelector:(SEL)selector; diff --git a/iphone/Maps/Bookmarks/BalloonView.mm b/iphone/Maps/Bookmarks/BalloonView.mm index 64903993b7..22f90c3302 100644 --- a/iphone/Maps/Bookmarks/BalloonView.mm +++ b/iphone/Maps/Bookmarks/BalloonView.mm @@ -16,7 +16,7 @@ @synthesize color; @synthesize setName; @synthesize isDisplayed; -@synthesize editedBookmark = m_editedBookmark; +@synthesize editedBookmark; + (NSString *) getDefaultSetName { @@ -49,7 +49,7 @@ recognizer.delaysTouchesBegan = YES; [m_titleView addGestureRecognizer:recognizer]; - m_editedBookmark = MakeEmptyBookmarkAndCategory(); + editedBookmark = MakeEmptyBookmarkAndCategory(); } return self; } @@ -80,7 +80,7 @@ UIImage * right = [UIImage imageNamed:@"right"]; UIImage * middle = [UIImage imageNamed:@"middle"]; UIImage * tail = [UIImage imageNamed:@"tail"]; - UIImage * arrow = [UIImage imageNamed:(IsValid(m_editedBookmark) ? @"arrow" : @"add")]; + UIImage * arrow = [UIImage imageNamed:(IsValid(editedBookmark) ? @"arrow" : @"add")]; // Calculate text width and height UIFont * titleFont = [UIFont boldSystemFontOfSize:[UIFont buttonFontSize]]; @@ -148,7 +148,7 @@ self.pinImage.frame = CGRectMake(pt.x - w/2, pt.y, w, h); // Do not show pin if we're editing existing bookmark. // @TODO move pin (and probably balloon drawing) to cross-platform code - self.pinImage.hidden = IsValid(m_editedBookmark); + self.pinImage.hidden = IsValid(editedBookmark); [view addSubview:self.pinImage]; @@ -185,7 +185,7 @@ isDisplayed = NO; [m_titleView removeFromSuperview]; [self.pinImage removeFromSuperview]; - m_editedBookmark = MakeEmptyBookmarkAndCategory(); + editedBookmark = MakeEmptyBookmarkAndCategory(); } } @@ -228,13 +228,13 @@ - (void) deleteBookmark { - if (IsValid(m_editedBookmark)) + if (IsValid(editedBookmark)) { - BookmarkCategory * cat = GetFramework().GetBmCategory(m_editedBookmark.first); + BookmarkCategory * cat = GetFramework().GetBmCategory(editedBookmark.first); if (cat) - cat->DeleteBookmark(m_editedBookmark.second); + cat->DeleteBookmark(editedBookmark.second); // Clear! - m_editedBookmark = MakeEmptyBookmarkAndCategory(); + editedBookmark = MakeEmptyBookmarkAndCategory(); } }