Re: [GSoC] On ODF Formulas in Writer

2014-03-18 Thread Kohei Yoshida
So, although this will not be a GSOC task, I'd like to answer some of
the questions for archival purposes.

On Tue, 2014-03-11 at 12:53 +0100, Michael Stahl wrote:

 that is the part of the idea proposal that i'm not sure about currently:
 
 just using this ixion library for Writer formulas would put us in a
 similar situation like what we currently are with text edition
 components, where Writer has its own core and everything else uses
 EditEngine instead; this duplication creates additional maintenance burden.
 
 of course there are a lot of formulas (ODF part 2 is hundreds of pages),
 and to me it appears quite sub-optimal to have multiple implementations
 of all that.
 
 there is already a formula module which Eike claims is not just used
 by Calc but also by some Report(Builder/Designer/whatever) application,
 which means it would probably be possible to use this from Writer too.
 
 the problem is that apparently formula only contains the code to parse
 and tokenize formulas; the actual evaluation is still in Calc's core and
 tied to Calc's internals.
 
 so i would welcome some input on what the architecture should look like
 here:
 
 1) is it possible to somehow abstract the formula evaluation
implementations from Calc internals (suppose it's mostly about
addressing/accessing the cells?) such that it could be used from
Writer too?

Possible?  Yes, in the sense that anything is possible given enough
time.  But IMO probably not realistic and perhaps its risk outweighs its
potential benefit.  Calc's current formula interpreter code is so tied
to Calc's own internal model not just from functionality point of view
but also performance optimization point of view.  Ripping that out and
abstracting it for other apps to use would probably be not worth the
disruption it would bring.  Even the current sc/formula split just to
make the parser part of the formula engine available for other parts of
the code base has made the handling of formula engine a bit more awkward
inside Calc, to say the least.

 2) would it be a good long-term plan to migrate Calc to ixion too so we
eventually end up with just one formula evaluation engine?

This was the initial thinking behind the inception of ixion.  But 4
years has passed, and the likelihood of ixion replacing Calc's formula
engine has diminished.  The possibility is still there, but let's say
that won't be happening in the next 5 years.

 3) or is it unrealistic to ever share the formula evaluation part?

I'd say yes.  It's unrealistic.

So, if I were to implement this feature, I would still consider using
ixion despite the downside of duplication you've already cited.  The
reality is that we do have to duplicate functionality sometimes for many
reasons even though we all know that it's something to be frowned upon.
At least with ixion you'll get formula parser, interpreter, A1 style
cell address handler and lightweight dependency tracking for free
right now.  And although I don't think ixion is ready for heavy-lifting
formula calculation uses, it should work well enough for light-weight
uses such as Writer table's formula handling.

Anyway, since we won't be working on this feature anytime soon, we can
shelve this discussion for now, I suppose.

Kohei

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


Re: [GSoC] On ODF Formulas in Writer

2014-03-16 Thread Matteo Campanelli
Okay, thank you guys for all the help.
In the meantime I got my patch accepted! :)

Given the news (ODF formulas in Writer not being a valid GSoC talks
anymore), I'm going to apply for another project but in case my submission
to GSoC were not successful I might consider working on a sub-part of this
issue anyway this summer 'cause it had intrigued me at the beginning.

Best,
Matteo


On Tue, Mar 11, 2014 at 10:23 PM, Kohei Yoshida kohei.yosh...@collabora.com
 wrote:

 On Tue, 2014-03-11 at 12:53 +0100, Michael Stahl wrote:
   However, for now, I would suggest focusing getting your easy hack
  ready
accepted; that's required even in case at the end you're
  interested in
   some other LibreOffice idea.
 
  absolutely - here are usually more GSoC applicants than available
  mentors, and the most important thing to get accepted is to show that
  you can get useful work done.  if we find that this one won't work
  out,
  it's always possible to choose a different GSoC project.

 And it appears that this idea has been moved out of the Ideas page,
 which means it's no longer a valid GSOC task.

 To be honest, I don't even know why this task was left on that page in
 the first place.  I believe it was one of those left-over tasks that we
 forgot to clean up.

 Kohei


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


Re: [GSoC] On ODF Formulas in Writer

2014-03-11 Thread Miklos Vajna
Hi Matteo,

