Inserting RTF on Template, bug?

Hi, I'm using LO 4.4.3.2 on Linux and found something that looks like a bug when inserting the attached rtf file while using the test_template.ott template (also attached).

If I open LO Writer, then go to Insert -> Document... -> "cabecera.rtf" I get the result you can see in "correct.png" file.

But, if after opening LO Writer, I open the template "test_template.ott" (btw an empty template), then go to Insert -> Document -> "cabecera.rtf", the tabs on the 1nst line of the rtf are removed, getting the image shown in "wrong.png".

Does anyone know if there's a way to workaround this?. Is this a bug?.

Regards,

Sorry, looks like the attached files were stripped.

Here you can download them: http://45.55.143.127/lo/

I'm using LO 4.4.3.2 on Linux and found something that looks like a bug when inserting the attached rtf file while using the test_template.ott template (also attached). If I open LO Writer, then go to Insert -> Document... -> "cabecera.rtf" I get the result you can see in "correct.png" file.

But, if after opening LO Writer, I open the template "test_template.ott" (btw an empty template), ...

I don't think you can ever describe a template as "empty": if it had no contents or function, you would not be using it.

... then go to Insert -> Document -> "cabecera.rtf", the tabs on the 1st line of the rtf are removed, getting the image shown in "wrong.png".

Your template contains a definition of paragraph style "P1" including
<style:tab-stops />
and later the reference to it:
<text:p text:style-name="P1" /> .

I'm guessing that this is why the first paragraph of your inserted file loses its tab stop and inherits the default arrangement of tab stops.

Does anyone know if there's a way to workaround this?

o Reinsert the missing tab stop? (You can easily copy the tab stop from a subsequent paragraph - possibly using the Format Paintbrush.)

o Construct a new (emptier?) template without the presumably unwanted paragraph style definition.

Is this a bug?

Don't know.

I trust this helps.

Brian Barker

I'm using LO 4.4.3.2 on Linux and found something that looks like a
bug when inserting the attached rtf file while using the
test_template.ott template (also attached). If I open LO Writer, then
go to Insert -> Document... -> "cabecera.rtf" I get the result you can
see in "correct.png" file.

But, if after opening LO Writer, I open the template
"test_template.ott" (btw an empty template), ...

I don't think you can ever describe a template as "empty": if it had no
contents or function, you would not be using it.

You are right, this "empty" template was just an example as clean as possible for you to test. The real template should contain a custom header and/or footer.

... then go to Insert -> Document -> "cabecera.rtf", the tabs on the
1st line of the rtf are removed, getting the image shown in "wrong.png".

Your template contains a definition of paragraph style "P1" including
<style:tab-stops />
and later the reference to it:
<text:p text:style-name="P1" /> .

I'm guessing that this is why the first paragraph of your inserted file
loses its tab stop and inherits the default arrangement of tab stops.

Thanks!. I can't see that style in Styles and Formatting, where is it?.

Does anyone know if there's a way to workaround this?

o Reinsert the missing tab stop? (You can easily copy the tab stop from
a subsequent paragraph - possibly using the Format Paintbrush.)

I can't do that, the purpose of this it to be used in a Libreoffice headless workflow.

o Construct a new (emptier?) template without the presumably unwanted
paragraph style definition.

This is what I'll do when I figure out where's the offending style.

Your template contains a definition of paragraph style "P1" including
<style:tab-stops />
and later the reference to it:
<text:p text:style-name="P1" /> .

I'm guessing that this is why the first paragraph of your inserted file loses its tab stop and inherits the default arrangement of tab stops.

Thanks!. I can't see that style in Styles and Formatting, where is it?.

Neither can I - but it appears in the content.xml file in the template.

o Construct a new (emptier?) template without the presumably unwanted paragraph style definition.

This is what I'll do when I figure out where's the offending style.

If I create a template with header and footer, I don't get any "P1" and the later reference is
<text:p text:style-name="Standard" /> .
Then the document imports correctly.

I can't guess how you are creating "P1". Are you inheriting the template from somewhere?

Brian Barker

No, just open LibreOffice Writer, then Save As -> Select ODF Text Document Template (*.ott), assign a name and click Save.

Uncompressed the ott file and no P1 style found.

Then, I added a footer, saved as template, checked again and no P1 style found.

Then added a PNG image to the footer, checked again and also no P1 style found.

So, the ott file was fixed.

But, I was still facing the removed tab issue, and found an error in my Python UNO script (I'm batch processing those documents using UNO scripting). Fixed my error and everything is rendering as expected.

Thank you very much Brian.