const LongInt& ULongInt::operator ++ () { if (BoundsChecking() && _Uvalue == ULONG_MAX) SetOverflow(); ++_Uvalue; return *this; }
const ShortInt& UShortInt::operator ++ () { if (BoundsChecking() && _Uvalue == USHRT_MAX) SetOverflow(); ++_Uvalue; return *this; }
const LongInt& ULongInt::operator ++ (int) { static ULongInt OldVal_ = _Uvalue; if (BoundsChecking() && _Uvalue == ULONG_MAX) SetOverflow(); ++_Uvalue; return OldVal_; }
const ShortInt& UShortInt::operator ++ (int) { static UShortInt OldVal_ = _Uvalue; if (BoundsChecking() && _Uvalue == USHRT_MAX) SetOverflow(); ++_Uvalue; return OldVal_; }
LongInt& ULongInt::operator *= (const NumOrdinalType<LongInt>& Obj_) { if (BoundsChecking()) { Ulong Buffer_[2]; Buffer_[0] = _Uvalue; Buffer_[1] = Obj_.DerivedClass().UnsignedValue(); UlongSeriesCompare CeilCmp_ = UlongSeriesCompare::ProductOfSeriesCmp(ULONG_MAX, Buffer_, 2, FALSE); UlongSeriesCompare FloorCmp_ = UlongSeriesCompare::ProductOfSeriesCmp(0, Buffer_, 2, FALSE); if (CeilCmp_.Result() < 0) SetOverflow(); if (FloorCmp_.Result() > 0) SetUnderflow(); } _Uvalue *= Obj_.DerivedClass().UnsignedValue(); return *this; }
ShortInt& UShortInt::operator -= (const NumOrdinalType<ShortInt>& Obj_) { if (BoundsChecking()) { Ushort Buffer_[2]; Buffer_[0] = _Uvalue; Buffer_[1] = Obj_.DerivedClass().UnsignedValue(); UshortSeriesCompare CeilCmp_ = UshortSeriesCompare::DifferenceOfSeriesCmp(USHRT_MAX, Buffer_, 2, FALSE); UshortSeriesCompare FloorCmp_ = UshortSeriesCompare::DifferenceOfSeriesCmp(0, Buffer_, 2, FALSE); if (CeilCmp_.Result() < 0) SetOverflow(); if (FloorCmp_.Result() > 0) SetUnderflow(); } _Uvalue -= Obj_.DerivedClass().UnsignedValue(); return *this; }
ShortInt& ShortInt::operator *= (const NumOrdinalType<ShortInt>& Obj_) { if (BoundsChecking()) { short Buffer_[2]; Buffer_[0] = _Value; Buffer_[1] = short(Obj_.DerivedClass()); shortSeriesCompare CeilCmp_ = shortSeriesCompare::ProductOfSeriesCmp(SHRT_MAX, Buffer_, 2, FALSE); shortSeriesCompare FloorCmp_ = shortSeriesCompare::ProductOfSeriesCmp(SHRT_MIN, Buffer_, 2, FALSE); if (CeilCmp_.Result() < 0) SetOverflow(); if (FloorCmp_.Result() > 0) SetUnderflow(); } _Value *= Obj_.DerivedClass().GetData(); return *this; }
bool wxSheetCellAttr::MergeWith(const wxSheetCellAttr &other) { wxCHECK_MSG(Ok() && other.Ok(), false, wxT("this or Attr to MergeWith from is not created")); if ( !HasForegoundColour() && other.HasForegoundColour() ) SetForegroundColour(other.GetForegroundColour()); if ( !HasBackgroundColour() && other.HasBackgroundColour() ) SetBackgroundColour(other.GetBackgroundColour()); if ( !HasFont() && other.HasFont() ) SetFont(other.GetFont()); if ( !HasAlignment() && other.HasAlignment() ) SetAlignment(other.GetAlignment()); if ( !HasOrientation() && other.HasOrientation() ) SetOrientation(other.GetOrientation()); if ( !HasLevel() && other.HasLevel() ) SetLevel(other.GetLevel()); if ( !HasReadWriteMode() && other.HasReadWriteMode() ) SetReadOnly(other.GetReadOnly()); if ( !HasOverflowMode() && other.HasOverflowMode() ) SetOverflow(other.GetOverflow()); if ( !HasOverflowMarkerMode() && other.HasOverflowMarkerMode() ) SetOverflowMarker(other.GetOverflowMarker()); if ( !HasShowEditorMode() && other.HasShowEditorMode() ) SetShowEditor(other.GetShowEditor()); // Directly access m_renderer/m_editor as GetRender/Editor may return different one // Maybe add support for merge of Render and Editor? if ( !HasRenderer() && other.HasRenderer() ) SetRenderer(((wxSheetCellAttrRefData*)other.m_refData)->m_renderer->Clone()); if ( !HasEditor() && other.HasEditor() ) SetEditor(((wxSheetCellAttrRefData*)other.m_refData)->m_editor->Clone()); if ( !HasDefaultAttr() && other.HasDefaultAttr() ) SetDefaultAttr(other.GetDefaultAttr()); return true; }