* The last month was computed by setting a possibly invalid date (ie. the
February only has 28 to 29 days, so setting the current day may fail). * This caused bug #7421. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41155 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2007-2009, Haiku, Inc. All Rights Reserved.
|
* Copyright 2007-2011, Haiku, Inc. All Rights Reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
@@ -16,9 +16,8 @@
|
|||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
float
|
static float
|
||||||
FontHeight(const BView *view)
|
FontHeight(const BView *view)
|
||||||
{
|
{
|
||||||
if (!view)
|
if (!view)
|
||||||
@@ -31,7 +30,8 @@ FontHeight(const BView *view)
|
|||||||
return ceilf(fheight.ascent + fheight.descent + fheight.leading);
|
return ceilf(fheight.ascent + fheight.descent + fheight.leading);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // private namespace
|
|
||||||
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
BCalendarView::BCalendarView(BRect frame, const char *name,
|
BCalendarView::BCalendarView(BRect frame, const char *name,
|
||||||
@@ -880,9 +880,9 @@ BCalendarView::_SetupDayNumbers()
|
|||||||
|
|
||||||
// calc the last day one month before
|
// calc the last day one month before
|
||||||
if (date.Month() == 1)
|
if (date.Month() == 1)
|
||||||
date.SetDate(date.Year() -1, 12, fDay);
|
date.SetDate(date.Year() -1, 12, 1);
|
||||||
else
|
else
|
||||||
date.SetDate(date.Year(), date.Month() - 1, fDay);
|
date.SetDate(date.Year(), date.Month() - 1, 1);
|
||||||
const int32 lastDayBefore = date.DaysInMonth();
|
const int32 lastDayBefore = date.DaysInMonth();
|
||||||
|
|
||||||
int32 counter = 0;
|
int32 counter = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user