Skip to content

Commit

Permalink
VKEYBD: Slight cleanup in ImageMap code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schickel committed Jan 3, 2012
1 parent c98a123 commit d0ddd29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions backends/vkeybd/image-map.cpp
Expand Up @@ -53,19 +53,18 @@ void ImageMap::removeArea(const String &id) {
}

void ImageMap::removeAllAreas() {
HashMap<String, Polygon *>::iterator it;
for (it = _areas.begin(); it != _areas.end(); ++it) {
for (AreaMap::iterator it = _areas.begin(); it != _areas.end(); ++it) {
delete it->_value;
}
_areas.clear();
}

String ImageMap::findMapArea(int16 x, int16 y) {
HashMap<String, Polygon *>::iterator it;
for (it = _areas.begin(); it != _areas.end(); ++it) {
for (AreaMap::iterator it = _areas.begin(); it != _areas.end(); ++it) {
if (it->_value->contains(x, y))
return it->_key;
}

return String();
}

Expand Down
5 changes: 2 additions & 3 deletions backends/vkeybd/image-map.h
Expand Up @@ -35,9 +35,7 @@ namespace Common {
struct Polygon;

class ImageMap {

public:

~ImageMap();

Polygon *createArea(const String &id);
Expand All @@ -46,7 +44,8 @@ class ImageMap {
String findMapArea(int16 x, int16 y);

protected:
HashMap<String, Polygon *> _areas;
typedef HashMap<String, Polygon *> AreaMap;
AreaMap _areas;
};


Expand Down

0 comments on commit d0ddd29

Please sign in to comment.