Spell checking underlining

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Spell checking underlining

Manuel Odesser
Hi fellow developers,

I wondered what property should be used to mimic the spell checking
underline. I mean, how to underline a piece of text using another color
? And how not to print this underlining ?
I found com
<http://api.openoffice.org/docs/common/ref/com/module-ix.html>.sun.
<http://api.openoffice.org/docs/common/ref/com/sun/module-ix.html>star
<http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html>.style.
<http://api.openoffice.org/docs/common/ref/com/sun/star/style/module-ix.html>CharUnderline(com
<http://api.openoffice.org/docs/common/ref/com/module-ix.html>.sun.
<http://api.openoffice.org/docs/common/ref/com/sun/module-ix.html>star.
<http://api.openoffice.org/docs/common/ref/com/sun/star/module-ix.html>awt.
<http://api.openoffice.org/docs/common/ref/com/sun/star/awt/module-ix.html>FontUnderline.*)
to underline some characters, but the decoration color is the same as
the characters.

Thank you,
Manuel

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Spell checking underlining

Frank Meies
Hi Manuel,

On 04/27/06 11:06, Manuel Odesser wrote:

> I wondered what property should be used to mimic the spell checking
> underline. I mean, how to underline a piece of text using another color

xsel = thiscomponent.currentcontroller.getselection
xrange = xsel(0)
xrange.CharUnderline = com.sun.star.awt.FontUnderline.SMALLWAVE
xrange.CharUnderlineHasColor = true
xrange.CharUnderlineColor = RGB( 255, 0, 0 )

results in a red waveline under the currently selected characters.

> ? And how not to print this underlining ?

Well, I think you explicitly have to reset the underline attribute
before printing, at least I don't know any other way.

Hope this helps,

Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Spell checking underlining

Manuel Odesser
> Hi Manuel,
>
> On 04/27/06 11:06, Manuel Odesser wrote:
>
>> I wondered what property should be used to mimic the spell checking
>> underline. I mean, how to underline a piece of text using another color
>
> xsel = thiscomponent.currentcontroller.getselection
> xrange = xsel(0)
> xrange.CharUnderline = com.sun.star.awt.FontUnderline.SMALLWAVE
> xrange.CharUnderlineHasColor = true
> xrange.CharUnderlineColor = RGB( 255, 0, 0 )
>
> results in a red waveline under the currently selected characters.
>
>> ? And how not to print this underlining ?
>
> Well, I think you explicitly have to reset the underline attribute
> before printing, at least I don't know any other way.

Thank you very much for your answer.

I can now underline various pieces of text. I digged into the c++ code
around the spellchecker and its methods for underlining misspelt text.
 From what I saw, it is not using this framework to decorate text : it
detects whether the view a standard swriter window (not print preview, not
something else) and then applies the red wave. Therefore these waves are
never added into characters properties and does not have to be erased
before printing.

Can someone confirm this behaviour ? It this planned to be exposed in UNO
one day ? This could be very useful for any plugin implementing a new
corrector into OOo : typography (http://en.wikipedia.org/wiki/Typography),
grammar, barbarism (http://en.wikipedia.org/wiki/Barbarism_%28grammar%29),
etc.


>
> Hope this helps,

It did !

> Frank

--
Manuel

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Spell checking underlining

Mathias Bauer
Manuel Odesser wrote:

> I can now underline various pieces of text. I digged into the c++ code
> around the spellchecker and its methods for underlining misspelt text.
>  From what I saw, it is not using this framework to decorate text : it
> detects whether the view a standard swriter window (not print preview, not
> something else) and then applies the red wave. Therefore these waves are
> never added into characters properties and does not have to be erased
> before printing.
>
> Can someone confirm this behaviour ? It this planned to be exposed in UNO
> one day ? This could be very useful for any plugin implementing a new
> corrector into OOo : typography (http://en.wikipedia.org/wiki/Typography),
> grammar, barbarism (http://en.wikipedia.org/wiki/Barbarism_%28grammar%29),
> etc.

Your observation is correct and yes, "one day" this will change and we
will have an API for this. Currently it's just unclear when we will make
this change.

Best regards,
Mathias

--
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [hidden email] is a spam sink.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]