]> Git trees. - libqmvoc.git/commit
Fixing crash condition in ExtDateWidget. If initialized without a date
authorJason Harris <kstars@30doradus.org>
Tue, 1 Jun 2004 01:33:18 +0000 (01:33 +0000)
committerJason Harris <kstars@30doradus.org>
Tue, 1 Jun 2004 01:33:18 +0000 (01:33 +0000)
commit6479b830e5963c91c30e611f8b91744ad733a4b4
tree1f7f75c428f0e50e937effd6a22e926e8cb9e7a3
parentc56eafd72d2b5010c84209dff58d196578c497a9
Fixing crash condition in ExtDateWidget.  If initialized without a date
argument, it was initialized to an invalid date, which caused a crash in the
function ExtDate::daysInMonth().  Two fixes make the widget much more robust:

+ ExtDate::daysInMonth() and ExtDate::leapYear() now check the validity of the
date first, and return sensible default values if the date is invalid.

+ the default ctor ExtDateWidget() now initializes to the current date, rather
than an invalid date.

This fixes the crash in the ScriptBuilder tool.

CCMAIL: kstars-devel@kde.org

svn path=/trunk/kdeedu/libkdeedu/; revision=316636
extdate/extdatetime.cpp
extdate/extdatewidget.cpp
extdate/extdatewidget.h
extdate/testwidget.cpp
extdate/testwidget.h