Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Mar 11, 2018
2 parents 334bedf + e31f444 commit e714294
Show file tree
Hide file tree
Showing 78 changed files with 37,692 additions and 12,117 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -25,7 +25,7 @@ include(FeatureSummary)

# Project declaration

project(Mapper VERSION 0.8.0 LANGUAGES CXX C)
project(Mapper VERSION 0.8.1 LANGUAGES CXX C)

if(Mapper_VERSION_DISPLAY)
message(STATUS "Custom version display string: \"${Mapper_VERSION_DISPLAY}\"")
Expand Down
2 changes: 1 addition & 1 deletion android/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.8.0" android:versionCode="800" package="org.openorienteering.mapper" android:installLocation="auto">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.8.1" android:versionCode="801" package="org.openorienteering.mapper" android:installLocation="auto">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/long_app_name" android:icon="@drawable/icon">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.openorienteering.mapper.MapperActivity"
Expand Down
2 changes: 2 additions & 0 deletions doc/manual/pages/file_menu.md
Expand Up @@ -50,6 +50,8 @@ Permits the import of maps or data in other formats. Currently the following for

Permits the export of the currently opened map to another format. Currently pdf and raster image export are supported.

For raster images, Mapper may additionally create world files. A world file is a small text file which defines the image's georeferencing relative to the map's projected coordinate reference system. Note that these files contain only six numerical parameters. They do not contain an identification of the projection, coordinate system or datum they refer to. The filename is derived from the image's filename, but with a modified filename extension usually ending with letter 'w'.


---

Expand Down
4 changes: 2 additions & 2 deletions doc/manual/pages/find_objects.md
Expand Up @@ -37,7 +37,7 @@ The following expressions are supported:
| expr1 OR expr2 | matching expression expr1 or expr2 (or both) |
| key = value | having a tag with the given key and value |
| key ~= word | having a tag with the given key and a value containing "word" |
| key != word | having a tag with the given key and a value different from "word" |
| key != word | having a tag with the given key and a value different from "word", or not having a tag with this key |

AND has precedence over OR. You may use parentheses to nest operators in another way.

Expand All @@ -58,7 +58,7 @@ The "Query editor" button will replace the input field with a table for entering
Pressing the button again will restore the input field and make it show the query from editor view.


## Query editor
## Query editor {#query-editor}

![Query editor](images/query_editor.png)

Expand Down
9 changes: 9 additions & 0 deletions iwyu-mapper.imp
Expand Up @@ -17,4 +17,13 @@
# ?
{ include: [ "<ext/alloc_traits.h>", "private", "<memory>", "public" ] },

# libstdc++ debugging headers, for use with -D_GLIBCXX_DEBUG
{ include: [ "<debug/map.h>", "private", "<map>", "public" ] },
{ include: [ "<debug/safe_iterator.h>", "private", "<iterator>", "public" ] },
{ include: [ "<debug/safe_sequence.h>", "private", "<iterator>", "public" ] },
{ include: [ "<debug/set.h>", "private", "<set>", "public" ] },
{ include: [ "<debug/unordered_map>", "private", "<unordered_map>", "public" ] },
{ include: [ "<debug/unordered_set>", "private", "<unordered_set>", "public" ] },
{ include: [ "<debug/vector>", "private", "<vector>", "public" ] },

]
2 changes: 1 addition & 1 deletion packaging/linux/Mapper.desktop
Expand Up @@ -3,7 +3,7 @@ Type=Application
Name=OpenOrienteering Mapper
Comment=A free software for drawing orienteering maps
Comment[cs]=Svobodný program na kreslení map pro orientační běh
Comment[da]=En gratis software til tegning af orienteringskort
Comment[da]=Et gratis program til tegning af orienteringskort
Comment[de]=Ein freies Programm zum Zeichnen von Orientierungslaufkarten
Comment[eo]=Libera programaro por desegni orientiĝajn mapojn
Comment[es]=Software libre para dibujar mapas de orientación
Expand Down
8 changes: 6 additions & 2 deletions packaging/linux/openorienteering-mapper.xml
Expand Up @@ -4,14 +4,16 @@
<sub-class-of type="text/xml"/>
<comment>Orienteering map</comment>
<comment xml:lang="cs">Mapa pro orientační běh</comment>
<comment xml:lang="da">Orienteringsløb-kort</comment>
<comment xml:lang="da">Orienteringskort</comment>
<comment xml:lang="de">Orientierungslaufkarte</comment>
<comment xml:lang="eo">Orientiĝa mapo</comment>
<comment xml:lang="es">Mapa de orientación</comment>
<comment xml:lang="fi">Suunnistuskartta</comment>
<comment xml:lang="fr">Carte d'orientation</comment>
<comment xml:lang="hu">Tájfutó térkép</comment>
<comment xml:lang="id">Peta orienteering</comment>
<comment xml:lang="ja">オリエンテーリング地図</comment>
<comment xml:lang="lv">Orientēšanās karte</comment>
<comment xml:lang="nb">Orienteringskart</comment>
<comment xml:lang="nl">Oriëntatiekaart</comment>
<comment xml:lang="pt_BR">Mapa de orientação</comment>
Expand All @@ -25,14 +27,16 @@
<mime-type type="application/x-openorienteering-ocd">
<comment>Orienteering map</comment>
<comment xml:lang="cs">Mapa pro orientační běh</comment>
<comment xml:lang="da">Orienteringsløb-kort</comment>
<comment xml:lang="da">Orienteringskort</comment>
<comment xml:lang="de">Orientierungslaufkarte</comment>
<comment xml:lang="eo">Orientiĝa mapo</comment>
<comment xml:lang="es">Mapa de orientación</comment>
<comment xml:lang="fi">Suunnistuskartta</comment>
<comment xml:lang="fr">Carte d'orientation</comment>
<comment xml:lang="hu">Tájfutó térkép</comment>
<comment xml:lang="id">Peta orienteering</comment>
<comment xml:lang="ja">オリエンテーリング地図</comment>
<comment xml:lang="lv">Orientēšanās karte</comment>
<comment xml:lang="nb">Orienteringskart</comment>
<comment xml:lang="nl">Oriëntatiekaart</comment>
<comment xml:lang="pt_BR">Mapa de orientação</comment>
Expand Down
35 changes: 23 additions & 12 deletions src/core/map.cpp
Expand Up @@ -46,6 +46,7 @@
#include <QSaveFile>
#include <QStringList>
#include <QTextDocument>
#include <QTimer>
#include <QTranslator>

