[Libreoffice] I need some advice to fix fdo#40363

Jean-Baptiste Faure jbf.faure at orange.fr
Mon Nov 28 04:43:51 PST 2011


Hi all,

The bug described in fdo#40363 may occur if you make a typo when type
some dates in Calc. For example 1011-11-28 instead of 2011-11-28. In
such a case, chart2 loops infinitely in master and LibO 3.4.
The loop occurs in GetDateSomeYearsAway method in DateHelper.cxx :
http://opengrok.libreoffice.org/xref/core/chart2/source/view/axes/DateHelper.cxx#81

The problem is that the chart wizard want compute tick marks. If a date
is far before 1582-10-15 then GetDateSomeYearsAway() is called for
another year before 1582-10-15. This methods goes in the past by steps
of one day until it finds a valid date. The problem is that the validity
of the date is defined by IsValid() in tdate.cxx :
http://opengrok.libreoffice.org/xref/core/tools/source/datetime/tdate.cxx#321
For this method every dates before 1582-10-15 are not valid...

If I modify Date::IsValid so that only dates strictly between 1582-10-05
and 1582-10-15 are not valid, then the chart wizard works without problem.

I do not understand why every dates before 1582-10-15 should not be
valid when only dates from 1582-10-05 to 1582-10-14 do not exist due to
the switch from julian calendar to gregorian calendar.

What is very annoying for me is that the chart wizard works well with
the same data in LibO 3.3 (precisely LibO 3.3.2 from Ubuntu PPA for
Ubuntu 10.04 x86_64) and I was not able to find any modification of the
file tdate.cxx (git log -p tdate.cxx) that I can relate to this problem.
In other words, AFAIK, actual code of Date::IsValid was already there in
LibO 3.3.

Now, my question is what to do? Is it a good idea to modify
Date::IsValid in tdate.cxx without knowing why it works in LibO 3.3 ?

Best regards.
JBF
-- 
Seuls des formats ouverts peuvent assurer la pérennité de vos documents.


More information about the LibreOffice mailing list