From 54e85e981b6afe62c909fe80c681fb2fda351d5a Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Tue, 5 Mar 2024 23:48:15 -0600 Subject: [PATCH] Remove "Improve this map" where HTML links cannot be shown --- scwx-qt/source/scwx/qt/map/map_widget.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scwx-qt/source/scwx/qt/map/map_widget.cpp b/scwx-qt/source/scwx/qt/map/map_widget.cpp index 90139d19..e64ef32b 100644 --- a/scwx-qt/source/scwx/qt/map/map_widget.cpp +++ b/scwx-qt/source/scwx/qt/map/map_widget.cpp @@ -30,6 +30,8 @@ #include #include +#include +#include #include #include #include @@ -263,8 +265,14 @@ void MapWidgetImpl::ConnectMapSignals() { QTextDocument document {}; document.setHtml(copyrightsHtml); - context_->set_map_copyrights( - document.toPlainText().toStdString()); + + // HTML cannot currently be included in ImGui windows. Where links + // can't be included, remove "Improve this map". + std::string copyrights {document.toPlainText().toStdString()}; + boost::erase_all(copyrights, "Improve this map"); + boost::trim_right(copyrights); + + context_->set_map_copyrights(copyrights); }); }