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:
authorArsentiy Milchakov <milcars@mapswithme.com>2019-03-01 20:39:37 +0300
committermpimenov <mpimenov@users.noreply.github.com>2019-03-03 00:03:13 +0300
commit05711a847b12b937b441826cca63477ec2ce67b5 (patch)
tree903ef22268fc41b1e7e5dcabb4215a6edcc6542b /editor
parent2dfefa3ae7ad1a77aa1429c7f4e99720fb4b6481 (diff)
[editor] review fixes
Diffstat (limited to 'editor')
-rw-r--r--editor/changeset_wrapper.cpp2
-rw-r--r--editor/changeset_wrapper.hpp5
-rw-r--r--editor/editor_tests/feature_matcher_test.cpp3
-rw-r--r--editor/editor_tests/match_by_geometry_test.cpp3
-rw-r--r--editor/editor_tests/osm_editor_test.cpp2
-rw-r--r--editor/editor_tests/osm_editor_test.hpp2
-rw-r--r--editor/editor_tests/ui2oh_test.cpp23
-rw-r--r--editor/editor_tests/xml_feature_test.cpp14
-rw-r--r--editor/new_feature_categories.hpp2
-rw-r--r--editor/opening_hours_ui.hpp2
-rw-r--r--editor/osm_editor.cpp8
-rw-r--r--editor/osm_editor.hpp19
12 files changed, 54 insertions, 31 deletions
diff --git a/editor/changeset_wrapper.cpp b/editor/changeset_wrapper.cpp
index ae14f40889..b3969b44dc 100644
--- a/editor/changeset_wrapper.cpp
+++ b/editor/changeset_wrapper.cpp
@@ -9,9 +9,11 @@
#include "base/macros.hpp"
#include <algorithm>
+#include <cstdint>
#include <exception>
#include <random>
#include <sstream>
+#include <utility>
#include "private.h"
diff --git a/editor/changeset_wrapper.hpp b/editor/changeset_wrapper.hpp
index 46e502969d..d19d9f4531 100644
--- a/editor/changeset_wrapper.hpp
+++ b/editor/changeset_wrapper.hpp
@@ -1,14 +1,15 @@
#pragma once
-#include "base/exception.hpp"
-
#include "editor/server_api.hpp"
#include "editor/xml_feature.hpp"
#include "geometry/point2d.hpp"
#include "geometry/rect2d.hpp"
+#include "base/exception.hpp"
+
#include <map>
+#include <string>
#include <vector>
class FeatureType;
diff --git a/editor/editor_tests/feature_matcher_test.cpp b/editor/editor_tests/feature_matcher_test.cpp
index b38b7ba4b1..3c6c66aa99 100644
--- a/editor/editor_tests/feature_matcher_test.cpp
+++ b/editor/editor_tests/feature_matcher_test.cpp
@@ -3,6 +3,9 @@
#include "editor/feature_matcher.hpp"
#include "editor/xml_feature.hpp"
+#include <string>
+#include <vector>
+
#include "3party/pugixml/src/pugixml.hpp"
namespace
diff --git a/editor/editor_tests/match_by_geometry_test.cpp b/editor/editor_tests/match_by_geometry_test.cpp
index 19a3521a2c..9f4321f11e 100644
--- a/editor/editor_tests/match_by_geometry_test.cpp
+++ b/editor/editor_tests/match_by_geometry_test.cpp
@@ -3,6 +3,9 @@
#include "editor/feature_matcher.hpp"
#include "editor/xml_feature.hpp"
+#include <string>
+#include <vector>
+
#include "3party/pugixml/src/pugixml.hpp"
namespace
diff --git a/editor/editor_tests/osm_editor_test.cpp b/editor/editor_tests/osm_editor_test.cpp
index 1f932f1e43..e6159d318f 100644
--- a/editor/editor_tests/osm_editor_test.cpp
+++ b/editor/editor_tests/osm_editor_test.cpp
@@ -622,7 +622,7 @@ void EditorTest::RollBackChangesTest()
builder.Add(cafe);
});
- const std::string houseNumber = "4a";
+ std::string const houseNumber = "4a";
ForEachCafeAtPoint(m_dataSource, m2::PointD(1.0, 1.0), [&editor, &houseNumber](FeatureType & ft)
{
diff --git a/editor/editor_tests/osm_editor_test.hpp b/editor/editor_tests/osm_editor_test.hpp
index 2a5479d95a..37fffbcd55 100644
--- a/editor/editor_tests/osm_editor_test.hpp
+++ b/editor/editor_tests/osm_editor_test.hpp
@@ -13,6 +13,8 @@
#include "platform/local_country_file_utils.hpp"
+#include "base/assert.hpp"
+
#include <string>
#include <utility>
#include <vector>
diff --git a/editor/editor_tests/ui2oh_test.cpp b/editor/editor_tests/ui2oh_test.cpp
index c9e09a6bcc..0da3122881 100644
--- a/editor/editor_tests/ui2oh_test.cpp
+++ b/editor/editor_tests/ui2oh_test.cpp
@@ -223,11 +223,13 @@ UNIT_TEST(OpeningHours2TimeTableSet_off)
TimeTableSet tts;
TEST(MakeTimeTableSet(oh, tts), ());
- TEST_EQUAL(
- tts.GetUnhandledDays(),
- OpeningDays({osmoh::Weekday::Monday, osmoh::Weekday::Tuesday, osmoh::Weekday::Wednesday,
- osmoh::Weekday::Thursday, osmoh::Weekday::Friday, osmoh::Weekday::Saturday}),
- ());
+ TEST_EQUAL(tts.GetUnhandledDays(),
+ OpeningDays({osmoh::Weekday::Monday,
+ osmoh::Weekday::Tuesday,
+ osmoh::Weekday::Wednesday,
+ osmoh::Weekday::Thursday,
+ osmoh::Weekday::Friday,
+ osmoh::Weekday::Saturday}), ());
}
{
OpeningHours oh("Mo-Su 08:00-13:00,14:00-20:00; Sa 10:00-11:00 off");
@@ -284,11 +286,12 @@ UNIT_TEST(OpeningHours2TimeTableSet_off)
TEST(MakeTimeTableSet(oh, tts), ());
TEST_EQUAL(tts.Size(), 1, ());
- TEST_EQUAL(
- tts.GetUnhandledDays(),
- OpeningDays({osmoh::Weekday::Monday, osmoh::Weekday::Tuesday, osmoh::Weekday::Wednesday,
- osmoh::Weekday::Thursday, osmoh::Weekday::Friday}),
- ());
+ TEST_EQUAL(tts.GetUnhandledDays(),
+ OpeningDays({osmoh::Weekday::Monday,
+ osmoh::Weekday::Tuesday,
+ osmoh::Weekday::Wednesday,
+ osmoh::Weekday::Thursday,
+ osmoh::Weekday::Friday}), ());
}
{
OpeningHours oh("Mo-Fr 11:00-17:00; Sa-Su 12:00-16:00; Mo-Fr 11:00-13:00 off");
diff --git a/editor/editor_tests/xml_feature_test.cpp b/editor/editor_tests/xml_feature_test.cpp
index 0ee64e2839..a591d41035 100644
--- a/editor/editor_tests/xml_feature_test.cpp
+++ b/editor/editor_tests/xml_feature_test.cpp
@@ -265,10 +265,16 @@ UNIT_TEST(XMLFeature_FromXmlNode)
UNIT_TEST(XMLFeature_Geometry)
{
- std::vector<m2::PointD> const geometry = {{28.7206411, 3.7182409}, {46.7569003, 47.0774689},
- {22.5909217, 41.6994874}, {14.7537008, 17.7788229},
- {55.1261701, 10.3199476}, {28.6519654, 50.0305930},
- {28.7206411, 3.7182409}};
+ std::vector<m2::PointD> const geometry =
+ {
+ {28.7206411, 3.7182409},
+ {46.7569003, 47.0774689},
+ {22.5909217, 41.6994874},
+ {14.7537008, 17.7788229},
+ {55.1261701, 10.3199476},
+ {28.6519654, 50.0305930},
+ {28.7206411, 3.7182409}
+ };
XMLFeature feature(XMLFeature::Type::Way);
feature.SetGeometry(geometry);
diff --git a/editor/new_feature_categories.hpp b/editor/new_feature_categories.hpp
index 70ef5af080..132bd1ef33 100644
--- a/editor/new_feature_categories.hpp
+++ b/editor/new_feature_categories.hpp
@@ -18,7 +18,7 @@ namespace osm
class NewFeatureCategories
{
public:
- using TypeName = string;
+ using TypeName = std::string;
using TypeNames = std::vector<TypeName>;
NewFeatureCategories(editor::EditorConfig const & config);
diff --git a/editor/opening_hours_ui.hpp b/editor/opening_hours_ui.hpp
index 8025ff8405..33d7c3fe94 100644
--- a/editor/opening_hours_ui.hpp
+++ b/editor/opening_hours_ui.hpp
@@ -49,8 +49,6 @@ private:
osmoh::TTimespans m_excludeTime;
};
-class TimeTableProxy;
-
class TimeTableSet
{
using TimeTableSetImpl = std::vector<TimeTable>;
diff --git a/editor/osm_editor.cpp b/editor/osm_editor.cpp
index 23ea63852a..59838edc76 100644
--- a/editor/osm_editor.cpp
+++ b/editor/osm_editor.cpp
@@ -852,9 +852,11 @@ void Editor::UploadChanges(string const & key, string const & secret, ChangesetT
if (!m_isUploadingNow)
{
m_isUploadingNow = true;
- GetPlatform().RunTask(Platform::Thread::Network, [
- upload = move(upload), key, secret, tags = move(tags), callback = move(callback)
- ]() { upload(move(key), move(secret), move(tags), move(callback)); });
+ GetPlatform().RunTask(Platform::Thread::Network, [upload = move(upload), key, secret,
+ tags = move(tags), callback = move(callback)]()
+ {
+ upload(move(key), move(secret), move(tags), move(callback));
+ });
}
}
diff --git a/editor/osm_editor.hpp b/editor/osm_editor.hpp
index 90ca99c40e..859723596e 100644
--- a/editor/osm_editor.hpp
+++ b/editor/osm_editor.hpp
@@ -19,10 +19,13 @@
#include "base/timer.hpp"
#include <atomic>
+#include <cstdint>
#include <ctime>
#include <functional>
#include <map>
+#include <memory>
#include <string>
+#include <utility>
#include <vector>
namespace editor
@@ -58,7 +61,7 @@ public:
virtual ~Delegate() = default;
virtual MwmSet::MwmId GetMwmIdByMapName(std::string const & name) const = 0;
- virtual unique_ptr<EditableMapObject> GetOriginalMapObject(FeatureID const & fid) const = 0;
+ virtual std::unique_ptr<EditableMapObject> GetOriginalMapObject(FeatureID const & fid) const = 0;
virtual std::string GetOriginalFeatureStreet(FeatureID const & fid) const = 0;
virtual void ForEachFeatureAtPoint(FeatureTypeFn && fn, m2::PointD const & point) const = 0;
};
@@ -100,9 +103,9 @@ public:
static Editor & Instance();
- void SetDelegate(unique_ptr<Delegate> delegate) { m_delegate = std::move(delegate); }
+ void SetDelegate(std::unique_ptr<Delegate> delegate) { m_delegate = std::move(delegate); }
- void SetStorageForTesting(unique_ptr<editor::StorageBase> storage)
+ void SetStorageForTesting(std::unique_ptr<editor::StorageBase> storage)
{
m_storage = std::move(storage);
}
@@ -214,7 +217,7 @@ private:
/// @returns false if fails.
bool Save(FeaturesContainer const & features) const;
- bool SaveTransaction(shared_ptr<FeaturesContainer> const & features);
+ bool SaveTransaction(std::shared_ptr<FeaturesContainer> const & features);
bool RemoveFeatureIfExists(FeatureID const & fid);
/// Notify framework that something has changed and should be redisplayed.
void Invalidate();
@@ -239,7 +242,7 @@ private:
// These methods are just checked wrappers around Delegate.
MwmSet::MwmId GetMwmIdByMapName(std::string const & name);
- unique_ptr<EditableMapObject> GetOriginalMapObject(FeatureID const & fid) const;
+ std::unique_ptr<EditableMapObject> GetOriginalMapObject(FeatureID const & fid) const;
std::string GetOriginalFeatureStreet(FeatureID const & fid) const;
void ForEachFeatureAtPoint(FeatureTypeFn && fn, m2::PointD const & point) const;
FeatureID GetFeatureIdByXmlFeature(FeaturesContainer const & features,
@@ -259,7 +262,7 @@ private:
/// Deleted, edited and created features.
base::AtomicSharedPtr<FeaturesContainer> m_features;
- unique_ptr<Delegate> m_delegate;
+ std::unique_ptr<Delegate> m_delegate;
/// Invalidate map viewport after edits.
InvalidateFn m_invalidateFn;
@@ -269,9 +272,9 @@ private:
editor::ConfigLoader m_configLoader;
/// Notes to be sent to osm.
- shared_ptr<editor::Notes> m_notes;
+ std::shared_ptr<editor::Notes> m_notes;
- unique_ptr<editor::StorageBase> m_storage;
+ std::unique_ptr<editor::StorageBase> m_storage;
std::atomic<bool> m_isUploadingNow;