Hi,
my document starts with a paragraph containing only a single space and with a very small font size, after load / save with RichView Word shows the Linebreak Symbol? with the default font and size - but the paragraph (space character) has still the right style.
after load / save
The issue is that word seems the expect that a <w:rPr> element is allways written also if the paragraph is not empty. Currently its only written if the paragraph is empty. So the problem may be in CRVData.pas method TCustomRVData.SaveOOXMLDocumentToStream -> WriteParaProps( .. ) ? And the decision to call WriteRunProps(..) ?
(as PM you will receive my commented version of this piece of code I modified)
André
DocX saved paragraph with single space, shows wrong in word
DocX saved paragraph with single space, shows wrong in word
- Attachments
-
- richview.docx
- (4.14 KiB) Downloaded 2192 times
-
- original.docx
- (23.14 KiB) Downloaded 2103 times
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: DocX saved paragraph with single space, shows wrong in word
I can see the problem.
MS Word has invisible "end-of-paragraph mark" character that may have its own text attributes, such as font name and size.
TRichView does not have this character, so it saves its properties in DocX only if it is absolutely necessary (if the paragraph is empty).
Normally, it is not a big problem, because this character is invisible, and it does not affect line height.
But as I can see from your example, if the paragraph contains only a space character, height of end-of-paragraph mark is taken into account when calculating line height! And, as I can see, it happens if the line contains any number of whitespace characters (spaces and tabs). I did not know that before.
I think TRichView should save properties of the last text item in the paragraph as end-of-paragraph mark properties (at least, for non-bulleted paragraphs, because MS Word applies some end-of-paragraph properties to the list marker too)
MS Word has invisible "end-of-paragraph mark" character that may have its own text attributes, such as font name and size.
TRichView does not have this character, so it saves its properties in DocX only if it is absolutely necessary (if the paragraph is empty).
Normally, it is not a big problem, because this character is invisible, and it does not affect line height.
But as I can see from your example, if the paragraph contains only a space character, height of end-of-paragraph mark is taken into account when calculating line height! And, as I can see, it happens if the line contains any number of whitespace characters (spaces and tabs). I did not know that before.
I think TRichView should save properties of the last text item in the paragraph as end-of-paragraph mark properties (at least, for non-bulleted paragraphs, because MS Word applies some end-of-paragraph properties to the list marker too)
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: DocX saved paragraph with single space, shows wrong in word
Fixed in TRichView 22.2
Re: DocX saved paragraph with single space, shows wrong in word
Ok - tested - works - one point less on the list.