[Solved] Cycle through Writer document, changing all page styles

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
paul1149
Posts: 29
Joined: Mon Jun 27, 2016 12:56 am

Re: Cycle through Writer document, changing all page styles

Post by paul1149 »

Zizi64 wrote: Thu Dec 28, 2023 12:59 pm
Please create a copy of your document, delete most of pages and upload a few page sample file here.
I removed the now unused page styles, and that helped with responsiveness. But still there was much accidental formatting, like words with errant font sizes, etc. When I removed all formatting and made everything one paragraph style the problem was immediately solved. Updating the table of contents is now almost instantaneous, saving takes a few seconds and only takes the cpu to 2% for a couple of seconds. I am certain that the formatting anomalies was the cause of the problem. Removing all formatting does create a job reintalicizing titles, recreating lists and indents, etc, but it is worth it.

Thanks.
LibreOffice 7.6.4.1
User avatar
RoryOF
Moderator
Posts: 34619
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Cycle through Writer document, changing all page styles

Post by RoryOF »

This is why it is often best to insert plain text; one can copy formatted text, but insert it as plain text by /Edit /Paste Special, and select "Unformatted text" from the popup.

If one is handling a book of mostly text, one can then format all the inserted text to Text body (I think merely called Text in LibreOffice). It is often possible to search for "Chapter", Find All, then select a Heading style (Ctrl 1, 2 or 3). Now the entire is nearly correctly formatted!
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
paul1149
Posts: 29
Joined: Mon Jun 27, 2016 12:56 am

Re: Cycle through Writer document, changing all page styles

Post by paul1149 »

I admit - I took the bait, the temptation to have all the chapters, headings, indents, lists, footnotes, italics, etc, preserved. That often works for me, but examining the original pdf file in this case I see that a lot of formatting accidentals were already baked into it, dooming this particular file to be a bear of poor responsiveness. Come next time, I will probably do the same thing again, but I will keep in mind that there is a break point where wiping the formatting is the more expedient way to go, and I think I'll be open to pulling the cord on it sooner than I did this time.
LibreOffice 7.6.4.1
paul1149
Posts: 29
Joined: Mon Jun 27, 2016 12:56 am

Re: [Solved] Cycle through Writer document, changing all page styles

Post by paul1149 »

One last note. Original file size was 626kb. After cleaning up the formatting, it is down to 435kb.
LibreOffice 7.6.4.1
Post Reply