Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#364 closed defect (fixed)

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

Reported by: jessicacao Owned by: 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");

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

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

  1. 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 (3)

comment:1 by trevorwekel, 17 years ago

Resolution: fixed
Status: newclosed

Patch submitted by Jessica Cao

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

comment:2 by ronnielouie, 17 years ago

External ID: 985014985014, 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.

Note: See TracTickets for help on using tickets.