[Solved] AltSearch search and replace list

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
kocj
Posts: 19
Joined: Mon Aug 20, 2018 8:19 am

[Solved] AltSearch search and replace list

Post by kocj »

I am trying to rewrite bullet and numbering list with AltSearch. Using the pick properties button I am able to identify the NumberingLevel. It is also possible to rewrite a whole list to an specific Numbering level or to apply a default or custom list setting to a given list. However I am not able to search and select a specific NumberingLevel.

My goal for a bullet list would be to rewrite it to an ordinary paragraph whit the following markers in front of it.
NumberingLevel=0 to *
NumberingLevel=1 to **
NumberingLevel=2 to ***

For a numbered list the same whit the right numbers should apply.

Any help or directions would be appreciated.

kocj
Last edited by kocj on Thu Aug 30, 2018 6:07 pm, edited 1 time in total.
Libreoffice 5.3 and 6.1 on Debian Stretch 9.5
User avatar
Zizi64
Volunteer
Posts: 11345
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: AltSearch search and replace list

Post by Zizi64 »

Please upload your ODF type sample file here.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
kocj
Posts: 19
Joined: Mon Aug 20, 2018 8:19 am

Re: AltSearch search and replace list

Post by kocj »

@ Zizi64 Thank you

The only thing I am able to do with AltSearch is like that.

[Find][:::NumberingStyleName=::]
[Replace]*\0\A{NumberingStyleName=}

Witch marks every list, and adds one * in front of it. The bad thing is that hierarchies are getting lost in translation.

Kocj
Attachments
Sample file.odt
(11.15 KiB) Downloaded 773 times
Libreoffice 5.3 and 6.1 on Debian Stretch 9.5
User avatar
Zizi64
Volunteer
Posts: 11345
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: AltSearch search and replace list

Post by Zizi64 »

Your sample document contains only one applied paragraph style: the default one. Therefore you can not change a specific paragraph style to an another one by the usage og the F&R function. And you can not modify the applied styles, because all of the applied paragraph styles are same - with some manually adjusted properties.

Use different styles for the different levels.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
kocj
Posts: 19
Joined: Mon Aug 20, 2018 8:19 am

Re: AltSearch search and replace list

Post by kocj »

Ok, that seems to work. Using a different par-style for every level allow me to search and rewrite it as i want.

Still, I probably do not get the whole picture at the moment.
Lets assume that I have created a list style, lets call it Bullet-List that has three levels. Then I created a paragraph styles for each level.

Bullet-List-1
Bullet-List-2
Bullet-List-3

Then in Outline and Numbering link par-style Bullet-List-1 to list-style Bullet-List and assign Outline level 1. For par-style Bullet-List-2 and 3 consecutively Outline level 2 and 3.

If I move an item a from level one to level two the paragraph style is not changing. That brings a lot of work should i once decide to move something around.

I have been trough this tutorial https://wiki.documentfoundation.org/ima ... df#page=34 that did not give me the needed insight either.

Some how it does not seem to be supposed to be like that. And a bit overkill if just a view lists are needed.

Kocj
Libreoffice 5.3 and 6.1 on Debian Stretch 9.5
kocj
Posts: 19
Joined: Mon Aug 20, 2018 8:19 am

Re: AltSearch search and replace list

Post by kocj »

Found the solution i needed. I had to setup conditional paragraph styles. Now depending on the outline level a different paragraph stile is applied and i am able to mark that style with AltSearch.

https://ask.libreoffice.org/en/question ... n-outline/

Thank you for your help.

Kocj
Libreoffice 5.3 and 6.1 on Debian Stretch 9.5
Post Reply