

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
7 messages in org.openoffice.fr.progRe: [prog] Changement de comportement...| From | Sent On | Attachments |
|---|---|---|
| fabs...@wanadoo.fr | May 21, 2009 12:51 am | |
| Francois Gatto | May 21, 2009 11:06 am | |
| fabs...@wanadoo.fr | May 23, 2009 7:14 am | |
| Didier Dorange-Pattoret | May 24, 2009 12:29 am | |
| Francois Gatto | May 24, 2009 8:31 am | |
| fabs...@wanadoo.fr | May 25, 2009 4:59 am | |
| Laurent Godard | May 25, 2009 5:32 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [prog] Changement de comportement dans OOo3.1 | Actions... |
|---|---|---|
| From: | Francois Gatto (oo...@volcar.org) | |
| Date: | May 21, 2009 11:06:29 am | |
| List: | org.openoffice.fr.prog | |
Bonsoir,
Je pense qu'en codant directement au moyen des API le problème pourrait être solutionné.
Je n'ai pas vérifié faute de disposer d'une v3.0.1 sous la main.
Voici un bout de code à tester :
sub CurrentWordUnderline dim oDoc as object dim oText as object dim oSelection as object dim oCursor as object oDoc=ThisComponent oText = oDoc.Text Cursor = oDoc.currentcontroller.getViewCursor() oSelection = oText.createTextCursorByRange(Cursor.getStart()) oSelection.gotoStartOfWord(false) oSelection.gotoEndOfWord(true) oSelection.CharUnderline = com.sun.star.awt.FontUnderline.SINGLE end sub
Avec ma 3.1.0 (officielle) sous Ubuntu 8.10 cela fonctionne et ne présente pas le problème de on/off (bascule).
fabs...@wanadoo.fr a écrit :
Bonjour,
Je viens de constater un changement de comportement dans OOo3.1, par rapport aux versions précédentes, dans l'enregistreur de macro lors du soulignement.
Jusqu'à présent, pour souligner un texte, j'utilisais la procédure ci-dessous obtenue avec l'enregistreur de macro:
sub souligner dim document as object dim dispatcher as object document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim args1(2) as new com.sun.star.beans.PropertyValue args1(0).Name = "Underline.Underline" args1(0).Value = 1 dispatcher.executeDispatch(document, ".uno:Underline", "", 0, args1()) end sub
Maintenant, cette procédure fait passer alternativement du soulignage au non soulignage. Même comportement que si je mettais n'importe quelle chaîne de caractères comme nom de l'argument args1(0). Dans OOo3.1, le nom de l'argument du "dispatcher" doit maintenant être "Underline.LineStyle".
Mon enregistreur de macros me fournit le code suivant : sub Main rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ---------------------------------------------------------------------- dim args1(2) as new com.sun.star.beans.PropertyValue args1(0).Name = "Underline.LineStyle" args1(0).Value = 1 args1(1).Name = "Underline.HasColor" args1(1).Value = false args1(2).Name = "Underline.Color" args1(2).Value = -1
dispatcher.executeDispatch(document, ".uno:Underline", "", 0, args1()) end sub
Problème: cet argument n'est pas reconnue dans les versions antérieures de OOo...
D'où ma question: il y a-t-il moyen de faire fonctionner cette procédure dans toutes les versions d'OOo?
Merci,
Cordialement,
Fabien.
Francois Gatto







