Ticket #1434: RoadCommands.cpp.patch

File RoadCommands.cpp.patch, 1.2 KB (added by Homme Zwaagstra, 11 years ago)

A patch for the RoadAddTrackPointCommand::fromXML function

  • RoadCommands.cpp

     
    8585RoadAddTrackPointCommand * RoadAddTrackPointCommand::fromXML(MapDocument * d, QDomElement e)
    8686{
    8787        RoadAddTrackPointCommand* a = new RoadAddTrackPointCommand();
     88        MapLayer* layer = NULL;
    8889        a->setId(e.attribute("xml:id"));
    8990        if (e.hasAttribute("layer"))
    90                 a->theLayer = d->getLayer(e.attribute("layer"));
     91                layer = a->theLayer = d->getLayer(e.attribute("layer"));
    9192        else
    9293                a->theLayer = NULL;
    9394        if (e.hasAttribute("oldlayer"))
    94                 a->oldLayer = d->getLayer(e.attribute("oldlayer"));
     95                layer = a->oldLayer = d->getLayer(e.attribute("oldlayer"));
    9596        else
    9697                a->oldLayer = NULL;
    97         a->theRoad = MapFeature::getWayOrCreatePlaceHolder(d, a->theLayer, e.attribute("road"));
    98         a->theTrackPoint = MapFeature::getTrackPointOrCreatePlaceHolder(d, a->theLayer, e.attribute("trackpoint"));
     98        a->theRoad = MapFeature::getWayOrCreatePlaceHolder(d, layer, e.attribute("road"));
     99        a->theTrackPoint = MapFeature::getTrackPointOrCreatePlaceHolder(d, layer, e.attribute("trackpoint"));
    99100        a->Position = e.attribute("pos").toUInt();
    100101
    101102        Command::fromXML(d, e, a);