Placefile fixes for Linux/gcc

This commit is contained in:
Dan Paulat 2023-07-23 08:45:14 -05:00
parent 36dd2945b0
commit 0064733679
2 changed files with 6 additions and 3 deletions

View file

@ -23,7 +23,7 @@ static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
class PlacefileLayer::Impl class PlacefileLayer::Impl
{ {
public: public:
explicit Impl(std::shared_ptr<MapContext> context) {}; explicit Impl() {};
~Impl() = default; ~Impl() = default;
void void
@ -46,7 +46,7 @@ public:
}; };
PlacefileLayer::PlacefileLayer(std::shared_ptr<MapContext> context) : PlacefileLayer::PlacefileLayer(std::shared_ptr<MapContext> context) :
DrawLayer(context), p(std::make_unique<PlacefileLayer::Impl>(context)) DrawLayer(context), p(std::make_unique<PlacefileLayer::Impl>())
{ {
} }
@ -168,6 +168,9 @@ void PlacefileLayer::Render(
params, params,
std::static_pointer_cast<gr::Placefile::TextDrawItem>(drawItem)); std::static_pointer_cast<gr::Placefile::TextDrawItem>(drawItem));
break; break;
default:
break;
} }
} }
} }

View file

@ -74,7 +74,7 @@ Qt::ItemFlags PlacefileModel::flags(const QModelIndex& index) const
QVariant PlacefileModel::data(const QModelIndex& index, int role) const QVariant PlacefileModel::data(const QModelIndex& index, int role) const
{ {
if (!index.isValid() || index.row() < 0 || if (!index.isValid() || index.row() < 0 ||
index.row() >= p->placefileNames_.size()) static_cast<std::size_t>(index.row()) >= p->placefileNames_.size())
{ {
return QVariant(); return QVariant();
} }