https://bugs.documentfoundation.org/show_bug.cgi?id=96479

--- Comment #9 from Jan-Marek Glogowski <[email protected]> ---
Hmm - seems the overall conclusion is still wrong. I don't know how my
co-worker came to the conclusion, that removing the
"cursor.getText().insertString(cursor, ".", true)" call fixes the problem. But
probably he also just loaded the document without looking at the actual
bookmark in XML. Remember: we want to replace "bookmark" with "bookmark1" and
change the content to an input field. Here we go:

The original document to be modified by the macro contains:
      <text:p text:style-name="P1">
        <text:text-input text:description=""/>
        <text:bookmark text:name="bookmark"/>
      </text:p>

I guess the bug also happens with a document without the first input field. It
contains the empty "bookmark" and no content after the first input field in the
paragraph.

Our test office versions are OOo 3.2.1, LO 4.1.6 and LO 4.2+ (current master) .
We run the unchanged macro of the document and a modified version of the macro
without the following line and check the resulting documents:
      cursor.getText().insertString(cursor, ".", true)

Generated document from macro with "." in OOo 3.2.1
      <text:p text:style-name="Standard">
        <text:text-input text:description=""/>
        <text:bookmark-start text:name="bookmark1"/>
        <text:text-input text:description=""/>
        <text:bookmark-end text:name="bookmark1"/>
      </text:p>

Generated document from macro with_out_ "." in OOo 3.2.1
      <text:p text:style-name="Standard">
        <text:text-input text:description=""/>
        <text:bookmark-start text:name="bookmark1"/>
        <text:text-input text:description=""/>
        <text:bookmark-end text:name="bookmark1"/>
      </text:p>

POV: both are identical and correct.

Generated document from macro with "." in LO 4.1.6
      <text:p text:style-name="P1">
        <text:text-input text:description=""/>
        <text:bookmark-start text:name="bookmark1"/>
        <text:text-input text:description=""/>
        <text:bookmark-end text:name="bookmark1"/>
      </text:p>

Generated document from macro with_out_ "." in LO 4.1.6
      <text:p text:style-name="P1">
        <text:text-input text:description=""/>
        <text:bookmark text:name="bookmark1"/>
        <text:text-input text:description=""/>
      </text:p>

POV: now things start to break (quite probably much earlier then LO 4.1; I
didn't check, but we tested LO 3.6 for some time. The commit message just
states LO, no version). The empty bookmark isn't "expanded" when inserting /
replacing the content. The input field is actually appended after the bookmark.
Thanks to the "." workaround, we "force-expand" the bookmark before the insert
and still get the expected result.

Generated document from macro with "." in LO 4.2+
      <text:p text:style-name="P1">
        <text:text-input text:description=""/>
        <text:bookmark-start text:name="bookmark1"/>
        <text:text-input text:description=""/>
      </text:p>

Generated document from macro with_out_ "." in LO 4.2+
      <text:p text:style-name="P1">
        <text:text-input text:description=""/>
        <text:bookmark text:name="bookmark1"/>
        <text:text-input text:description=""/>
      </text:p>

POV: now it's really broken. Without the "." the macro actually generates an
invalid document (XML is correct, but there is no <text:bookmark-end
text:name="bookmark1"/> in the document). I'm not sure we can find a workaround
for this in WollMux.

Since we always work with an empty bookmark, the original replacement problem
from i#101283 probably still hits us. At least the patch from
https://bz.apache.org/ooo/show_bug.cgi?id=101283 still applies and is included
in our 4.1 build. But that's another bug I need to verify.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to