I have a Writer document containing instances of the string "L.M.H", where each of "L", "M", and "H" might or might not have an overline (always single). There are also a few cases in which "L", "M", and "H" appear as singletons, also with or without overlines.
I need to change each instance of those characters to lowercase, small caps, adding 2 points to the font height, and retaining the overlines.
Both the Find/Replace dialog and (so far as I can tell) the Find/Replace code interfaces do not support searching characters with overlines, and if I try to take care of the other property changes on their own, the overlines are lost.
Is there some other way to detect characters with overlines?
[Solved] Basic: Find and replace characters with overline
-
- Posts: 14
- Joined: Sun Jul 17, 2011 9:09 pm
[Solved] Basic: Find and replace characters with overline
Last edited by pnm_asst_ed on Wed Jun 09, 2021 3:47 am, edited 1 time in total.
AOO413m1(Build:9783) - Rev. 1761381
MacOS 10.12.3 (16D32)
Assistant Editor
Perspectives of New Music
MacOS 10.12.3 (16D32)
Assistant Editor
Perspectives of New Music
Re: Basic: Find and replace characters with overline
It should be easy enough to find all instances of exactly L.M.H and just make the settings via →Format→Text…
Inside the Find&Replace-dialog thereis a Format-button available, either the Cursor is in the Search-field or in the Replace-field, use it.
Inside the Find&Replace-dialog thereis a Format-button available, either the Cursor is in the Search-field or in the Replace-field, use it.
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
Re: Basic: Find and replace characters with overline
Find/replace dialog, more options/ Format button, overlining
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 14
- Joined: Sun Jul 17, 2011 9:09 pm
Re: Basic: Find and replace characters with overline
Unfortunately that doesn't work — at least not in OO 4.1.10. After selecting "single" in the overline option of the Format dialog, no such option is reflected below the "Search for" box, and the actual search finds every instance of whatever is in the Search For box, not just the overlined ones.
AOO413m1(Build:9783) - Rev. 1761381
MacOS 10.12.3 (16D32)
Assistant Editor
Perspectives of New Music
MacOS 10.12.3 (16D32)
Assistant Editor
Perspectives of New Music
Re: Basic: Find and replace characters with overline
You're right. Something like this then... (quickly based on Useful Macro Information For OpenOffice By Andrew Pitonyak example)
Code: Select all
Sub searchForOverlines
Dim vDescriptor, vFound
' Create a descriptor from a searchable document.
vDescriptor = ThisComponent.createSearchDescriptor()
With vDescriptor
.SearchString = searchstring 'SET TO WHATEVER
' These all default to false
.SearchWords = true
.SearchCaseSensitive = False
End With
vFound = ThisComponent.findall(vDescriptor)
for i = 0 to vfound.count -1 'GO THROUGH FIND RESULTS AND SEE WHICH HAVE OVERLINE
if vFound(i).charoverline then
'do whatever
vFound(i).string = ucase(vfound(i).string)
end if
next
End Sub
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 14
- Joined: Sun Jul 17, 2011 9:09 pm
Re: Basic: Find and replace characters with overline
That did it! I needed the "CharOverline" attribute name, which I hadn't found (and still haven't found — even on Pitonyak's site. Can you provide a link?). That was the key missing element.
AOO413m1(Build:9783) - Rev. 1761381
MacOS 10.12.3 (16D32)
Assistant Editor
Perspectives of New Music
MacOS 10.12.3 (16D32)
Assistant Editor
Perspectives of New Music
Re: [Solved] Basic: Find and replace characters with overlin
It should be here but isn't - there are missing bits on other API pages too.
https://www.openoffice.org/api/docs/com ... rties.html
You'd find it easily by using MRI though.
https://www.openoffice.org/api/docs/com ... rties.html
You'd find it easily by using MRI though.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: [Solved] Basic: Find and replace characters with overlin
I suspect it was a new(er) attribute and not introduced in the API
Specs are here : https://www.openoffice.org/specs/appwid ... d_Text.odt
Specs are here : https://www.openoffice.org/specs/appwid ... d_Text.odt
____________
DiGro
AOO 4.1.15 (Dutch) on Windows 11. Scanned with Ziggo Safe Online (F-Secure)
DiGro
AOO 4.1.15 (Dutch) on Windows 11. Scanned with Ziggo Safe Online (F-Secure)