From c8b618048e778812ea31c0b9c5a8daa52a45ecf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 31 Mar 2011 21:35:53 +0000 Subject: [PATCH] * 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 --- src/kits/shared/CalendarView.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kits/shared/CalendarView.cpp b/src/kits/shared/CalendarView.cpp index ac5c76aba2..a876ee7511 100644 --- a/src/kits/shared/CalendarView.cpp +++ b/src/kits/shared/CalendarView.cpp @@ -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. * * Authors: @@ -16,9 +16,8 @@ namespace BPrivate { -namespace { -float +static float FontHeight(const BView *view) { if (!view) @@ -31,7 +30,8 @@ FontHeight(const BView *view) return ceilf(fheight.ascent + fheight.descent + fheight.leading); } -} // private namespace + +// #pragma mark - BCalendarView::BCalendarView(BRect frame, const char *name, @@ -880,9 +880,9 @@ BCalendarView::_SetupDayNumbers() // calc the last day one month before if (date.Month() == 1) - date.SetDate(date.Year() -1, 12, fDay); + date.SetDate(date.Year() -1, 12, 1); else - date.SetDate(date.Year(), date.Month() - 1, fDay); + date.SetDate(date.Year(), date.Month() - 1, 1); const int32 lastDayBefore = date.DaysInMonth(); int32 counter = 0;