RE: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-08-13 Thread Winfried Donkers
 Hi Eike,

 All your comments have been processed in the code (I learned some new
 things too, thank you !).
 It now works fine for all possible argument values, including leaving out the
 optional value for WEEKNUM and illegal arguments.
 
 Now I will start on seeing how old-style documents are interpreted and how I
 can handle that as 'smooth' as possible (unnoticeable for user, I mean).
 
 (It may be after my holidays before you hear from again)

I have searched a bit and found some functions in 
sc/source/core/tool/compiler.cxx that might be extended to convert old-style 
ISOWEEKNUM() use when reading old (pre ODFF1.2) documents. Unfortunately alle 
these functions seem te be called too when entering a function in an existing 
(open) sheet or recalculating.
It will be probably most efficient to convert only when reading a saved 
document.
Can you give any hint(s) as where I might put the conversion code for old-style 
ISOWEEKNUM() to ODFF1.2?

Winfried
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


RE: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-07-16 Thread Winfried Donkers
Hi Eike,

Please see my splinter review in
https://bugs.freedesktop.org/show_bug.cgi?id=50950#c6

All your comments have been processed in the code (I learned some new things 
too, thank you !).
It now works fine for all possible argument values, including levibng out the 
optional value for WEEKNUM and illegal arguments.

Now I will start on seeing how old-style documents are interpreted and how I 
can handle that as 'smooth' as possible (unnoticeable for user, I mean).

(It may be after my holidays before you hear from again)

Winfried
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


