Quite a hack, but I'd suggest unzip
ping the .odt file and working with raw XML. The content.xml seems to be the correct file to edit.
I have prepared a test file with content:
QQQQQ
-page break-
AAAAA
And here is the relevant part of the raw XML:
<!---*lots* of declarations--->
<office:automatic-styles>
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
<style:paragraph-properties fo:break-before="page"/>
</style:style>
</office:automatic-styles>
<office:body>
<office:text text:use-soft-page-breaks="true">
<text:sequence-decls>
<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>
<text:p text:style-name="Standard">QQQQQ</text:p>
<text:p text:style-name="P1">AAAAA</text:p>
</office:text>
</office:body>
<!---some happy-end--->
(The real file will proably be more complex.) It seems to me that "P1" is a style created to "bear" the property of page-breaking before the paragraph. So two things come into my mind:
- remove "P1" from
<text:p />
tags
- remove the page-breaking property from "P1" style
By the way, here I'd also recommend avoiding regexes in favor of some real XML parser.
While I think removing the P1 style from a paragraph would work, it would be pretty cumbersome to use on an ongoing basis. I am looking more for something like ^m in word, which can be used in search and replace. – xpda – 2012-03-26T03:50:41.263
It looks like there's not a good answer to this question, but this seems like the best answer. I would like to change to LibreOffice, but the lack of this one feature is preventing it. – xpda – 2012-03-26T03:54:04.240