Changeset 10840 for issm/trunk/src/c/objects/KML
- Timestamp:
- 11/22/11 12:06:01 (13 years ago)
- Location:
- issm/trunk/src/c/objects/KML
- Files:
-
- 2 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/KML/KMLFileReadUtils.cpp
r10629 r10840 20 20 /*}}}*/ 21 21 22 /*FUNCTION KMLFileToken(FILE* fid) {{{1*/ 23 char* KMLFileToken(FILE* fid){ 22 /*FUNCTION KMLFileToken(FILE* fid,int* pncom=NULL,char*** ppcom=NULL) {{{1*/ 23 char* KMLFileToken(FILE* fid, 24 int* pncom=NULL,char*** ppcom=NULL){ 24 25 25 26 /* get the next token (tag or field) in the file */ … … 54 55 } 55 56 else { 56 xfree((void**)&bufferc); 57 if (pncom && ppcom) { 58 (*pncom)++; 59 *ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*)); 60 (*ppcom)[*pncom-1]=bufferc; 61 } 62 else 63 xfree((void**)&bufferc); 57 64 inew=1; 58 65 continue; … … 83 90 /* accumulate field, including newlines */ 84 91 else if (ifield) { 85 /* distinguish between closingtag or comment */92 /* distinguish between another tag or comment */ 86 93 if (c == '<') { 87 94 ungetc(c,fid); … … 89 96 break; 90 97 else 91 xfree((void**)&bufferc); 98 if (pncom && ppcom) { 99 (*pncom)++; 100 *ppcom=(char **) xrealloc(*ppcom,*pncom*sizeof(char*)); 101 (*ppcom)[*pncom-1]=bufferc; 102 } 103 else 104 xfree((void**)&bufferc); 92 105 } 93 106 else { … … 275 288 /* get next token and convert to appropriate format */ 276 289 277 if (!(kstr=KMLFileToken(fid)) || 290 if (!(kstr=KMLFileToken(fid, 291 NULL,NULL)) || 278 292 (kstr[0] == '<')) 279 293 _error_("KMLFileTokenParse -- Missing integer field for %s.\n",ktag); … … 285 299 286 300 if (ktag) 287 if (!(kstr=KMLFileToken(fid)) || 301 if (!(kstr=KMLFileToken(fid, 302 NULL,NULL)) || 288 303 (kstr[0] != '<') || 289 304 (kstr[1] != '/') || … … 309 324 /* get next token and convert to appropriate format */ 310 325 311 if (!(kstr=KMLFileToken(fid)) || 326 if (!(kstr=KMLFileToken(fid, 327 NULL,NULL)) || 312 328 (kstr[0] == '<')) 313 329 _error_("KMLFileTokenParse -- Missing bool field for %s.\n",ktag); … … 320 336 321 337 if (ktag) 322 if (!(kstr=KMLFileToken(fid)) || 338 if (!(kstr=KMLFileToken(fid, 339 NULL,NULL)) || 323 340 (kstr[0] != '<') || 324 341 (kstr[1] != '/') || … … 344 361 /* get next token and allocate if necessary */ 345 362 346 if (!(kstr=KMLFileToken(fid)) || 363 if (!(kstr=KMLFileToken(fid, 364 NULL,NULL)) || 347 365 (kstr[0] == '<')) 348 366 _error_("KMLFileTokenParse -- Missing string field for %s.\n",ktag); … … 372 390 373 391 if (ktag) 374 if (!(kstr=KMLFileToken(fid)) || 392 if (!(kstr=KMLFileToken(fid, 393 NULL,NULL)) || 375 394 (kstr[0] != '<') || 376 395 (kstr[1] != '/') || … … 395 414 /* get next token and convert to appropriate format */ 396 415 397 if (!(kstr=KMLFileToken(fid)) || 416 if (!(kstr=KMLFileToken(fid, 417 NULL,NULL)) || 398 418 (kstr[0] == '<')) 399 419 _error_("KMLFileTokenParse -- Missing integer field for %s.\n",ktag); … … 405 425 406 426 if (ktag) 407 if (!(kstr=KMLFileToken(fid)) || 427 if (!(kstr=KMLFileToken(fid, 428 NULL,NULL)) || 408 429 (kstr[0] != '<') || 409 430 (kstr[1] != '/') || … … 428 449 /* get next token and convert to appropriate format */ 429 450 430 if (!(kstr=KMLFileToken(fid)) || 451 if (!(kstr=KMLFileToken(fid, 452 NULL,NULL)) || 431 453 (kstr[0] == '<')) 432 454 _error_("KMLFileTokenParse -- Missing integer field for %s.\n",ktag); … … 438 460 439 461 if (ktag) 440 if (!(kstr=KMLFileToken(fid)) || 462 if (!(kstr=KMLFileToken(fid, 463 NULL,NULL)) || 441 464 (kstr[0] != '<') || 442 465 (kstr[1] != '/') || … … 464 487 /* get next token and allocate if necessary */ 465 488 466 if (!(kstr=KMLFileToken(fid)) || 489 if (!(kstr=KMLFileToken(fid, 490 NULL,NULL)) || 467 491 (kstr[0] == '<')) 468 492 _error_("KMLFileTokenParse -- Missing double [m] field for %s.\n",ktag); … … 495 519 496 520 if (ktag) 497 if (!(kstr=KMLFileToken(fid)) || 521 if (!(kstr=KMLFileToken(fid, 522 NULL,NULL)) || 498 523 (kstr[0] != '<') || 499 524 (kstr[1] != '/') || … … 523 548 /* get next token and allocate if necessary */ 524 549 525 if (!(kstr=KMLFileToken(fid)) || 550 if (!(kstr=KMLFileToken(fid, 551 NULL,NULL)) || 526 552 (kstr[0] == '<')) 527 553 _error_("KMLFileTokenParse -- Missing double [m x 3] field for %s.\n",ktag); … … 561 587 562 588 if (ktag) 563 if (!(kstr=KMLFileToken(fid)) || 589 if (!(kstr=KMLFileToken(fid, 590 NULL,NULL)) || 564 591 (kstr[0] != '<') || 565 592 (kstr[1] != '/') || … … 590 617 /* if next token is a closing tag, compare to input */ 591 618 592 while (kstr=KMLFileToken(fid)) { 619 while (kstr=KMLFileToken(fid, 620 NULL,NULL)) { 593 621 if ((kstr[0] == '<') && 594 622 (kstr[1] == '/') && -
issm/trunk/src/c/objects/KML/KMLFileReadUtils.h
r10629 r10840 15 15 16 16 /* local prototypes: */ 17 char* KMLFileToken(FILE* fid); 17 char* KMLFileToken(FILE* fid, 18 int* pncom,char*** ppcom); 18 19 char* KMLFileTokenComment(FILE* fid); 19 20 void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen, -
issm/trunk/src/c/objects/KML/KML_Document.cpp
r10629 r10840 78 78 WriteAttrib(filout," "); 79 79 fprintf(filout,">\n"); 80 WriteCommnt(filout,indent); 80 81 81 82 KML_Container::Write(filout,indent); … … 91 92 92 93 char* kstri; 94 int ncom=0; 95 char** pcom=NULL; 93 96 94 97 /* get object attributes and check for solo tag */ … … 100 103 /* loop over and process fields within opening and closing tags */ 101 104 102 while (kstri=KMLFileToken(fid)) { 105 while (kstri=KMLFileToken(fid, 106 &ncom,&pcom)) { 103 107 if (!strncmp(kstri,"</Document",10)) { 104 108 xfree((void**)&kstri); … … 116 120 } 117 121 122 this->AddCommnt(ncom,pcom); 123 124 for (ncom; ncom>0; ncom--) 125 xfree((void**)&(pcom[ncom-1])); 126 xfree((void**)&pcom); 127 118 128 return; 119 129 } -
issm/trunk/src/c/objects/KML/KML_File.cpp
r10629 r10840 103 103 WriteAttrib(filout," "); 104 104 fprintf(filout,">\n"); 105 WriteCommnt(filout,indent); 105 106 106 107 KML_Object::Write(filout,indent); … … 125 126 126 127 char* kstri; 128 int ncom=0; 129 char** pcom=NULL; 127 130 KML_Object* kobj; 128 131 … … 135 138 /* loop over and process fields within opening and closing tags */ 136 139 137 while (kstri=KMLFileToken(fid)) { 140 while (kstri=KMLFileToken(fid, 141 &ncom,&pcom)) { 138 142 if (!strncmp(kstri,"</kml", 5)) { 139 143 xfree((void**)&kstri); … … 253 257 } 254 258 259 this->AddCommnt(ncom,pcom); 260 261 for (ncom; ncom>0; ncom--) 262 xfree((void**)&(pcom[ncom-1])); 263 xfree((void**)&pcom); 264 255 265 return; 256 266 } -
issm/trunk/src/c/objects/KML/KML_Folder.cpp
r10629 r10840 78 78 WriteAttrib(filout," "); 79 79 fprintf(filout,">\n"); 80 WriteCommnt(filout,indent); 80 81 81 82 KML_Container::Write(filout,indent); … … 91 92 92 93 char* kstri; 94 int ncom=0; 95 char** pcom=NULL; 93 96 94 97 /* get object attributes and check for solo tag */ … … 100 103 /* loop over and process fields within opening and closing tags */ 101 104 102 while (kstri=KMLFileToken(fid)) { 105 while (kstri=KMLFileToken(fid, 106 &ncom,&pcom)) { 103 107 if (!strncmp(kstri,"</Folder", 8)) { 104 108 xfree((void**)&kstri); … … 116 120 } 117 121 122 this->AddCommnt(ncom,pcom); 123 124 for (ncom; ncom>0; ncom--) 125 xfree((void**)&(pcom[ncom-1])); 126 xfree((void**)&pcom); 127 118 128 return; 119 129 } -
issm/trunk/src/c/objects/KML/KML_GroundOverlay.cpp
r10629 r10840 102 102 WriteAttrib(filout," "); 103 103 fprintf(filout,">\n"); 104 WriteCommnt(filout,indent); 104 105 105 106 KML_Overlay::Write(filout,indent); … … 124 125 125 126 char* kstri; 127 int ncom=0; 128 char** pcom=NULL; 126 129 127 130 /* get object attributes and check for solo tag */ … … 133 136 /* loop over and process fields within opening and closing tags */ 134 137 135 while (kstri=KMLFileToken(fid)) { 138 while (kstri=KMLFileToken(fid, 139 &ncom,&pcom)) { 136 140 if (!strncmp(kstri,"</GroundOverlay",15)) { 137 141 xfree((void**)&kstri); … … 162 166 } 163 167 168 this->AddCommnt(ncom,pcom); 169 170 for (ncom; ncom>0; ncom--) 171 xfree((void**)&(pcom[ncom-1])); 172 xfree((void**)&pcom); 173 164 174 return; 165 175 } -
issm/trunk/src/c/objects/KML/KML_Icon.cpp
r10629 r10840 103 103 WriteAttrib(filout," "); 104 104 fprintf(filout,">\n"); 105 WriteCommnt(filout,indent); 105 106 106 107 KML_Object::Write(filout,indent); … … 130 131 131 132 char* kstri; 133 int ncom=0; 134 char** pcom=NULL; 132 135 133 136 /* get object attributes and check for solo tag */ … … 139 142 /* loop over and process fields within opening and closing tags */ 140 143 141 while (kstri=KMLFileToken(fid)) { 144 while (kstri=KMLFileToken(fid, 145 &ncom,&pcom)) { 142 146 if (!strncmp(kstri,"</Icon", 6)) { 143 147 xfree((void**)&kstri); … … 188 192 } 189 193 190 return; 191 } 192 /*}}}*/ 193 194 this->AddCommnt(ncom,pcom); 195 196 for (ncom; ncom>0; ncom--) 197 xfree((void**)&(pcom[ncom-1])); 198 xfree((void**)&pcom); 199 200 return; 201 } 202 /*}}}*/ 203 -
issm/trunk/src/c/objects/KML/KML_LatLonBox.cpp
r10629 r10840 94 94 WriteAttrib(filout," "); 95 95 fprintf(filout,">\n"); 96 WriteCommnt(filout,indent); 96 97 97 98 KML_Object::Write(filout,indent); … … 113 114 114 115 char* kstri; 116 int ncom=0; 117 char** pcom=NULL; 115 118 116 119 /* get object attributes and check for solo tag */ … … 122 125 /* loop over and process fields within opening and closing tags */ 123 126 124 while (kstri=KMLFileToken(fid)) { 127 while (kstri=KMLFileToken(fid, 128 &ncom,&pcom)) { 125 129 if (!strncmp(kstri,"</LatLonBox",11)) { 126 130 xfree((void**)&kstri); … … 159 163 } 160 164 165 this->AddCommnt(ncom,pcom); 166 167 for (ncom; ncom>0; ncom--) 168 xfree((void**)&(pcom[ncom-1])); 169 xfree((void**)&pcom); 170 161 171 return; 162 172 } -
issm/trunk/src/c/objects/KML/KML_LineString.cpp
r10629 r10840 103 103 WriteAttrib(filout," "); 104 104 fprintf(filout,">\n"); 105 WriteCommnt(filout,indent); 105 106 106 107 KML_Geometry::Write(filout,indent); … … 128 129 129 130 char* kstri; 131 int ncom=0; 132 char** pcom=NULL; 130 133 131 134 /* get object attributes and check for solo tag */ … … 137 140 /* loop over and process fields within opening and closing tags */ 138 141 139 while (kstri=KMLFileToken(fid)) { 142 while (kstri=KMLFileToken(fid, 143 &ncom,&pcom)) { 140 144 if (!strncmp(kstri,"</LineString",12)) { 141 145 xfree((void**)&kstri); … … 170 174 } 171 175 176 this->AddCommnt(ncom,pcom); 177 178 for (ncom; ncom>0; ncom--) 179 xfree((void**)&(pcom[ncom-1])); 180 xfree((void**)&pcom); 181 172 182 return; 173 183 } -
issm/trunk/src/c/objects/KML/KML_LineStyle.cpp
r10629 r10840 83 83 WriteAttrib(filout," "); 84 84 fprintf(filout,">\n"); 85 WriteCommnt(filout,indent); 85 86 86 87 KML_ColorStyle::Write(filout,indent); … … 98 99 99 100 char* kstri; 101 int ncom=0; 102 char** pcom=NULL; 100 103 101 104 /* get object attributes and check for solo tag */ … … 107 110 /* loop over and process fields within opening and closing tags */ 108 111 109 while (kstri=KMLFileToken(fid)) { 112 while (kstri=KMLFileToken(fid, 113 &ncom,&pcom)) { 110 114 if (!strncmp(kstri,"</LineStyle",11)) { 111 115 xfree((void**)&kstri); … … 128 132 } 129 133 134 this->AddCommnt(ncom,pcom); 135 136 for (ncom; ncom>0; ncom--) 137 xfree((void**)&(pcom[ncom-1])); 138 xfree((void**)&pcom); 139 130 140 return; 131 141 } -
issm/trunk/src/c/objects/KML/KML_LinearRing.cpp
r10629 r10840 103 103 WriteAttrib(filout," "); 104 104 fprintf(filout,">\n"); 105 WriteCommnt(filout,indent); 105 106 106 107 KML_Geometry::Write(filout,indent); … … 128 129 129 130 char* kstri; 131 int ncom=0; 132 char** pcom=NULL; 130 133 131 134 /* get object attributes and check for solo tag */ … … 137 140 /* loop over and process fields within opening and closing tags */ 138 141 139 while (kstri=KMLFileToken(fid)) { 142 while (kstri=KMLFileToken(fid, 143 &ncom,&pcom)) { 140 144 if (!strncmp(kstri,"</LinearRing",12)) { 141 145 xfree((void**)&kstri); … … 169 173 xfree((void**)&kstri); 170 174 } 175 176 this->AddCommnt(ncom,pcom); 177 178 for (ncom; ncom>0; ncom--) 179 xfree((void**)&(pcom[ncom-1])); 180 xfree((void**)&pcom); 171 181 172 182 return; -
issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp
r10629 r10840 103 103 WriteAttrib(filout," "); 104 104 fprintf(filout,">\n"); 105 WriteCommnt(filout,indent); 105 106 106 107 KML_Geometry::Write(filout,indent); … … 125 126 126 127 char* kstri; 128 int ncom=0; 129 char** pcom=NULL; 127 130 KML_Object* kobj; 128 131 … … 135 138 /* loop over and process fields within opening and closing tags */ 136 139 137 while (kstri=KMLFileToken(fid)) { 140 while (kstri=KMLFileToken(fid, 141 &ncom,&pcom)) { 138 142 if (!strncmp(kstri,"</MultiGeometry",15)) { 139 143 xfree((void**)&kstri); … … 181 185 } 182 186 187 this->AddCommnt(ncom,pcom); 188 189 for (ncom; ncom>0; ncom--) 190 xfree((void**)&(pcom[ncom-1])); 191 xfree((void**)&pcom); 192 183 193 return; 184 194 } -
issm/trunk/src/c/objects/KML/KML_Object.cpp
r9761 r10840 25 25 26 26 attrib =new DataSet; 27 commnt =new DataSet; 27 28 28 29 } … … 35 36 attrib =NULL; 36 37 } 38 if (commnt) { 39 delete commnt; 40 commnt =NULL; 41 } 37 42 38 43 } … … 46 51 47 52 _printf_(flag," attrib: (size=%d)\n" ,attrib->Size()); 53 _printf_(flag," commnt: (size=%d)\n" ,commnt->Size()); 48 54 49 55 return; … … 77 83 _printf_(flag,"%s attrib: [empty]\n" ,indent); 78 84 85 /* loop over the comments for the object */ 86 87 if (commnt->Size()) 88 for (i=0; i<commnt->Size(); i++) { 89 ((KML_Comment *)commnt->GetObjectByOffset(i))->DeepEcho(indent); 90 } 91 else 92 _printf_(flag,"%s commnt: [empty]\n" ,indent); 93 79 94 return; 80 95 } … … 85 100 86 101 // attributes always written in keyword line of derived classes 102 // comments always written after keyword line of derived classes 87 103 88 104 ; … … 158 174 *pvalue=(char *) xmalloc((strlen(deflt)+1)*sizeof(char)); 159 175 memcpy(*pvalue,deflt,(strlen(deflt)+1)*sizeof(char)); 160 161 176 } 162 177 … … 182 197 /*}}}*/ 183 198 199 /*FUNCTION KML_Object::AddCommnt {{{1*/ 200 void KML_Object::AddCommnt(int ncom,char** pcom){ 201 202 int i; 203 KML_Comment* kcom=NULL; 204 205 for (i=0; i<ncom; i++) { 206 kcom=new KML_Comment(); 207 kcom->Alloc(pcom[i]); 208 kcom->Add(commnt); 209 } 210 211 return; 212 } 213 /*}}}*/ 214 215 /*FUNCTION KML_Object::AddCommnt {{{1*/ 216 void KML_Object::AddCommnt(char* value){ 217 218 KML_Comment* kcom=NULL; 219 220 kcom=new KML_Comment(); 221 kcom->Alloc(value); 222 kcom->Add(commnt); 223 224 return; 225 } 226 /*}}}*/ 227 228 /*FUNCTION KML_Object::FindCommnt {{{1*/ 229 void KML_Object::FindCommnt(char** pvalue,int inum){ 230 231 KML_Comment* kcom=NULL; 232 233 /* loop over any comments for the object */ 234 235 if (inum <= commnt->Size()) 236 kcom=(KML_Comment *)commnt->GetObjectByOffset(inum-1); 237 238 /* if found, get the value; otherwise use the NULL */ 239 240 if (kcom) 241 kcom->Get(pvalue); 242 243 return; 244 } 245 /*}}}*/ 246 247 /*FUNCTION KML_Object::WriteCommnt {{{1*/ 248 void KML_Object::WriteCommnt(FILE* filout,char* indent){ 249 250 int i; 251 252 // comments always written after keyword line of kml_object 253 254 /* loop over any comments for the object */ 255 256 if (commnt->Size()) 257 for (i=0; i<commnt->Size(); i++) 258 ((KML_Comment *)commnt->GetObjectByOffset(i))->Write(filout,indent); 259 260 return; 261 } 262 /*}}}*/ 263 -
issm/trunk/src/c/objects/KML/KML_Object.h
r9883 r10840 20 20 21 21 DataSet* attrib; 22 DataSet* commnt; 22 23 23 24 /*KML_Object constructors, destructors {{{1*/ … … 45 46 virtual void FindAttrib(char** pvalue,char* name,char* deflt); 46 47 virtual void WriteAttrib(FILE* fid,char* indent); 48 virtual void AddCommnt(int ncom,char** pcom); 49 virtual void AddCommnt(char* value); 50 virtual void FindCommnt(char** pvalue,int inum); 51 virtual void WriteCommnt(FILE* fid,char* indent); 47 52 48 53 }; -
issm/trunk/src/c/objects/KML/KML_Placemark.cpp
r10629 r10840 103 103 WriteAttrib(filout," "); 104 104 fprintf(filout,">\n"); 105 WriteCommnt(filout,indent); 105 106 106 107 KML_Feature::Write(filout,indent); … … 125 126 126 127 char* kstri; 128 int ncom=0; 129 char** pcom=NULL; 127 130 KML_Object* kobj; 128 131 … … 135 138 /* loop over and process fields within opening and closing tags */ 136 139 137 while (kstri=KMLFileToken(fid)) { 140 while (kstri=KMLFileToken(fid, 141 &ncom,&pcom)) { 138 142 if (!strncmp(kstri,"</Placemark",11)) { 139 143 xfree((void**)&kstri); … … 180 184 xfree((void**)&kstri); 181 185 } 186 187 this->AddCommnt(ncom,pcom); 188 189 for (ncom; ncom>0; ncom--) 190 xfree((void**)&(pcom[ncom-1])); 191 xfree((void**)&pcom); 182 192 183 193 return; -
issm/trunk/src/c/objects/KML/KML_Point.cpp
r10629 r10840 92 92 WriteAttrib(filout," "); 93 93 fprintf(filout,">\n"); 94 WriteCommnt(filout,indent); 94 95 95 96 KML_Geometry::Write(filout,indent); … … 111 112 double* pcoords=&coords[0]; 112 113 char* kstri; 114 int ncom=0; 115 char** pcom=NULL; 113 116 114 117 /* get object attributes and check for solo tag */ … … 120 123 /* loop over and process fields within opening and closing tags */ 121 124 122 while (kstri=KMLFileToken(fid)) { 125 while (kstri=KMLFileToken(fid, 126 &ncom,&pcom)) { 123 127 if (!strncmp(kstri,"</Point", 7)) { 124 128 xfree((void**)&kstri); … … 149 153 } 150 154 155 this->AddCommnt(ncom,pcom); 156 157 for (ncom; ncom>0; ncom--) 158 xfree((void**)&(pcom[ncom-1])); 159 xfree((void**)&pcom); 160 151 161 return; 152 162 } -
issm/trunk/src/c/objects/KML/KML_PolyStyle.cpp
r10629 r10840 86 86 WriteAttrib(filout," "); 87 87 fprintf(filout,">\n"); 88 WriteCommnt(filout,indent); 88 89 89 90 KML_ColorStyle::Write(filout,indent); … … 102 103 103 104 char* kstri; 105 int ncom=0; 106 char** pcom=NULL; 104 107 105 108 /* get object attributes and check for solo tag */ … … 111 114 /* loop over and process fields within opening and closing tags */ 112 115 113 while (kstri=KMLFileToken(fid)) { 116 while (kstri=KMLFileToken(fid, 117 &ncom,&pcom)) { 114 118 if (!strncmp(kstri,"</PolyStyle",11)) { 115 119 xfree((void**)&kstri); … … 136 140 } 137 141 142 this->AddCommnt(ncom,pcom); 143 144 for (ncom; ncom>0; ncom--) 145 xfree((void**)&(pcom[ncom-1])); 146 xfree((void**)&pcom); 147 138 148 return; 139 149 } -
issm/trunk/src/c/objects/KML/KML_Polygon.cpp
r10629 r10840 128 128 WriteAttrib(filout," "); 129 129 fprintf(filout,">\n"); 130 WriteCommnt(filout,indent); 130 131 131 132 KML_Geometry::Write(filout,indent); … … 165 166 char* kstri; 166 167 char* kstrj; 168 int ncom=0; 169 char** pcom=NULL; 167 170 KML_Object* kobj; 168 171 … … 175 178 /* loop over and process fields within opening and closing tags */ 176 179 177 while (kstri=KMLFileToken(fid)) { 180 while (kstri=KMLFileToken(fid, 181 &ncom,&pcom)) { 178 182 if (!strncmp(kstri,"</Polygon", 9)) { 179 183 xfree((void**)&kstri); … … 202 206 /* loop over and process fields within outer boundary */ 203 207 204 while (kstrj=KMLFileToken(fid)) { 208 while (kstrj=KMLFileToken(fid, 209 &ncom,&pcom)) { 205 210 if (!strncmp(kstrj,"</outerBoundaryIs",17)) { 206 211 xfree((void**)&kstrj); … … 228 233 /* loop over and process fields within inner boundaries */ 229 234 230 while (kstrj=KMLFileToken(fid)) { 235 while (kstrj=KMLFileToken(fid, 236 &ncom,&pcom)) { 231 237 if (!strncmp(kstrj,"</innerBoundaryIs",17)) { 232 238 xfree((void**)&kstrj); … … 257 263 } 258 264 265 this->AddCommnt(ncom,pcom); 266 267 for (ncom; ncom>0; ncom--) 268 xfree((void**)&(pcom[ncom-1])); 269 xfree((void**)&pcom); 270 259 271 return; 260 272 } -
issm/trunk/src/c/objects/KML/KML_Style.cpp
r10629 r10840 149 149 WriteAttrib(filout," "); 150 150 fprintf(filout,">\n"); 151 WriteCommnt(filout,indent); 151 152 152 153 KML_StyleSelector::Write(filout,indent); … … 179 180 180 181 char* kstri; 182 int ncom=0; 183 char** pcom=NULL; 181 184 182 185 /* get object attributes and check for solo tag */ … … 188 191 /* loop over and process fields within opening and closing tags */ 189 192 190 while (kstri=KMLFileToken(fid)) { 193 while (kstri=KMLFileToken(fid, 194 &ncom,&pcom)) { 191 195 if (!strncmp(kstri,"</Style", 7)) { 192 196 xfree((void**)&kstri); … … 234 238 } 235 239 236 return; 237 } 238 /*}}}*/ 239 240 this->AddCommnt(ncom,pcom); 241 242 for (ncom; ncom>0; ncom--) 243 xfree((void**)&(pcom[ncom-1])); 244 xfree((void**)&pcom); 245 246 return; 247 } 248 /*}}}*/ 249
Note:
See TracChangeset
for help on using the changeset viewer.