mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-21 22:03:37 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
#include "indexer/ftypes_matcher.hpp"
|
||||
#include "indexer/road_shields_parser.hpp"
|
||||
|
||||
#include "platform/distance.hpp"
|
||||
#include "platform/duration.hpp"
|
||||
#include "platform/localization.hpp"
|
||||
#include "platform/measurement_utils.hpp"
|
||||
#include "platform/preferred_languages.hpp"
|
||||
#include "platform/utm_mgrs_utils.hpp"
|
||||
#include "platform/distance.hpp"
|
||||
#include "platform/duration.hpp"
|
||||
#include "platform/settings.hpp"
|
||||
#include "platform/utm_mgrs_utils.hpp"
|
||||
|
||||
#include "geometry/mercator.hpp"
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include "3party/open-location-code/openlocationcode.h"
|
||||
|
||||
|
||||
namespace place_page
|
||||
{
|
||||
|
||||
@@ -44,8 +43,8 @@ void Info::SetFromFeatureType(FeatureType & ft)
|
||||
auto const mwmInfo = GetID().m_mwmId.GetInfo();
|
||||
if (mwmInfo)
|
||||
{
|
||||
feature::GetPreferredNames({ m_name, mwmInfo->GetRegionData(), languages::GetCurrentMapLanguage(),
|
||||
true /* allowTranslit */} , out);
|
||||
feature::GetPreferredNames(
|
||||
{m_name, mwmInfo->GetRegionData(), languages::GetCurrentMapLanguage(), true /* allowTranslit */}, out);
|
||||
}
|
||||
|
||||
bool emptyTitle = false;
|
||||
@@ -74,18 +73,15 @@ void Info::SetFromFeatureType(FeatureType & ft)
|
||||
m_uiTitle = m_primaryFeatureName;
|
||||
m_uiSecondaryTitle = out.secondary;
|
||||
}
|
||||
else
|
||||
else if (IsBuilding())
|
||||
{
|
||||
if (IsBuilding())
|
||||
{
|
||||
emptyTitle = m_address.empty();
|
||||
if (!emptyTitle)
|
||||
m_uiTitle = m_address;
|
||||
m_uiAddress.clear(); // already in main title
|
||||
}
|
||||
else
|
||||
emptyTitle = true;
|
||||
emptyTitle = m_address.empty();
|
||||
if (!emptyTitle)
|
||||
m_uiTitle = m_address;
|
||||
m_uiAddress.clear(); // already in main title
|
||||
}
|
||||
else
|
||||
emptyTitle = true;
|
||||
|
||||
// Assign Feature's type if main title is empty.
|
||||
if (emptyTitle)
|
||||
@@ -121,11 +117,12 @@ std::string Info::FormatSubtitle(bool withTypes, bool withMainType) const
|
||||
result += sv;
|
||||
};
|
||||
|
||||
/// @todo(KK): Remove, when the category name will be displayed in the "Edit cell" on the Place Page on the specific platform.
|
||||
#if !defined(TARGET_OS_IPHONE)
|
||||
/// @todo(KK): Remove, when the category name will be displayed in the "Edit cell" on the Place Page on the specific
|
||||
/// platform.
|
||||
#if !defined(TARGET_OS_IPHONE)
|
||||
if (IsBookmark())
|
||||
append(m_bookmarkCategoryName);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!withTypes)
|
||||
return result;
|
||||
@@ -242,10 +239,11 @@ void Info::SetTitlesForBookmark()
|
||||
m_uiTitle = GetBookmarkName();
|
||||
|
||||
std::vector<std::string> subtitle;
|
||||
/// @todo(KK): Remove, when the category name will be displayed in the "edit" of the cell on the Place Page on the specific platform.
|
||||
#if !defined(TARGET_OS_IPHONE)
|
||||
/// @todo(KK): Remove, when the category name will be displayed in the "edit" of the cell on the Place Page on the
|
||||
/// specific platform.
|
||||
#if !defined(TARGET_OS_IPHONE)
|
||||
subtitle.push_back(m_bookmarkCategoryName);
|
||||
#endif
|
||||
#endif
|
||||
if (!m_bookmarkData.m_featureTypes.empty())
|
||||
subtitle.push_back(GetLocalizedFeatureType(m_bookmarkData.m_featureTypes));
|
||||
m_uiSubtitle = strings::JoinStrings(subtitle, feature::kFieldsSeparator);
|
||||
@@ -264,10 +262,11 @@ void Info::SetCustomName(std::string const & name)
|
||||
void Info::SetTitlesForTrack(Track const & track)
|
||||
{
|
||||
m_uiTitle = track.GetName();
|
||||
/// @todo(KK): Remove, when the category name will be displayed in the "Edit cell" on the Place Page on the specific platform.
|
||||
#if !defined(TARGET_OS_IPHONE)
|
||||
/// @todo(KK): Remove, when the category name will be displayed in the "Edit cell" on the Place Page on the specific
|
||||
/// platform.
|
||||
#if !defined(TARGET_OS_IPHONE)
|
||||
m_uiSubtitle = m_bookmarkCategoryName;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
std::vector<std::string> statistics;
|
||||
auto const length = track.GetLengthMeters();
|
||||
@@ -294,8 +293,7 @@ void Info::SetCustomNameWithCoordinates(m2::PointD const & mercator, std::string
|
||||
else
|
||||
{
|
||||
m_uiTitle = name;
|
||||
m_uiSubtitle = measurement_utils::FormatLatLon(
|
||||
mercator::YToLat(mercator.y), mercator::XToLon(mercator.x),
|
||||
m_uiSubtitle = measurement_utils::FormatLatLon(mercator::YToLat(mercator.y), mercator::XToLon(mercator.x),
|
||||
true /* withComma */);
|
||||
}
|
||||
m_customName = name;
|
||||
@@ -358,31 +356,31 @@ std::string Info::GetFormattedCoordinate(CoordinatesFormat coordsFormat) const
|
||||
auto const lon = ll.m_lon;
|
||||
switch (coordsFormat)
|
||||
{
|
||||
default:
|
||||
case CoordinatesFormat::LatLonDMS: // DMS, comma separated
|
||||
return measurement_utils::FormatLatLonAsDMS(lat, lon, false /*withComma*/, 2);
|
||||
case CoordinatesFormat::LatLonDecimal: // Decimal, comma separated
|
||||
return measurement_utils::FormatLatLon(lat, lon, true /* withComma */);
|
||||
case CoordinatesFormat::OLCFull: // Open location code, long format
|
||||
return openlocationcode::Encode({lat, lon});
|
||||
case CoordinatesFormat::OSMLink: // Link to osm.org
|
||||
return measurement_utils::FormatOsmLink(lat, lon, 14);
|
||||
case CoordinatesFormat::UTM: // Universal Transverse Mercator
|
||||
{
|
||||
std::string utmCoords = utm_mgrs_utils::FormatUTM(lat, lon);
|
||||
if (utmCoords.empty())
|
||||
return "UTM: N/A";
|
||||
else
|
||||
return "UTM: " + utmCoords;
|
||||
}
|
||||
case CoordinatesFormat::MGRS: // Military Grid Reference System
|
||||
{
|
||||
std::string mgrsCoords = utm_mgrs_utils::FormatMGRS(lat, lon, 5);
|
||||
if (mgrsCoords.empty())
|
||||
return "MGRS: N/A";
|
||||
else
|
||||
return "MGRS: " + mgrsCoords;
|
||||
}
|
||||
default:
|
||||
case CoordinatesFormat::LatLonDMS: // DMS, comma separated
|
||||
return measurement_utils::FormatLatLonAsDMS(lat, lon, false /*withComma*/, 2);
|
||||
case CoordinatesFormat::LatLonDecimal: // Decimal, comma separated
|
||||
return measurement_utils::FormatLatLon(lat, lon, true /* withComma */);
|
||||
case CoordinatesFormat::OLCFull: // Open location code, long format
|
||||
return openlocationcode::Encode({lat, lon});
|
||||
case CoordinatesFormat::OSMLink: // Link to osm.org
|
||||
return measurement_utils::FormatOsmLink(lat, lon, 14);
|
||||
case CoordinatesFormat::UTM: // Universal Transverse Mercator
|
||||
{
|
||||
std::string utmCoords = utm_mgrs_utils::FormatUTM(lat, lon);
|
||||
if (utmCoords.empty())
|
||||
return "UTM: N/A";
|
||||
else
|
||||
return "UTM: " + utmCoords;
|
||||
}
|
||||
case CoordinatesFormat::MGRS: // Military Grid Reference System
|
||||
{
|
||||
std::string mgrsCoords = utm_mgrs_utils::FormatMGRS(lat, lon, 5);
|
||||
if (mgrsCoords.empty())
|
||||
return "MGRS: N/A";
|
||||
else
|
||||
return "MGRS: " + mgrsCoords;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user