Search found 6 matches

by antalk
Fri Apr 30, 2021 5:11 pm
Forum: Macros and UNO API
Topic: cursor.setPropertyToDefault( "CharPosture") removes color
Replies: 11
Views: 6058

Re: cursor.setPropertyToDefault( "CharPosture") removes colo

Is setting CharStyleName to "Default" in a paragraph with a style prescribing
some properties, for example "Preformatted Text" equivalent to "not changing properties"?

Yes, it seems so. I did not realize that.

Thank you.
by antalk
Fri Apr 30, 2021 3:01 pm
Forum: Macros and UNO API
Topic: cursor.setPropertyToDefault( "CharPosture") removes color
Replies: 11
Views: 6058

Re: cursor.setPropertyToDefault( "CharPosture") removes colo

This is how I started. Well, almost. I casted tmp to the type documented for the given poperties. I do not do that in the example below. A ran into (reproduction in python): # The code below assumes that "CharStyleName" was not # set before. tmp = cursor.getPropertyValue( "CharStyleNa...
by antalk
Fri Apr 30, 2021 1:02 pm
Forum: Macros and UNO API
Topic: cursor.setPropertyToDefault( "CharPosture") removes color
Replies: 11
Views: 6058

Re: cursor.setPropertyToDefault( "CharPosture") removes colo

> you'll have to not use setPropertyToDefault. Tricky. I am trying to interpret text with html-like markup into a text range within a document. The idea was that closing tags, like "</b>" should restore the state to that before "<b>", as reported by getPropertyValue. This latter ...
by antalk
Fri Apr 30, 2021 12:04 am
Forum: Macros and UNO API
Topic: cursor.setPropertyToDefault( "CharPosture") removes color
Replies: 11
Views: 6058

Re: cursor.setPropertyToDefault( "CharPosture") removes colo

Your (FJCC) example suggested the strange behaviour may be related to chaging properties on empty cursors. The attached workaround attempts to avoid this by adding extra characters to "hold" the new properties and keeping them around for the following inserts. Seems to work. Maybe the case...
by antalk
Thu Apr 29, 2021 5:46 pm
Forum: Macros and UNO API
Topic: cursor.setPropertyToDefault( "CharPosture") removes color
Replies: 11
Views: 6058

Re: cursor.setPropertyToDefault( "CharPosture") removes colo

> And what is the "Default" colour property?

I do not know. The code does not ask for default color, it asks for default CharPosture,
which I expected to to have the effect of removing direct formatting. Without affecting color in any way.
by antalk
Thu Apr 29, 2021 4:31 pm
Forum: Macros and UNO API
Topic: cursor.setPropertyToDefault( "CharPosture") removes color
Replies: 11
Views: 6058

cursor.setPropertyToDefault( "CharPosture") removes color

In the snippet below, cursor.setPropertyToDefault( "CharPosture") seems to also remove font color. I observed similar interaction between other character properties as well when using cursor.setPropertyToDefault Runnable python3 example in the attachment. Originally observed from java code...