]> git.mxchange.org Git - flightgear.git/commitdiff
Fix label printing in ATCDialog
authorCsaba Halasz <hcs@vostro.(none)>
Tue, 13 Oct 2009 15:57:00 +0000 (17:57 +0200)
committerTim Moore <timoore@redhat.com>
Sun, 8 Nov 2009 00:18:09 +0000 (01:18 +0100)
src/ATCDCL/ATCDialog.cxx

index f094b1170cc82893a419028af4a11e132cd890ce..f5f5ec935d3f337e7b1efe4ad1cb7b2e613d503b 100644 (file)
@@ -382,7 +382,6 @@ void FGATCDialog::FreqDisplay(string& ident) {
        comm_list_type stations;
        int found = current_commlist->FindByPos(a->geod(), 20.0, &stations);
        if(found) {
-               ostringstream ostr;
                comm_list_iterator itr = stations.begin();
                for (n = 0; itr != stations.end(); ++itr) {
                        if(itr->ident != ident)
@@ -396,8 +395,9 @@ void FGATCDialog::FreqDisplay(string& ident) {
                        copyProperties(freq_group->getNode("group-template", true), entry);
                        entry->removeChildren("enabled", true);
 
+                       ostringstream ostr;
                        ostr << itr->type;
-                       entry->setStringValue("text[0]/label", ostr.str().c_str());
+                       entry->setStringValue("text[0]/label", ostr.str());
 
                        char buf[8];
                        snprintf(buf, 8, "%.2f", (itr->freq / 100.0));  // Convert from KHz to MHz
@@ -406,8 +406,6 @@ void FGATCDialog::FreqDisplay(string& ident) {
                        buf[7] = '\0';
 
                        entry->setStringValue("text[1]/label", buf);
-
-                       ostr.seekp(0);
                        n++;
                }
        }