[Solved] Returning type of case from a selection

Writing a book, Automating Document Production - Discuss your special needs here

[Solved] Returning type of case from a selection

Postby iandb » Tue Aug 18, 2015 3:47 am

As newbie, my first task is to investigate moving some document assembly macros from word 2010 to OpenOffice Writer.
I need to interrogate a selection to determine the case applied to the selection. Is it Proper, Upper, Lower, sentence etc.

Any help much appreciated.

Ian B
Last edited by iandb on Wed Aug 19, 2015 3:40 am, edited 1 time in total.
Open office 4.1.1 on Windows 8.1
Posts: 1
Joined: Tue Aug 18, 2015 3:25 am

Re: Returning type of case from a selection

Postby FJCC » Tue Aug 18, 2015 5:33 am

This may not be what you are looking for. A portion of text has the property CharCaseMap which can be set to various values as shown [url=http://www.openoffice.org/api/docs/common/ref/com/sun/star/style/CaseMap.html[/url]. This is not the same thing as the characters simply being all upper case or lower case. If I type a portion of a text in all upper case, its CharCaseMap is still NONE. If I set CharCaseMap to be UPPER with code, then that portion of text will be all upper case AND it can be found with code.
In the attached document there is one paragraph. I set CharCaseMap of LOOKED ALL AROUND to be UPPER using the MRI tool. I changed the case of HE TRIED TO NERVOUSLY TAP to upper using the menu Format -> Change Case. The macro in the file shows that the two portions do not have the same value of CharCaseMap.
(18.11 KiB) Downloaded 52 times
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Posts: 7130
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Return to Advanced Uses

Who is online

Users browsing this forum: No registered users and 4 guests