diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_notes.cpp | 8 | ||||
-rw-r--r-- | editor/editor_notes.hpp | 2 | ||||
-rw-r--r-- | editor/editor_tests/editor_notes_test.cpp | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/editor/editor_notes.cpp b/editor/editor_notes.cpp index b4c7bb6ee0..162e9f7d61 100644 --- a/editor/editor_notes.cpp +++ b/editor/editor_notes.cpp @@ -133,7 +133,7 @@ Notes::Notes(string const & fileName) : m_fileName(fileName) Load(m_fileName, m_notes, m_uploadedNotesCount); } -void Notes::CreateNote(m2::PointD const & point, string const & text) +void Notes::CreateNote(ms::LatLon const & latLon, string const & text) { if (text.empty()) { @@ -141,14 +141,14 @@ void Notes::CreateNote(m2::PointD const & point, string const & text) return; } - if (!MercatorBounds::ValidX(point.x) || !MercatorBounds::ValidY(point.y)) + if (!MercatorBounds::ValidLat(latLon.lat) || !MercatorBounds::ValidLon(latLon.lon)) { - LOG(LWARNING, ("A note attached to a wrong point", point)); + LOG(LWARNING, ("A note attached to a wrong latLon", latLon)); return; } lock_guard<mutex> g(m_mu); - m_notes.emplace_back(MercatorBounds::ToLatLon(point), text); + m_notes.emplace_back(latLon, text); Save(m_fileName, m_notes, m_uploadedNotesCount); } diff --git a/editor/editor_notes.hpp b/editor/editor_notes.hpp index 4cdf9607be..06c540c448 100644 --- a/editor/editor_notes.hpp +++ b/editor/editor_notes.hpp @@ -31,7 +31,7 @@ public: static shared_ptr<Notes> MakeNotes(string const & fileName = "notes.xml", bool const fullPath = false); - void CreateNote(m2::PointD const & point, string const & text); + void CreateNote(ms::LatLon const & latLon, string const & text); /// Uploads notes to the server in a separate thread. void Upload(osm::OsmOAuth const & auth); diff --git a/editor/editor_tests/editor_notes_test.cpp b/editor/editor_tests/editor_notes_test.cpp index 80845ccc59..a6b6496063 100644 --- a/editor/editor_tests/editor_notes_test.cpp +++ b/editor/editor_tests/editor_notes_test.cpp @@ -19,9 +19,9 @@ UNIT_TEST(Notes_Smoke) platform::tests_support::ScopedFile sf(fileName); { auto const notes = Notes::MakeNotes(fullFileName, true); - notes->CreateNote({1, 2}, "Some note1"); - notes->CreateNote({2, 2}, "Some note2"); - notes->CreateNote({1, 1}, "Some note3"); + notes->CreateNote(MercatorBounds::ToLatLon({1, 2}), "Some note1"); + notes->CreateNote(MercatorBounds::ToLatLon({2, 2}), "Some note2"); + notes->CreateNote(MercatorBounds::ToLatLon({1, 1}), "Some note3"); } { auto const notes = Notes::MakeNotes(fullFileName, true); |