Print Page | Close Window

[solved] Calendar crashes using the tab button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=23274
Printed Date: 26 April 2024 at 6:13am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] Calendar crashes using the tab button
Posted By: Lifthrasil
Subject: [solved] Calendar crashes using the tab button
Date Posted: 28 February 2017 at 4:47am
I start your sample version 17.3.0.0.
In this version I've the theme (important) Office 2013 -> Outlook activated and I do not fill the calendar with sample data. So it's empty.
If I go to monday and create a new event, give it a name, check the "all day event" checkbox and press ok, this event is created. If I now press the "tab" key on my keyboard it's crashing.

I'v not found your bug report interface , that's why I'm posting it here.



Replies:
Posted By: olebed
Date Posted: 28 February 2017 at 6:45am
Hello Lifthrasil,

Thank you for bringing this to our attention. There is exception "integer division by zero" in Source\Calendar\XTPCalendarDayView.cpp   CXTPCalendarDayView::_EnsureVisibleV()
int nEventIndex = (pViewEvent->m_rcEvent.top - m_LayoutX.m_rcAllDayEvents.top) /m_LayoutX.m_nAllDayEventHeight + m_LayoutX.m_nTopAllDayRow;


I have added this to our bug base. The problem will be addressed according to its priority. You will be notified through this forum topic about any progress on this task.

For reports about bugs you can use form on our site    http://www.codejock.com/support" rel="nofollow - https://www.codejock.com/support
in menu Support > Request Support.

Regards,
 Oleksandr Lebed


Posted By: Lifthrasil
Date Posted: 28 February 2017 at 7:24am
Hi!

The thing is, that we (Copa Data) have bought the calendar (source code) and actually we have this problem also in our program. So if I would know, that this issue is fixed in a certain amount of time, I would not have to invest time to find a temporary fix. Would this be possible? Would it then be possible to send us the code with the fix or a description what to fix, how and where? This would be really nice :D
Thanks in advance for your support!


Posted By: olebed
Date Posted: 28 February 2017 at 7:33am
in file Source\Calendar\XTPCalendarDayView.cpp method   CXTPCalendarDayView::_EnsureVisibleV()
I think you can use "max" to prevent division by zero, but I don't have enough time to check whole algorithm now.
int nEventIndex = (pViewEvent->m_rcEvent.top - m_LayoutX.m_rcAllDayEvents.top) /max(1, m_LayoutX.m_nAllDayEventHeight + m_LayoutX.m_nTopAllDayRow);


Posted By: Lifthrasil
Date Posted: 28 February 2017 at 7:46am
Hi!

No sorry, that's not working because there's an ASSERT popping up and the event is not visible anymore afterwards.
It's not that urgent but if I would know that in the next 3 weeks it would be possible to get a bug fix for our version (we use an older one, 16.4.0.0) it would be very cool because then we would not invest time in it any more ;)
Because until now I am a little bit confused. It seems that these variables are not initialized because when using Office 2013 Outlook the AdjustLayout function of the views isn't called, which would set them. But I am not sure if this is ok or not ;)


Posted By: olebed
Date Posted: 06 March 2017 at 5:20pm
Hello Lifthrasil,

We have solved this bug with fix below
BOOL CXTPCalendarDayView::_EnsureVisibleV(CXTPCalendarViewEvent* pViewEvent)
{
    if (!pViewEvent || !pViewEvent->GetEvent() || !GetCalendarControl() ||
        !XTP_SAFE_GET2(pViewEvent, GetViewGroup_(), GetViewDay_(), NULL) )
    {
        ASSERT(FALSE);
        return FALSE;
    }

    //---------------------------------------------------------------------------
    if (pViewEvent->IsMultidayEvent())
    {
        if (0 != m_LayoutX.m_nAllDayEventHeight)
        {
            int nEventIndex = (pViewEvent->m_rcEvent.top - m_LayoutX.m_rcAllDayEvents.top) / m_LayoutX.m_nAllDayEventHeight + m_LayoutX.m_nTopAllDayRow;

            if (nEventIndex >= m_LayoutX.m_nTopAllDayRow + m_LayoutX.m_nVisibleAllDayCount)
            {
                m_LayoutX.m_nTopAllDayRow = nEventIndex - m_LayoutX.m_nVisibleAllDayCount + 1;
                return TRUE;
            }
            else if (nEventIndex < m_LayoutX.m_nTopAllDayRow)
            {
                m_LayoutX.m_nTopAllDayRow = nEventIndex;
                return TRUE;
            }
        }

        return FALSE;

    }
....


Regards,
 Oleksandr Lebed


Posted By: Lifthrasil
Date Posted: 07 March 2017 at 7:14am
Hi!

Thank you very much for that fix! This works for us and I'm very happy about that!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net