RE: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-07-12 Thread Winfried Donkers
Hi Noel,

 $ git grep -n WEEKNUM_ADD
 sc/source/core/tool/odffmap.cxx:38:{ WEEKNUM, WEEKNUM_ADD,
 false, com.sun.star

Thank you for your suggestion.
That line has been changed in my patch to ...{ WEEKNUM, WEEKNUM, ...
And that's why I am at a loss

Winfried
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-07-12 Thread Eike Rathke
Hi Winfried,

On Wednesday, 2012-07-11 16:49:13 +0200, Winfried Donkers wrote:

 I uploaded a new diff file to bug 50950.

Please see my splinter review in
https://bugs.freedesktop.org/show_bug.cgi?id=50950#c6

 I haven't started on the proper processing of saved old-style arguments as a 
 strange thing is happening:
 When running the modified code, LibO does not recognise WEEKNUM and does 
 recognise WEEKNUM_ADD, although I cannot find any text 'WEEKNUM_ADD' in the 
 code!

That's added automatically in AnalysisAddIn::getDisplayFunctionName()
and you need to change the corresponding function data. See my review
annotation in the bug.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD


pgpmr8QyUMfzS.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


RE: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-07-11 Thread Winfried Donkers
 Well, my hope is that I'm not too dumb to educate you ;-) so you'd be
 able to work more independently on spreadsheet functions.

It's more the question if I am smart enough to pick up the essentials of LibO 
spreadsheet functions quick enough ;-)


Anyway, I improved my patch and did learn from your splinter review of my first 
code.
I uploaded a new diff file to bug 50950.
I haven't started on the proper processing of saved old-style arguments as a 
strange thing is happening:
When running the modified code, LibO does not recognise WEEKNUM and does 
recognise WEEKNUM_ADD, although I cannot find any text 'WEEKNUM_ADD' in the 
code!

It would be much appreciated if someone could tell me what I am missing, as I 
would like to commence on the old-style argument processing.

Winfried

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-07-11 Thread Noel Grandin


On 2012-07-11 16:49, Winfried Donkers wrote:
When running the modified code, LibO does not recognise WEEKNUM and 
does recognise WEEKNUM_ADD, although I cannot find any text 
'WEEKNUM_ADD' in the code!


$ git grep -n WEEKNUM_ADD
sc/source/core/tool/odffmap.cxx:38:{ WEEKNUM, WEEKNUM_ADD, 
false, com.sun.star



Disclaimer: http://www.peralex.com/disclaimer.html


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-06-26 Thread Eike Rathke
Hi Winfried,

On Monday, 2012-06-25 09:53:29 +0200, Winfried Donkers wrote:

 I will do that. (I hope my contributions don't cost you too much time
 in correcting so that they fit well in the general picture...)

Well, my hope is that I'm not too dumb to educate you ;-) so you'd be
able to work more independently on spreadsheet functions.


  It seems one point didn't make it across: I did not suggest to create yet
  another (internal) WEEKNUM function. 
 
 I did start with keeping WEEKNUM_ADD in the Add-in module, but as
 I had diffuculties in using the Date::getWeekofYear function (getting
 the null date right),

hm.. GetNullDate() and the exact/exact algorithm of GetDiffParam() in
analysishelper.cxx didn't help?

 I am a bit busy with other projects at the time, so don't hurry for my sake 
 :-)

No problem, take your time.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD


pgpEd4e5YCAPt.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


RE: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-06-25 Thread Winfried Donkers
Hi Eike,



 Please see my Splinter review in
 https://bugs.freedesktop.org/show_bug.cgi?id=50950#c3

I will do that. (I hope my contributions don't cost you too much time in 
correcting so that they fit well in the general picture...)

 It seems one point didn't make it across: I did not suggest to create yet
 another (internal) WEEKNUM function. 

I did start with keeping WEEKNUM_ADD in the Add-in module, but as I had 
diffuculties in using the Date::getWeekofYear function (getting the null date 
right), I simply thought keeping WEEKNUM and ISOWEEKNUM together would be 
logical - disrepecting pre-ODFF1.2 and interoperability issues.
I will go back to your original plan and upload another diff file to the 
bugs.feedesktop.org (with corrections as taken from your Splinter review).
 
 I'll come back to the compiler details later. The problem there may be
 mapping from internal (ISOWEEKNUM) to Add-In (WEEKNUM).

I am a bit busy with other projects at the time, so don't hurry for my sake :-)

Winfried
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-06-22 Thread Eike Rathke
Hi Winfried,

On Wednesday, 2012-06-20 11:45:08 +0200, Winfried Donkers wrote:

 I just uploaded a diff file and test document to bug50950.

Please see my Splinter review in
https://bugs.freedesktop.org/show_bug.cgi?id=50950#c3

 The ODFF1.2-compliant functions work and I would like some help from you with 
 importing old-style formulas from documents saved with previous LibO versions.
 Your plan from June 7 (see below) seems clear to me, but I don't know where 
 the import formula complier is located and how to best change it.

It seems one point didn't make it across: I did not suggest to create
yet another (internal) WEEKNUM function. My original plan was:

* enhance WEEKNUM_ADD to support all ODF WEEKNUM modes
* in the UI rename WEEKNUM to ISOWEEKNUM
* change ISOWEEKNUM to accept only one parameter
* during import's formula compile step for ISOWEEKNUM check if a second
  argument is provided
  * if so and if it is a constant value !=1 strip the argument (the
Monday case that was and is real ISO 8601)
  * if it is a constant value ==1 map the function to WEEKNUM
* there's a slight chance that a user wanted exactly the behavior
  ISO but Sunday resulting from the current undocumented
  implementation details, which isn't supported by ODF WEEKNUM
  definition, but I think that should be a very rare case, if at
  all, and is neglectable
  * if it is not a constant (i.e. computed) argument do nothing and let
the interpreter complain about the second parameter

So we'd end up with only two functions, in the UI that would be
WEEKNUM_ADD and ISOWEEKNUM. We can then rename WEEKNUM_ADD to WEEKNUM.

I'll come back to the compiler details later. The problem there may be
mapping from internal (ISOWEEKNUM) to Add-In (WEEKNUM).

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD


pgpMrRk3R4NsO.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: fdo 50950 make (ISO)WEEKNUM comply with ODFF1.2, advise asked

2012-06-21 Thread Eike Rathke
Hi Winfried,

On Wednesday, 2012-06-20 11:45:08 +0200, Winfried Donkers wrote:

 I just uploaded a diff file and test document to bug50950.

I'll come back to this tomorrow.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD : 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD


pgpO7MuPJ0Maw.pgp
Description: PGP signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice