From 53e9d3172c93566ecc7ae56c622dac9f446a9b46 Mon Sep 17 00:00:00 2001 From: kavikhalique Date: Sat, 21 Sep 2024 13:14:50 +0530 Subject: [PATCH] removed redundant code Signed-off-by: kavikhalique --- android/app/src/main/cpp/app/organicmaps/Framework.cpp | 2 +- android/app/src/main/cpp/app/organicmaps/Framework.hpp | 2 +- .../cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp | 2 +- map/bookmark_manager.cpp | 4 ++-- map/bookmark_manager.hpp | 4 ++-- map/track.cpp | 6 ------ map/track.hpp | 1 - 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/android/app/src/main/cpp/app/organicmaps/Framework.cpp b/android/app/src/main/cpp/app/organicmaps/Framework.cpp index 0154d6f923..7a4e6d8d4a 100644 --- a/android/app/src/main/cpp/app/organicmaps/Framework.cpp +++ b/android/app/src/main/cpp/app/organicmaps/Framework.cpp @@ -588,7 +588,7 @@ void Framework::ReplaceTrack(kml::TrackId trackId, kml::TrackData & trackData) m_work.GetBookmarkManager().GetEditSession().UpdateTrack(trackId, trackData); } -void Framework::ChangeTrackColor(kml::TrackId trackId, uint32_t color) +void Framework::ChangeTrackColor(kml::TrackId trackId, dp::Color color) { m_work.GetBookmarkManager().GetEditSession().ChangeTrackColor(trackId, color); } diff --git a/android/app/src/main/cpp/app/organicmaps/Framework.hpp b/android/app/src/main/cpp/app/organicmaps/Framework.hpp index 36096efb25..b7bc59ef78 100644 --- a/android/app/src/main/cpp/app/organicmaps/Framework.hpp +++ b/android/app/src/main/cpp/app/organicmaps/Framework.hpp @@ -158,7 +158,7 @@ namespace android void Scale(::Framework::EScaleMode mode); void Scale(m2::PointD const & centerPt, int targetZoom, bool animate); - void ChangeTrackColor(kml::TrackId trackId, uint32_t color); + void ChangeTrackColor(kml::TrackId trackId, dp::Color color); void ReplaceBookmark(kml::MarkId markId, kml::BookmarkData & bm); void ReplaceTrack(kml::TrackId trackId, kml::TrackData & trackData); void MoveBookmark(kml::MarkId markId, kml::MarkGroupId curCat, kml::MarkGroupId newCat); diff --git a/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp b/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp index 167bc7f247..072b37d9a4 100644 --- a/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp +++ b/android/app/src/main/cpp/app/organicmaps/bookmarks/data/BookmarkManager.cpp @@ -839,7 +839,7 @@ Java_app_organicmaps_bookmarks_data_BookmarkManager_nativeChangeTrackColor( JNIEnv *, jclass, jlong trackId, jint color) { uint8_t alpha = ExtractByte(color, 3); - g_framework->ChangeTrackColor(static_cast(trackId), static_cast(shift(color,8) + alpha)); + g_framework->ChangeTrackColor(static_cast(trackId), static_cast(shift(color,8) + alpha)); } JNIEXPORT jobject JNICALL diff --git a/map/bookmark_manager.cpp b/map/bookmark_manager.cpp index c59b2c999e..a40b96e72a 100644 --- a/map/bookmark_manager.cpp +++ b/map/bookmark_manager.cpp @@ -2316,7 +2316,7 @@ void BookmarkManager::UpdateBookmark(kml::MarkId bmID, kml::BookmarkData const & SetLastEditedBmColor(bookmark->GetColor()); } -void BookmarkManager::ChangeTrackColor(kml::TrackId trackId, uint32_t color) +void BookmarkManager::ChangeTrackColor(kml::TrackId trackId, dp::Color color) { CHECK_THREAD_CHECKER(m_threadChecker, ()); auto * track = GetTrackForEdit(trackId); @@ -3655,7 +3655,7 @@ void BookmarkManager::EditSession::UpdateTrack(kml::TrackId trackId, kml::TrackD return m_bmManager.UpdateTrack(trackId,trackData); } -void BookmarkManager::EditSession::ChangeTrackColor(kml::TrackId trackId, uint32_t color) +void BookmarkManager::EditSession::ChangeTrackColor(kml::TrackId trackId, dp::Color color) { m_bmManager.ChangeTrackColor(trackId, color); } diff --git a/map/bookmark_manager.hpp b/map/bookmark_manager.hpp index ea2637693d..0f65e7163c 100644 --- a/map/bookmark_manager.hpp +++ b/map/bookmark_manager.hpp @@ -154,7 +154,7 @@ public: void MoveTrack(kml::TrackId trackID, kml::MarkGroupId curGroupID, kml::MarkGroupId newGroupID); void AttachTrack(kml::TrackId trackId, kml::MarkGroupId groupId); void DetachTrack(kml::TrackId trackId, kml::MarkGroupId groupId); - void ChangeTrackColor(kml::TrackId trackId, uint32_t color); + void ChangeTrackColor(kml::TrackId trackId, dp::Color color); void UpdateTrack(kml::TrackId trackId, kml::TrackData const & trackData); void SetCategoryName(kml::MarkGroupId categoryId, std::string const & name); @@ -587,7 +587,7 @@ private: void DetachTrack(kml::TrackId trackId, kml::MarkGroupId groupId); void DeleteTrack(kml::TrackId trackId); void MoveTrack(kml::TrackId trackID, kml::MarkGroupId curGroupID, kml::MarkGroupId newGroupID); - void ChangeTrackColor(kml::TrackId trackId, uint32_t color); + void ChangeTrackColor(kml::TrackId trackId, dp::Color color); void UpdateTrack(kml::TrackId trackId, kml::TrackData const & trackData); void ClearGroup(kml::MarkGroupId groupId); diff --git a/map/track.cpp b/map/track.cpp index 881f4360af..b44153c1d4 100644 --- a/map/track.cpp +++ b/map/track.cpp @@ -237,12 +237,6 @@ void Track::SetColor(dp::Color color) m_data.m_layers[0].m_color.m_rgba = color.GetRGBA(); } -void Track::SetColor(uint32_t color) -{ - m_isDirty = true; - m_data.m_layers[0].m_color.m_rgba = color; -} - float Track::GetWidth(size_t layerIndex) const { CHECK_LESS(layerIndex, m_data.m_layers.size(), ()); diff --git a/map/track.hpp b/map/track.hpp index 865bf2921c..32b9c43c9e 100644 --- a/map/track.hpp +++ b/map/track.hpp @@ -55,7 +55,6 @@ public: size_t GetLayerCount() const override; dp::Color GetColor(size_t layerIndex) const override; void SetColor(dp::Color color); - void SetColor(uint32_t color); float GetWidth(size_t layerIndex) const override; float GetDepth(size_t layerIndex) const override; void ForEachGeometry(GeometryFnT && fn) const override;