Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorSergey Magidovich <mgsergio@mapswithme.com>2016-04-04 13:49:22 +0300
committerSergey Magidovich <mgsergio@mapswithme.com>2016-04-04 14:03:59 +0300
commit10ce427a401c543a99571f627adb58a6f905b616 (patch)
tree8160f2a1bc819afd8f131876ae299993b9b39703 /editor
parent82bdd8054345a7ac44b8b5868047d2bf40343d36 (diff)
Fix Editor::CreateNotes api.
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_notes.cpp8
-rw-r--r--editor/editor_notes.hpp2
-rw-r--r--editor/editor_tests/editor_notes_test.cpp6
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);