eth4io / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

bad xunits/yunits parse to -1 #138

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. parse kml with <overlayXY xunits="badstuff"/>
2. call get_xunits()
3. see that get_xunits returns -1

What is the expected output? What do you see instead?

excellent question... one proposal is to treat a bad enum
as not set and set no value at all

instead we see as indicated in step 3 above

What version of the product are you using? On what operating system?

1.2, linux, but this has been the case for a very long time
and is not platform specific

Did you run the unit test suite that comes with the project? Did all tests
pass?

yup

Please provide any additional information below.

one place to fix this is in vec.cc's CutEnumAttr() which should
only set the enum_val if Xsd::GetSchema()->EnumId does not return -1

note also that the set_xunits in the programmatic api does not
check that the passed value is valid w.r.t. the units enum

Original issue reported on code.google.com by b...@google.com on 25 Feb 2010 at 7:14

GoogleCodeExporter commented 8 years ago
Fixed in r795

http://code.google.com/p/libkml/source/detail?r=795

Original comment by kml.b...@gmail.com on 2 Mar 2010 at 1:15