On Sun, Mar 09, 2014 at 01:21:37AM -0500, Matteo Campanelli 
matteo.campane...@gmail.com wrote:
 I am planning to apply to GSoC '14 and a few weeks ago I started hacking
 LibreOffice (I've been working on this Easy
 Hackhttps://bugs.freedesktop.org/show_bug.cgi?id=53472
 ).

Great! :-) Please don't forget to push your patch for review once you're
happy with it.

 I'm writing to start a discussion and ask some questions on the idea
 project in the subject of this email
 ([1https://wiki.documentfoundation.org/Development/GSoC/Ideas#ODF_Formulas_in_Writer
 ]).
 
 Also - most important question (!!) - would there be anyone interested in
 mentoring this project?

AFAIK the project idea is from Cédric, but he's not mentoring Writer
projects this year. This doesn't mean you can't propose to work on this
project, but it's not the best Writer project you could pick up. ;-)

 My understanding of the issue:
 - Currently Writer uses its own, non-standard syntax for formulas. At the
 moment this syntax is both what is used/typed by the user and the one used
 for internal computations. (At a first glance, the class
 SwCalchttp://opengrok.libreoffice.org/search?q=project=coredefs=SwCalcrefs=path=hist=seems
 to be responsible for both parsing and interpreting these formulas,
 is that right?)

Yes, that sounds correct.

 - The goal of the project would be to enable users to write formulas in the
 ODF Format 
 [2]http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html
 and use this same format for the internal computations.

Correct, what's currently written is like this:

table:table-cell table:style-name=Table1.B1 
table:formula=ooow:lt;A1gt;+lt;A2gt; office:value-type=float 
office:value=3

The ooow part clearly indicates that it's something LO inherited from
OOo.

 - As far as I have understood, we may use the ixion library
 [3]https://gitorious.org/ixion to
 interpret ODF-style formulas. This library is already used by Writer for
 interpreting formulas in doc/docx files (which, I suppose, are first
 converted to the actual ODF format). [is this point of my interpretation
 correct? Could anyone provide code pointers for the computation of formula
 for .doc files?]

The ixion library is currently not part of LibreOffice in any way.
Regarding, .doc files, this is not handled in the filter (AFACS), just
the result of the formula is written to the file as a plain string.

 - Part of the project will have to deal with import/export filters and
 backward compatibility: first, files with formulas in the old-syntax should
 still be parsed correctly; second, users should have the option of saving
 in the old syntax or in the default new ODF syntax.

We have a general mechanism for that, in ODF 1.2 extended, probably you
could just write the new syntax, and you only need to make sure that the
old syntax can be read.

 Also, I have two additional questions:
 - the project idea page mentions changes in the code for the formula input
 bar. What should these changes to the UI consist of specifically? Are they
 mostly related to the strings produced by using the Formula dropdown menu
 in the bar?
 - Can anyone who is into the code roughly assess the relative hardness of
 the three subparts of this project (i.e. refactoring to use ODF and
 delegation to ixion, changes in the UI, adapting import/export filters)? In
 other words, which of these parts (if any) is likely to take longer
 compared to the others?

Probably the largest part is to make Writer core use the ODF formulas
(with the help of ixion), after that the ODF import/export is just
filter work, much easier. Regarding UI, it's about to change it, so that
it generates the ODF-syntax formulas, that's probably something you can
do incrementally once core support is there.

Additionally here, is a starter patch:

http://cgit.freedesktop.org/libreoffice/build/tree/patches/dev300/fields-table-formula.diff?h=master-backup

If you're interested in this project, you probably want to start with
porting that to current master. :-)

However, for now, I would suggest focusing getting your easy hack ready
 accepted; that's required even in case at the end you're interested in
some other LibreOffice idea.

Best,

Miklos


signature.asc
Description: Digital signature
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [GSoC] On ODF Formulas in Writer

2014-03-11 Thread Michael Stahl
On 11/03/14 12:29, Miklos Vajna wrote:
 Hi Matteo,
 
 On Sun, Mar 09, 2014 at 01:21:37AM -0500, Matteo Campanelli 
 matteo.campane...@gmail.com wrote:

 I'm writing to start a discussion and ask some questions on the idea
 project in the subject of this email
 ([1https://wiki.documentfoundation.org/Development/GSoC/Ideas#ODF_Formulas_in_Writer
 ]).

 Also - most important question (!!) - would there be anyone interested in
 mentoring this project?
 
 AFAIK the project idea is from Cédric, but he's not mentoring Writer
 projects this year. This doesn't mean you can't propose to work on this
 project, but it's not the best Writer project you could pick up. ;-)

