MapGuide Open Source:  Home |  Download |  Internals

Ticket #364 (closed defect: fixed)

Opened 9 months ago

Last modified 7 months ago

MgDataPropertyDefinition::Length ,GetLength() and SetLength() can be assigned to with a negative value;

Reported by: jessicacao Assigned to: Tom Fukushima
Priority: medium Milestone: 2.0
Component: General Version:
Severity: major Keywords: MgDataPropertyDefinition::SetLength
Cc: Trevor Wekel External ID: 985014, 1044251

Description

MgDataPropertyDefinition::Length ,GetLength?() and SetLength?() can be assigned to with a negative value;

1. Construct an instance of MgDataPropertyDefinition? using the following code

MgDataPropertyDefinition? dataPropDefinition = new MgDataPropertyDefinition?("dataPropDefinition");

2. Assigned a negative value to Length and use method GetLength? to return the value

dataPropDefinition.Length = -10; Assert.AreEqual?(-10, dataPropDefinition.GetLength?());

3. Use the method SetLength? to set a negative value, and use Length to return the value

dataPropDefinition.SetLength?(-23);

Assert.AreEqual?(-23, dataPropDefinition.Length);

Sample code:

MgDataPropertyDefinition? dataPropDefinition = new MgDataPropertyDefinition?("dataPropDefinition");

dataPropDefinition.Length = -10;

Assert.AreEqual?(-10, dataPropDefinition.Length);

Assert.AreEqual?(-10, dataPropDefinition.GetLength?());

dataPropDefinition.SetLength?(-23);

Assert.AreEqual?(-23 dataPropDefinition.Length);

Assert.AreEqual?(-23, dataPropDefinition.GetLength?());

Change History

01/09/08 15:46:53 changed by trevorwekel

  • status changed from new to closed.
  • resolution set to fixed.

Patch submitted by Jessica Cao

http://trac.osgeo.org/mapguide/changeset/2698

02/12/08 01:32:20 changed by ronnielouie

  • external_id changed from 985014 to 985014, 1044251.

Scale property can have negative values. When scale is negative, it means that the values must be mulitples of 10-(scale), i.e. when scale = -2, values must be multiples of 100. Refer to FDO external id 1038260.01.