4 messages in org.openoffice.fr.prog[prog] Textshape dans un cadre [writer]
FromSent OnAttachments
Agnès SimonetNov 21, 2004 5:42 am 
Bernard MarcellyNov 21, 2004 9:52 am 
Agnès SimonetNov 21, 2004 12:35 pm 
Didier Dorange-PattoretNov 21, 2004 1:46 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[prog] Textshape dans un cadre [writer]Actions...
From:Agnès Simonet (agne@laposte.net)
Date:Nov 21, 2004 5:42:09 am
List:org.openoffice.fr.prog

Bonjour, Voici un problème soulevé par Didier Dorange-Pattoret avec la macro Bordure_selection.

J'essaie d'insérer une forme-texte faite par macro, avec bordure, ancrée comme caractère, à la position courante du curseur. La macro fonctionne sans problème dans du texte simple ou un tableau mais curieusement dans un cadre, la forme-texte est là mais sans bordure et apparemment sans contenu de texte. Pourtant il suffit de double-cliquer dedans pour voir le texte. C'est très étrange.

Une piste peut-être : Un clic droit/Adaptation du Texte/Editer, sur la forme insérée par macro, révèle 'parallèle'et cette propriété ne peut être changée. Alors que lorsqu'on fait à la main l'opération effectuée par la macro (T de l'outil dessin puis ancrage comme caractère),il n'y a aucun problème. Mais alors l'adaptation du texte est réglée, par défaut sans doute, à continue.

Agnès S. (OOo 1.1.3)

------------------ Sub textshape

Dim MonDocument As Object, MonTexte As Object Dim MonCurseur As Object Dim CurseurVisible As Object Dim MonRectangle As Object Dim TailleRectangle As New com.sun.star.awt.Size Dim TextRectangle As String Dim CurseurRectangle As Object

' (3 lignes) MonDocument = ThisComponent CurseurVisible = MonDocument.currentcontroller.ViewCursor MonTexte = CurseurVisible.Text

'crée un rectangle (5 lignes) TailleRectangle.Width = 1 TailleRectangle.Height = 1 MonRectangle=MonDocument.createInstance("com.sun.star.drawing.TextShape") MonTexte.insertTextContent( CurseurVisible,MonRectangle,true) MonRectangle.Size = TailleRectangle

'ancrage comme caractère (1 ligne) MonRectangle.AnchorType = com.sun.star.text.TextContentAnchorType.AS_CHARACTER

'bordure (1 ligne) MonRectangle.LineStyle = com.sun.star.drawing.LineStyle.SOLID

'adapte la taille du rectangle à celle du texte (2 lignes) MonRectangle.TextAutoGrowWidth = true MonRectangle.TextAutoGrowHeight = true

'écrit dans le rectangle (3 lignes) TexteRectangle = MonRectangle.Text CurseurRectangle=TexteRectangle.createTextCursor TexteRectangle.insertString(CurseurRectangle,"Texte du textshape",TRUE)

End Sub