List Info

Thread: Make LEFT() and RIGHT() closer to spec.




Make LEFT() and RIGHT() closer to spec.
user name
2006-12-18 10:25:41
The patch below makes the length attribute optional for
LEFT() and RIGHT().

I'm not really sure about it - never done this kind of patch
for kspread 
formula before.

Does it look OK?

Can I just commit it to subversion, or is there some kind of
review process?

Is there any coordination of kspread functions (e.g. someone
is working on a 
particular set, or a list of some kind)?

Brad

Index: text.xml
============================================================
=======
--- text.xml    (revision 614543)
+++ text.xml    (working copy)
 -341,8
+341,8 
        <Comment>Source string</Comment>
        <Type>String</Type>
       </Parameter>
-      <Parameter>
-       <Comment>Amount of characters</Comment>
+      <Parameter optional="true">
+       <Comment>Number of characters</Comment>
        <Type>Int</Type>
       </Parameter>
       <Help>
 -363,8
+363,8 
        <Comment>Source string</Comment>
        <Type>String</Type>
       </Parameter>
-      <Parameter>
-       <Comment>Amount of characters</Comment>
+      <Parameter optional="true">
+       <Comment>Number of characters</Comment>
        <Type>Int</Type>
       </Parameter>
       <Help>
Index: text.cpp
============================================================
=======
--- text.cpp    (revision 614543)
+++ text.cpp    (working copy)
 -122,7
+122,7 
   f->setParamCount (1, 3);
   repo->add (f);
   f = new Function ("LEFT", func_left);
-  f->setParamCount (2);
+  f->setParamCount (1, 2);
   repo->add (f);
   f = new Function ("MID", func_mid);
   f->setParamCount (2, 3);
 -140,7
+140,7 
   f->setParamCount (2);
   repo->add (f);
   f = new Function ("RIGHT", func_right);
-  f->setParamCount (2);
+  f->setParamCount (1, 2);
   repo->add (f);
   f = new Function ("SEARCH", func_search);
   f->setParamCount (2, 3);
_______________________________________________
koffice-devel mailing list
koffice-develkde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
Make LEFT() and RIGHT() closer to spec.
user name
2006-12-18 11:55:59
2006/12/18, Brad Hards <bradhfrogmouth.net>:
> The patch below makes the length attribute optional for
LEFT() and RIGHT().

Ah, good catch. The function implementation itself does
check for the
presence of the second argument, looks like an oversight on
my part
when I was setting the param counts.

As for the other questions, Stefan has covered them all, I
think.

/ Tomas
_______________________________________________
koffice-devel mailing list
koffice-develkde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
Make LEFT() and RIGHT() closer to spec.
user name
2006-12-18 11:39:11
On Monday, December 18, 2006 11:25:41 AM Brad Hards wrote:
> The patch below makes the length attribute optional for
LEFT() and RIGHT().
[...]
> Does it look OK?

Yes, looks good, except the not existing, hence superfluous,
"optional" 
attribute in the description. I started a new XML schema
once (located in 
koffice/kspread/functions) to cover those and to provide us
a way to validate 
the descriptions, but it's neither discussed nor finished
yet.

> Can I just commit it to subversion, or is there some
kind of review
> process?

Actually, there's no review process besides the inherent one
of OSS and my 
weak left eye. 

> Is there any coordination of kspread functions (e.g.
someone is working on
> a particular set, or a list of some kind)?

There's a list of missing functions in the TODO file (in
koffice/kspread/). 
But I'm not sure about its up-to-dateness. And there's the
OpenFormula spec. 
The goal is to support at least its Medium group of
functions for the 
upcoming KOffice 2.0.

Remove the "optional" arg in the description and
commit, please.

Regards,
Stefan
_______________________________________________
koffice-devel mailing list
koffice-develkde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
Make LEFT() and RIGHT() closer to spec.
user name
2006-12-18 19:39:25
On Monday 18 December 2006 22:39, Stefan Nikolaus wrote:
> Yes, looks good, except the not existing, hence
superfluous, "optional"
> attribute in the description. I started a new XML
schema once (located in
> koffice/kspread/functions) to cover those and to
provide us a way to
> validate the descriptions, but it's neither discussed
nor finished yet.
There are a few other functions that use it (I assumed it
was "going to be 
implemented"). Should I remove those too?

Brad
_______________________________________________
koffice-devel mailing list
koffice-develkde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
Make LEFT() and RIGHT() closer to spec.
user name
2006-12-18 21:38:44
On Monday, December 18, 2006 11:25:41 AM Brad Hards wrote:
> Is there any coordination of kspread functions (e.g.
someone is working on
> a particular set, or a list of some kind)?

Sascha Pfau told me he wants to do the YEARFRAC function
next.

Regards,
Stefan
_______________________________________________
koffice-devel mailing list
koffice-develkde.org
h
ttps://mail.kde.org/mailman/listinfo/koffice-devel
[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )