Skip to content

Commit ae31743

Browse files
author
mhugent
committed
Fix for dateline labeling problems
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14352 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 13870fa commit ae31743

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/core/pal/layer.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ namespace pal
236236
if ( hashtable->find( geom_id ) )
237237
{
238238
modMutex->unlock();
239-
throw new PalException::FeatureExists();
239+
//A feature with this id already exists. Don't throw an exception as sometimes,
240+
//the same feature is added twice (dateline split with otf-reprojection)
241+
return false;
240242
}
241243

242244
// Split MULTI GEOM and Collection in simple geometries

src/core/pal/pal.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ namespace pal
167167

168168
Layer * Pal::addLayer( const char *lyrName, double min_scale, double max_scale, Arrangement arrangement, Units label_unit, double defaultPriority, bool obstacle, bool active, bool toLabel )
169169
{
170-
171-
172170
Layer *lyr;
173171
lyrsMutex->lock();
174172

@@ -183,7 +181,9 @@ namespace pal
183181
if ( strcmp(( *it )->name, lyrName ) == 0 ) // if layer already known
184182
{
185183
lyrsMutex->unlock();
186-
throw new PalException::LayerExists();
184+
//There is already a layer with this name, so we just return the existing one.
185+
//Sometimes the same layer is added twice (e.g. datetime split with otf-reprojection)
186+
return *it;
187187
}
188188
}
189189

0 commit comments

Comments
 (0)