Skip to content
Permalink
Browse files

pal: registerFeature can return true/false to tell whether the regist…

…ration was successful.

git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@11026 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jul 5, 2009
1 parent 5aa616d commit 01a2b38a0947179af6ddcc1b4bbf431a4e94632c
Showing with 8 additions and 4 deletions.
  1. +5 −3 src/core/pal/layer.cpp
  2. +3 −1 src/core/pal/layer.h
@@ -305,9 +305,10 @@ namespace pal
}
#endif

void Layer::registerFeature( const char *geom_id, PalGeometry *userGeom, double label_x, double label_y )
bool Layer::registerFeature( const char *geom_id, PalGeometry *userGeom, double label_x, double label_y )
{
int j;
int part = 0;

if ( geom_id && label_x >= 0 && label_y >= 0 )
{
@@ -318,7 +319,7 @@ void Layer::registerFeature( const char *geom_id, PalGeometry *userGeom, double
{
modMutex->unlock();
throw new PalException::FeatureExists();
return;
return false;
}

/* Split MULTI GEOM and Collection in simple geometries*/
@@ -328,7 +329,6 @@ void Layer::registerFeature( const char *geom_id, PalGeometry *userGeom, double
LinkedList<Feat*> *finalQueue = splitGeom( the_geom, geom_id, true );

int nGeom = finalQueue->size();
int part = 0;

bool first_feat = true;

@@ -409,6 +409,8 @@ void Layer::registerFeature( const char *geom_id, PalGeometry *userGeom, double
userGeom->releaseGeosGeometry( the_geom );
}
modMutex->unlock();

return (part > 0); // true if we've added something
}


@@ -277,8 +277,10 @@ namespace pal
* @param userGeom user's geometry that implements the PalGeometry interface
*
* @throws PalException::FeatureExists
*
* @return true on success (i.e. valid geometry)
*/
void registerFeature( const char *geom_id, PalGeometry *userGeom, double label_x = -1, double label_y = -1 );
bool registerFeature( const char *geom_id, PalGeometry *userGeom, double label_x = -1, double label_y = -1 );

// TODO implement
//void unregisterFeature (const char *geom_id);

0 comments on commit 01a2b38

Please sign in to comment.
You can’t perform that action at this time.