Bug 38885 - Remove CreateTextFromNode methods
Summary: Remove CreateTextFromNode methods
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2011-07-01 07:30 UTC by Björn Michaelsen
Modified: 2019-03-13 16:49 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michaelsen 2011-07-01 07:30:01 UTC
Remove CreateTextFromNode methods

Background: SmNode have a virtual method called CreateTextFromNode, this method is overwritten in some subclasses. However, the method is somewhat buggy/incomplete, similar functionality have been implemented in the SmNodeToTextVisitor, which should be more complete. So we should remove the CreateTextFromNode methods, and reuse any useful parts, if any, in SmNodeToTextVisitor. Calls to CreateTextFromNode should be replaced with calls to SmNodeToTextVisitor, and this should be tested.

Skills: Building, C++
Comment 1 Florian Reisinger 2012-05-18 09:02:00 UTC
Deteted "Easyhack" from summary
Comment 2 Ivan Timofeev (retired) 2012-07-21 18:57:19 UTC
CreateTextFromNode is used only in mathmlimport AFAICS.

But mathmlimport produces a structurally-wrong tree, which *can* be converted to text via CreateTextFromNode, but SmNodeToTextVisitor works only with "right" trees and fails to produce something sensible from that tree from mathmlimport.

It would be better if mathmlimport could convert mathml->starmath I guess, now it does mathml->fake tree->[CreateTextFromNode]->starmath.
Comment 3 Ricardo Montania 2013-09-06 12:32:25 UTC
I have interest on it.

On a first look, I saw that SmNodeToTextVisitor is a class constructor, and need an pNode and a OUString rText as argument to be constructed. But SmNode::CreateTextFromNode need only an OUString, and the pNode is created inside the method. Is that a problem?

And, in SmNode::CreateTextFromNode there is a verification for the number of subNodes, and in SmNodeToTextVisitor we have this virification only in Visitor method in according with the node. Then, to replace CreateTextFromNode should I call SmNodeToTextVisitor constructor and then call the Visitor method according to the case?

Thanks.
Comment 4 Julien Nabet 2013-09-29 15:13:29 UTC
Ivan: is there still the pb of structurally-wrong tree for mathml import?

Frédéric: thinking you might be interested in this, I put you in cc.
Comment 5 Ivan Timofeev (retired) 2013-09-30 11:10:39 UTC
(In reply to comment #4)
> Ivan: is there still the pb of structurally-wrong tree for mathml import?

Most probably yes, but I forgot everything on this topic...
Comment 6 Björn Michaelsen 2013-10-04 18:46:04 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 7 Regina Henschel 2015-07-08 10:44:20 UTC
I think, that it should be a long time goal to switch from StarMath to MathML. But as long as there exists no direct editing of MathML, it is too early to remove generating StarMath source.
Comment 8 Robinson Tryon (qubit) 2015-12-14 05:03:39 UTC Comment hidden (obsolete)
Comment 9 Robinson Tryon (qubit) 2016-02-18 14:51:21 UTC Comment hidden (obsolete)
Comment 10 jani 2016-05-05 13:39:43 UTC
Missing code pointer, mandatory for easy hacks
Comment 11 jani 2016-07-06 06:12:02 UTC
oox/source/mathml/import.cxx  (mathhtml import)

starmath/source/node.cxx
starmath/inc/node.hxx
Comment 12 Julien Nabet 2017-01-29 14:19:41 UTC
If there's an assignee, let's put this tracker as ASSIGNED
Comment 13 jani 2017-05-14 07:42:50 UTC Comment hidden (obsolete)
Comment 14 Fakabbir amin 2017-05-14 11:42:48 UTC
(In reply to jani from comment #13)
> A polite ping, still working on this bug

Hmm, Will try to submit a patch soon.
Comment 15 prakritisharma80@gmail.com 2019-03-13 16:48:48 UTC
Hi,
I would like to take this up as my first issue.