Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » [Model2Doc] How to manage line breaks to generate a conforming Word document?
[Model2Doc] How to manage line breaks to generate a conforming Word document? [message #1838417] Wed, 24 February 2021 14:53 Go to next message
Yoann Farré is currently offline Yoann FarréFriend
Messages: 235
Registered: November 2017
Senior Member
Hello everyone,

I'm stuck with a basic issue (more complicated than expected).

I explain it :
I'm trying to generate a Docx document from a Papyrus model containing requirements. The text (Requirement::text field) of these elements contains line breaks. All is fine in the property view and if I generate an ODT file, the line breaks are visible.
But if I generate a word file, I get the text without the line breaks. I suppose that this behavior is the same for any text coming from the model and containing such line breaks. As the text is generated here, I know that the char used for a line break is '\n'.

I tried to use some other special chars to match word requirements :
\r\n : same result \n
\u2028 : line break char giving a special symbol in word but not the line break
\u2029 : paragraph break, same result
<br\> : stay in the final text

with no result.

I'm not sure but I think it could be considered as a bug of the docx generator. As a user, I'm expecting that the line break in a text of the model appears in the output document.

Any advice or comment is welcome.
Thanks for reading.

Yoann.
  • Attachment: TextModel.png
    (Size: 10.98KB, Downloaded 71 times)
  • Attachment: TextWord.png
    (Size: 13.06KB, Downloaded 84 times)
Re: [Model2Doc] How to manage line breaks to generate a conforming Word document? [message #1838455 is a reply to message #1838417] Thu, 25 February 2021 13:13 Go to previous messageGo to next message
Vincent Lorenzo is currently offline Vincent LorenzoFriend
Messages: 249
Registered: June 2010
Location: Paris Saclay, France
Senior Member
Hello Yoann,
please could you send us a snapshot of the editor you used to edit the Requirement ? I assume it is the Richtext editor but I'm not sure.
I tested with String editor for Comment -> I confirm the bug for line break
I tested with the Richtext editor for Comment -> I confirm the bug, we write directly the html code inside the document.
We filled the bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=571508 than you can edit if required.
/Vincent
Re: [Model2Doc] How to manage line breaks to generate a conforming Word document? [message #1838458 is a reply to message #1838455] Thu, 25 February 2021 13:37 Go to previous message
Yoann Farré is currently offline Yoann FarréFriend
Messages: 235
Registered: November 2017
Senior Member
Hello Vincent,
Thanks for your reply.
I join a snapshot of the property view I use to edit the requirement text field. This is the view of SysML 1.4. I suppose that it is what you mean by the richtext editor.

In reality, I don't edit anything in this view by myself. the requirement text is generated by analysis of model elements programmatically. I just read the result in this view. If I watch this text in the Profile nail, the line breaks are not visible.

Thanks for the bug report too.

Yoann.




  • Attachment: FullView.png
    (Size: 28.95KB, Downloaded 69 times)
Previous Topic:Embedding profile
Next Topic: getModel() is undefined for the type ClassEditPart with Papyrus 2020-12
Goto Forum:
  


Current Time: Sat Apr 27 04:55:07 GMT 2024

Powered by FUDForum. Page generated in 0.02920 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top