Commit 429811c2 authored by Bernhard Beschow's avatar Bernhard Beschow
Browse files

pass a reference rather than a pointer

parent 2f1b6b94
......@@ -111,9 +111,9 @@ int WayChunk::size() const
return m_wayList.size();
}
bool WayChunk::concatPossible(const PlacemarkPtr &placemark) const
bool WayChunk::concatPossible(const GeoDataPlacemark &placemark) const
{
const GeoDataPlacemark::GeoDataVisualCategory category = placemark->visualCategory();
const GeoDataPlacemark::GeoDataVisualCategory category = placemark.visualCategory();
return (category == m_visualCategory);
}
......
......@@ -46,7 +46,7 @@ public:
qint64 id() const;
void printIds() const;
int size() const;
bool concatPossible(const PlacemarkPtr &placemark) const;
bool concatPossible(const GeoDataPlacemark &placemark) const;
private:
QVector<PlacemarkPtr> m_wayList;
......
......@@ -55,22 +55,22 @@ WayConcatenator::WayConcatenator(GeoDataDocument *document) :
if (!containsFirst && !containsLast) {
createWayChunk(placemark, firstId, lastId);
} else if (containsFirst && !containsLast) {
auto chunk = wayChunk(placemark, firstId);
auto chunk = wayChunk(*placemark, firstId);
if (chunk != nullptr) {
concatFirst(placemark, chunk);
} else {
createWayChunk(placemark, firstId, lastId);
}
} else if (!containsFirst && containsLast) {
auto chunk = wayChunk(placemark, lastId);
auto chunk = wayChunk(*placemark, lastId);
if (chunk != nullptr) {
concatLast(placemark, chunk);
} else {
createWayChunk(placemark, firstId, lastId);
}
} else if (containsFirst && containsLast) {
auto chunk = wayChunk(placemark, firstId);
auto otherChunk = wayChunk(placemark, lastId);
auto chunk = wayChunk(*placemark, firstId);
auto otherChunk = wayChunk(*placemark, lastId);
if (chunk != nullptr && otherChunk != nullptr) {
if(chunk == otherChunk) {
......@@ -151,7 +151,7 @@ void WayConcatenator::createWayChunk(const PlacemarkPtr &placemark, qint64 first
m_chunks.append(chunk);
}
WayChunk::Ptr WayConcatenator::wayChunk(const PlacemarkPtr &placemark, qint64 matchId) const
WayChunk::Ptr WayConcatenator::wayChunk(const GeoDataPlacemark &placemark, qint64 matchId) const
{
QHash<qint64, WayChunk::Ptr>::ConstIterator matchItr = m_hash.find(matchId);
while (matchItr != m_hash.end() && matchItr.key() == matchId) {
......
......@@ -30,7 +30,7 @@ public:
private:
void createWayChunk(const PlacemarkPtr &placemark, qint64 firstId, qint64 lastId);
WayChunk::Ptr wayChunk(const PlacemarkPtr &placemark, qint64 matchId) const;
WayChunk::Ptr wayChunk(const GeoDataPlacemark &placemark, qint64 matchId) const;
void concatFirst(const PlacemarkPtr &placemark, const WayChunk::Ptr &chunk);
void concatLast(const PlacemarkPtr & placemark, const WayChunk::Ptr &chunk);
void concatBoth(const PlacemarkPtr &placemark, const WayChunk::Ptr &chunk, const WayChunk::Ptr &otherChunk);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment