Bonjour,

désolé pour ce message un peu technique.
J'ai créé une extension CmathOOo et participé au projet Dmaths.
Depuis la version 2.3.1, la fonctionnalité qui nous permet d'insérer une
formule est buguée (j'ai ouvert l'issue
http://www.openoffice.org/issues/show_bug.cgi?id=67283 qui n'en finit pas
d'être résolue mais qui ne l'est jamais). La formule n'est pas
redimensionnée ce qui fait qu'elle apparaît dans une boite minuscule (voir
le code basic dans l'issue).
Si on clique deux fois dessus, elle prend sa taille normale.
Ma question : Peut-on simuler ce double clic en OOoBasic ?
Merci de vos idées.

Pour info voici le code qui insère la formule :

Sub InsereFormule(oViewCursor as Object, oTextCursor as Object, sPolice as
String, iTaille as Integer, sFormule as String, bModeTexte as boolean)
    dim obj as object
    obj=ThisComponent.CreateInstance("com.sun.star.text.TextEmbeddedObject")
    obj.CLSID="078B7ABA-54FC-457F-8551-6147e776a997"
    obj.AnchorType=com.sun.star.text.TextContentAnchorType.AS_CHARACTER
    ThisComponent.getCurrentController().select(oTextCursor)
    oTextCursor.Text.insertTextContent(oTextCursor, obj, true)
      obj.EmbeddedObject.BaseFontHeight=iTaille
      obj.EmbeddedObject.FontNameVariables=sPolice
      obj.EmbeddedObject.FontVariablesIsItalic=true
       obj.EmbeddedObject.FontNameNumbers=sPolice
      obj.EmbeddedObject.FontNameText=sPolice
      obj.EmbeddedObject.FontNameFunctions=sPolice
      obj.EmbeddedObject.IsScaleAllBrackets=True
      obj.EmbeddedObject.RelativeIndexSubscript=0
      obj.EmbeddedObject.RelativeIndexSuperscript=0
       obj.EmbeddedObject.LeftMargin=30
     obj.EmbeddedObject.RightMargin=30
    obj.EmbeddedObject.RelativeSpacing=20
      obj.EmbeddedObject.IsTextMode=bModeTexte
      obj.EmbeddedObject.formula=sFormule
      obj.EmbeddedObject.setmodified(TRUE)
       obj.LeftMargin=0
      obj.RightMargin=0
      oViewCursor.goLeft(1,False)
      oViewCursor.goRight(1,False)
end sub
-- 
Christophe Devalland

Répondre à