This is a follow-up of bug 132293 comment 4: When considering the method: 398 def charactersActionForValues(nsNode, refNode): 399 ret = [] 400 401 refName = refNode.getAttribute("name") 402 for defineNode in [i for i in getChildrenByName(getChildByName(nsNode, "grammar"), "define") if defineNode.getAttribute("name") == refName]: 403 ret.append(" {") 404 ret.append(" // %s" % defineNode.getAttribute("name")) 405 for dataNode in getChildrenByName(defineNode, "data"): 406 if dataNode.getAttribute("type") == "int": 407 ret.append(" OOXMLValue::Pointer_t pValue(new OOXMLIntegerValue(sText));") 408 ret.append(" pValueHandler->setValue(pValue);") 409 ret.append(" }") 410 411 return ret (see https://opengrok.libreoffice.org/xref/core/writerfilter/source/ooxml/factoryimpl_ns.py?r=c4fa6efa#398) since line 402 is wrong, it's quite possible we never enter the loop so the expected code to generate may never be generated. It might be a source of bugs. I insist to tell "it might" since I must recognize I don't really know if it's the case or not. Remark: I'm not sure too that generating C++ code from Python, Perl whatever is a good thing since it's less easy to debug/maintain. IMHO, this part should be converted in C++ but that's another story.
Introduced by: author Miklos Vajna <vmiklos@collabora.co.uk> 2014-07-27 17:46:42 +0200 committer Miklos Vajna <vmiklos@collabora.co.uk> 2014-07-27 17:46:42 +0200 commit 821ab16a1fb0353397914131ab559685d12b92b7 (patch) tree dd2ad806bc996322e515366f5bd2e8b0a46546d7 parent 21977778168af134e7f72afcc07ff5062324a19d (diff) writerfilter: convert factoryimpl_ns to Python Adding Cc: to Miklos Vajna
I'll take a look.
I think this patch should make it: diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py b/writerfilter/source/ooxml/factoryimpl_ns.py index 35fdadfd3a9d..db06cf1c9218 100644 --- a/writerfilter/source/ooxml/factoryimpl_ns.py +++ b/writerfilter/source/ooxml/factoryimpl_ns.py @@ -399,7 +399,7 @@ def charactersActionForValues(nsNode, refNode): ret = [] refName = refNode.getAttribute("name") - for defineNode in [i for i in getChildrenByName(getChildByName(nsNode, "grammar"), "define") if defineNode.getAttribute("name") == refName]: + for defineNode in [i for i in getChildrenByName(getChildByName(nsNode, "grammar"), "define") if i.getAttribute("name") == refName]: ret.append(" {") ret.append(" // %s" % defineNode.getAttribute("name")) for dataNode in getChildrenByName(defineNode, "data"): but I let you check.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/62ba3248f654febe55fdf422163fff76552e9c32 tdf#132320 writerfilter: fix typo in factoryimpl_ns.py It will be available in 7.0.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Julien Nabet from comment #3) > I think this patch should make it: Oh sorry, I didn't notice this before pushing my patch. The upside is that you suggested the same. :-) Thanks.
(In reply to Miklos Vajna from comment #5) > (In reply to Julien Nabet from comment #3) > > I think this patch should make it: > > Oh sorry, I didn't notice this before pushing my patch. The upside is that > you suggested the same. :-) Thanks. No pb, the most important is the bug is now fixed! :-)