Skip to content
Permalink
Browse files
Adjust indenting only
git-svn-id: http://svn.osgeo.org/qgis/trunk@5796 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Sep 10, 2006
1 parent 56cfc7e commit 1af445801cd644dcebd740c26e11188ce42c8178
Showing with 28 additions and 28 deletions.
  1. +28 −28 src/providers/gpx/gpsdata.cpp
@@ -330,13 +330,13 @@ GPSData* GPSData::getData(const QString& filename) {
while (!file.atEnd()) {
long int readBytes = file.readBlock(buffer, bufsize);
if (file.atEnd())
atEnd = 1;
atEnd = 1;
if (!XML_Parse(p, buffer, readBytes, atEnd)) {
std::cerr<<"Parse error at line "
<<XML_GetCurrentLineNumber(p)<<": "
<<XML_ErrorString(XML_GetErrorCode(p))<<std::endl;
failed = true;
break;
std::cerr<<"Parse error at line "
<<XML_GetCurrentLineNumber(p)<<": "
<<XML_ErrorString(XML_GetErrorCode(p))<<std::endl;
failed = true;
break;
}
}
delete [] buffer;
@@ -391,9 +391,9 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
mWpt = Waypoint();
for (int i = 0; attr[2*i] != NULL; ++i) {
if (!std::strcmp(attr[2*i], "lat"))
mWpt.lat = QString(attr[2*i+1]).toDouble();
mWpt.lat = QString(attr[2*i+1]).toDouble();
else if (!std::strcmp(attr[2*i], "lon"))
mWpt.lon = QString(attr[2*i+1]).toDouble();
mWpt.lon = QString(attr[2*i+1]).toDouble();
}
mObj = &mWpt;
}
@@ -411,8 +411,8 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
// common properties
else if (!std::strcmp(qName, "name")) {
if (parseModes.top() == ParsingWaypoint ||
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
mString = &mObj->name;
mCharBuffer = "";
parseModes.push(ParsingString);
@@ -422,8 +422,8 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
}
else if (!std::strcmp(qName, "cmt")) {
if (parseModes.top() == ParsingWaypoint ||
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
mString = &mObj->cmt;
mCharBuffer = "";
parseModes.push(ParsingString);
@@ -433,8 +433,8 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
}
else if (!std::strcmp(qName, "desc")) {
if (parseModes.top() == ParsingWaypoint ||
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
mString = &mObj->desc;
mCharBuffer = "";
parseModes.push(ParsingString);
@@ -444,8 +444,8 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
}
else if (!std::strcmp(qName, "src")) {
if (parseModes.top() == ParsingWaypoint ||
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
mString = &mObj->src;
mCharBuffer = "";
parseModes.push(ParsingString);
@@ -455,8 +455,8 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
}
else if (!std::strcmp(qName, "url")) {
if (parseModes.top() == ParsingWaypoint ||
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
mString = &mObj->url;
mCharBuffer = "";
parseModes.push(ParsingString);
@@ -466,8 +466,8 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
}
else if (!std::strcmp(qName, "urlname")) {
if (parseModes.top() == ParsingWaypoint ||
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
parseModes.top() == ParsingRoute ||
parseModes.top() == ParsingTrack) {
mString = &mObj->urlname;
mCharBuffer = "";
parseModes.push(ParsingString);
@@ -516,10 +516,10 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
if (parseModes.top() == ParsingRoute) {
mRtept = Routepoint();
for (int i = 0; attr[2*i] != NULL; ++i) {
if (!std::strcmp(attr[2*i], "lat"))
mRtept.lat = QString(attr[2*i+1]).toDouble();
else if (!std::strcmp(attr[2*i], "lon"))
mRtept.lon = QString(attr[2*i+1]).toDouble();
if (!std::strcmp(attr[2*i], "lat"))
mRtept.lat = QString(attr[2*i+1]).toDouble();
else if (!std::strcmp(attr[2*i], "lon"))
mRtept.lon = QString(attr[2*i+1]).toDouble();
}
parseModes.push(ParsingRoutepoint);
}
@@ -540,10 +540,10 @@ bool GPXHandler::startElement(const XML_Char* qName, const XML_Char** attr) {
if (parseModes.top() == ParsingTrackSegment) {
mTrkpt = Trackpoint();
for (int i = 0; attr[2*i] != NULL; ++i) {
if (!std::strcmp(attr[2*i], "lat"))
mTrkpt.lat = QString(attr[2*i+1]).toDouble();
else if (!std::strcmp(attr[2*i], "lon"))
mTrkpt.lon = QString(attr[2*i+1]).toDouble();
if (!std::strcmp(attr[2*i], "lat"))
mTrkpt.lat = QString(attr[2*i+1]).toDouble();
else if (!std::strcmp(attr[2*i], "lon"))
mTrkpt.lon = QString(attr[2*i+1]).toDouble();
}
parseModes.push(ParsingTrackpoint);
}

0 comments on commit 1af4458

Please sign in to comment.