#include "core/georeferencing.h"
Expand Down Expand Up @@ -221,8 +222,12 @@ MapColorMap Map::MapColorSet::importSet(const Map::MapColorSet& other, std::vect
{
colors.reserve(colors.size() + import_count);

MapColorSetMergeList merge_list;
merge_list.resize(other.colors.size());
// The conflict resolution algorithm below is simplified by setting
// iterator `selected_item` to a real list element which is not related
// to the actual color sets we are merging. This is the extra element
// identified as `end_of_merge_list`.
MapColorSetMergeList merge_list{other.colors.size() + 1};
const auto end_of_merge_list = end(merge_list) - 1;

bool priorities_changed = false;

Expand All @@ -249,15 +254,15 @@ MapColorMap Map::MapColorSet::importSet(const Map::MapColorSet& other, std::vect
}
++merge_list_item;
}
Q_ASSERT(merge_list_item == merge_list.end());
Q_ASSERT(merge_list_item == end_of_merge_list);

size_t iteration_number = 1;
while (true)
{
// Evaluate bounds and conflicting order of colors
int max_conflict_reduction = 0;
auto selected_item = merge_list.end();
for (merge_list_item = merge_list.begin(); merge_list_item != merge_list.end(); ++merge_list_item)
auto selected_item = end_of_merge_list; // Note: non-const copy of an iterator
for (merge_list_item = begin(merge_list); merge_list_item != end_of_merge_list; ++merge_list_item)
{
// Check all lower colors for a higher dest_index
std::size_t& lower_bound(merge_list_item->lower_bound);
Expand All @@ -281,7 +286,7 @@ MapColorMap Map::MapColorSet::importSet(const Map::MapColorSet& other, std::vect
// Check all higher colors for a lower dest_index
std::size_t& upper_bound(merge_list_item->upper_bound);
upper_bound = merge_list_item->dest_color ? merge_list_item->dest_index : colors.size();
for (++it; it != merge_list.end(); ++it)
for (++it; it != end_of_merge_list; ++it)
{
if (it->dest_color)
{
Expand Down Expand Up @@ -319,7 +324,7 @@ MapColorMap Map::MapColorSet::importSet(const Map::MapColorSet& other, std::vect
int conflict_reduction = merge_list_item->lower_errors;
// Check new conflicts with insertion index: (selected_item->lower_bound+1)
it = merge_list_item;
for (++it; it != merge_list.end(); ++it)
for (++it; it != end_of_merge_list; ++it)
{
if (it->dest_color && (selected_item->lower_bound+1) > it->dest_index)
--conflict_reduction;
Expand All @@ -337,8 +342,8 @@ MapColorMap Map::MapColorSet::importSet(const Map::MapColorSet& other, std::vect
// Abort if no conflicts or maximum iteration count reached.
// The latter condition is just to prevent endless loops in
// case of bugs and should not occur theoretically.
if (selected_item == merge_list.end() ||
iteration_number > merge_list.size())
if (selected_item == end_of_merge_list
|| iteration_number > merge_list.size())
break;

// Solve selected conflict item
Expand All @@ -365,6 +370,8 @@ MapColorMap Map::MapColorSet::importSet(const Map::MapColorSet& other, std::vect
++iteration_number;
}

merge_list.erase(end_of_merge_list); // no longer needed

// Some missing colors may be spot color compositions which can be
// resolved to new colors only after all colors have been created.
// That is why we create all missing colors first.
Expand Down Expand Up @@ -448,9 +455,6 @@ Map::Map()
georeferencing.reset(new Georeferencing());
init();

connect(this, &Map::symbolAdded, this, &Map::updateSymbolIconZoom, Qt::QueuedConnection);
connect(this, &Map::symbolChanged, this, &Map::updateSymbolIconZoom, Qt::QueuedConnection);
connect(this, &Map::symbolDeleted, this, &Map::updateSymbolIconZoom, Qt::QueuedConnection);
connect(this, &Map::colorAdded, this, &Map::checkSpotColorPresence);
connect(this, &Map::colorChanged, this, &Map::checkSpotColorPresence);
connect(this, &Map::colorDeleted, this, &Map::checkSpotColorPresence);
Expand Down Expand Up @@ -1884,6 +1888,11 @@ int Map::findSymbolIndex(const Symbol* symbol) const

void Map::setSymbolsDirty()
{
if (symbol_icon_scale > 0)
{
symbol_icon_scale = 0;
QTimer::singleShot(0, this, SLOT(updateSymbolIconZoom()));
}
symbols_dirty = true;
setHasUnsavedChanges(true);
}
Expand Down Expand Up @@ -1980,6 +1989,8 @@ void Map::updateSymbolIconZoom()
values.reserve(symbols.size());
for (const auto symbol : symbols)
{
if (symbol->isHelperSymbol())
continue;
auto size = symbol->dimensionForIcon();
if (size > 0)
values.push_back(size);
Expand Down
2 changes: 2 additions & 0 deletions src/core/map.h
Expand Up @@ -595,6 +595,7 @@ friend class XMLFileExporter;
*/
qreal symbolIconZoom() const;

public slots:
/**
* Updates the symbol icon zoom from the current set of symbols.
*
Expand All @@ -605,6 +606,7 @@ friend class XMLFileExporter;
void updateSymbolIconZoom();


public:
// Templates

/** Returns the number of templates in this map. */
Expand Down
6 changes: 3 additions & 3 deletions src/core/map_view.cpp
Expand Up @@ -113,7 +113,7 @@ void MapView::load(QIODevice* file, int version)
{
center_pos = MapCoord::fromNative64withOffset(center_x, center_y);
}
catch (std::range_error)
catch (std::range_error&)
{
// leave center_pos unchanged
}
Expand Down Expand Up @@ -199,7 +199,7 @@ void MapView::load(QXmlStreamReader& xml)
{
center_pos = MapCoord::fromNative64withOffset(center_x, center_y);
}
catch (std::range_error)
catch (std::range_error&)
{
// leave center_pos unchanged
}
Expand Down Expand Up @@ -341,7 +341,7 @@ void MapView::finishPanning(QPoint offset)
auto move = MapCoord{ rotated_offset_f };
setCenter(center() + move);
}
catch (std::range_error)
catch (std::range_error&)
{
// Do nothing
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/objects/boolean_tool.cpp
Expand Up @@ -336,7 +336,7 @@ void BooleanTool::outerPolyNodeToPathObjects(const ClipperLib::PolyNode& node, P

out_objects.push_back(object.release());
}
catch (std::range_error)
catch (std::range_error&)
{
// Do nothing
}
Expand Down

0 comments on commit e714294

Please sign in to comment.