right, and i dont' know much anything about formulas either.

 - The goal of the project would be to enable users to write formulas in the
 ODF Format 
 [2]http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html
 and use this same format for the internal computations.
 
 Correct, what's currently written is like this:
 
 table:table-cell table:style-name=Table1.B1 
 table:formula=ooow:lt;A1gt;+lt;A2gt; office:value-type=float 
 office:value=3
 
 The ooow part clearly indicates that it's something LO inherited from
 OOo.

it also indicates it's not standard ODF.

 - As far as I have understood, we may use the ixion library
 [3]https://gitorious.org/ixion to
 interpret ODF-style formulas. This library is already used by Writer for
 interpreting formulas in doc/docx files (which, I suppose, are first
 converted to the actual ODF format). [is this point of my interpretation
 correct? Could anyone provide code pointers for the computation of formula
 for .doc files?]
 
 The ixion library is currently not part of LibreOffice in any way.
 Regarding, .doc files, this is not handled in the filter (AFACS), just
 the result of the formula is written to the file as a plain string.

that is the part of the idea proposal that i'm not sure about currently:

just using this ixion library for Writer formulas would put us in a
similar situation like what we currently are with text edition
components, where Writer has its own core and everything else uses
EditEngine instead; this duplication creates additional maintenance burden.

of course there are a lot of formulas (ODF part 2 is hundreds of pages),
and to me it appears quite sub-optimal to have multiple implementations
of all that.

there is already a formula module which Eike claims is not just used
by Calc but also by some Report(Builder/Designer/whatever) application,
which means it would probably be possible to use this from Writer too.

the problem is that apparently formula only contains the code to parse
and tokenize formulas; the actual evaluation is still in Calc's core and
tied to Calc's internals.

so i would welcome some input on what the architecture should look like
here:

1) is it possible to somehow abstract the formula evaluation
   implementations from Calc internals (suppose it's mostly about
   addressing/accessing the cells?) such that it could be used from
   Writer too?

2) would it be a good long-term plan to migrate Calc to ixion too so we
   eventually end up with just one formula evaluation engine?

3) or is it unrealistic to ever share the formula evaluation part?

 - Part of the project will have to deal with import/export filters and
 backward compatibility: first, files with formulas in the old-syntax should
 still be parsed correctly; second, users should have the option of saving
 in the old syntax or in the default new ODF syntax.
 
 We have a general mechanism for that, in ODF 1.2 extended, probably you
 could just write the new syntax, and you only need to make sure that the
 old syntax can be read.

yep, that is just a simple matter of programming.

 Also, I have two additional questions:
 - the project idea page mentions changes in the code for the formula input
 bar. What should these changes to the UI consist of specifically? Are they
 mostly related to the strings produced by using the Formula dropdown menu
 in the bar?

i think we shouldn't even start thinking about any UI changes until the
core work is mostly done, since the amount of time required there is
very difficult to predict.

 However, for now, I would suggest focusing getting your easy hack ready
  accepted; that's required even in case at the end you're interested in
 some other LibreOffice idea.

absolutely - here are usually more GSoC applicants than available
mentors, and the most important thing to get accepted is to show that
you can get useful work done.  if we find that this one won't work out,
it's always possible to choose a different GSoC project.

regards,
 michael

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


Re: [GSoC] On ODF Formulas in Writer

2014-03-11 Thread Kohei Yoshida
On Tue, 2014-03-11 at 12:53 +0100, Michael Stahl wrote:
  However, for now, I would suggest focusing getting your easy hack
 ready
   accepted; that's required even in case at the end you're
 interested in
  some other LibreOffice idea.
 
 absolutely - here are usually more GSoC applicants than available
 mentors, and the most important thing to get accepted is to show that
 you can get useful work done.  if we find that this one won't work
 out,
 it's always possible to choose a different GSoC project.

And it appears that this idea has been moved out of the Ideas page,
which means it's no longer a valid GSOC task.

To be honest, I don't even know why this task was left on that page in
the first place.  I believe it was one of those left-over tasks that we
forgot to clean up.

Kohei

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