Merge of document results in new page | Java API and insertTransferable

Hello Community o/

I have an .odt document that contains the string [Tag] which I replace with HTML code that contains some bullet points.
I use java and the LibreOffice API/framework. insertTransferable from XTransferableSupplier.

It works, but the replacement text gets pushed to the second page.
It seems that the style:style for the first bulletpoint get those parameters applied: style:master-page-name="HTML"

If I open up the output .odt and remove the style by hand everything seems to work.

  • Is that by design or is it a bug?
  • How can I stop this behavior?

I have a sample code here: GitHub - lord-carlos/libreOfficeMerger

The important merge code is in the class: HTMLTagReplacer.java

src/main/resources/ contains a before and after .odt file.

Since you experience this problem in Writer (not in Calc or others), be kind enough to retag to replace common with writer so that your question reaches the right involved contributors. Press twice Enter to exit retag mode.

Thanks and done.
Could this be a bug? Worth asking on the dev mailing list?

Or does anyone know a way how I could further debug this?

Just talked to people on #libreoffice-dev IRC. It’s by design.

mikekaganski> this is
repro using UI. Just create an HTML
document in LO, and another Text
document; type something in both;
select all in HTML doc, copy then
paste into Text doc. The pasted text
will start with “HTML” page style.

mikekaganski> I suppose
it’s how “HTML documents” are created
in LO (in OOo since 3.x). They define
the first paragraph to start with that
page style. And then when you copy and
paste, that gets pasted.

mikekaganski> and it’s
by design that defining a page style
starts a new page with that style