mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-30 07:35:59 +00:00
DBViewNumber shouldn't crash anymore.
This commit is contained in:
parent
3c26e7a981
commit
796cccab19
3 changed files with 21 additions and 3 deletions
|
@ -55,9 +55,7 @@ namespace NLGUI
|
|||
static void forceLink();
|
||||
|
||||
protected:
|
||||
|
||||
sint64 getVal() { if (_Modulo == 0) return (_Number.getSInt64() / _Divisor);
|
||||
else return (_Number.getSInt64() / _Divisor)%_Modulo; }
|
||||
sint64 getVal();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -47,6 +47,15 @@ namespace NLGUI
|
|||
_VolatileValue = NULL;
|
||||
}
|
||||
|
||||
/// Tells if this property has a value
|
||||
bool hasValue() const
|
||||
{
|
||||
if( _VolatileValue != NULL )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
NLMISC::CCDBNodeLeaf* getNodePtr() const
|
||||
{
|
||||
return _VolatileValue;
|
||||
|
|
|
@ -249,5 +249,16 @@ namespace NLGUI
|
|||
{
|
||||
}
|
||||
|
||||
sint64 CDBViewNumber::getVal()
|
||||
{
|
||||
if( !_Number.hasValue() )
|
||||
return 0;
|
||||
|
||||
if( _Modulo == 0 )
|
||||
return _Number.getSInt64() / _Divisor;
|
||||
else
|
||||
return ( _Number.getSInt64() / _Divisor ) % _Modulo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue