3 messages in org.openoffice.fr.prog[prog] Appel d'une fonction java
FromSent OnAttachments
Christophe DevallandOct 17, 2005 12:30 am 
Alain NowakOct 24, 2005 4:41 am 
Christophe DevallandOct 24, 2005 12:11 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] Appel d'une fonction javaActions...
From:Christophe Devalland (chri@ac-rouen.fr)
Date:Oct 17, 2005 12:30:43 am
List:org.openoffice.fr.prog

Bonjour,

j'utilise le filtre Writer2latex écrit en java. Cela fonctionne parfaitement. Comme j'aimerais écrire moi-même un utilitaire permettant de convertir un texte OOo contenant des formules mathématiques en un texte au format SPIP pour publication sur le web, j'aurais besoin d'accéder à une fonction en particulier présente dans la distribution Writer2Latex. Cette fonction convertit une chaine de caractères contenant une formule au format OOo en une formule au format LaTeX. Je pense que celle-ci est contenue dans le fichier writer2latex04\source\writer2latex\latex\content\StarMathConverter.java et s'appelle convert. Pour info voici son code :

public String convert(String sStarMath){ String sExport=""; buffer=new SimpleInputBuffer(sStarMath); nextToken(); sExport=table(12.0F,Token.ALIGNC); return sExport.length()==0 ? " " : sExport; // don't return an empty formula! //System.out.println(sExport);

ma question : puis-je l'appeler à partir d'une macro OOo du genre : sFormuleLaTeX=convert(sFormuleOOo)

j'ai essayé de créer un service Uno avec com.sun.star.loader.java mais mes connaisssances en ce domaine sont très limitées et ça ne fonctionne pas.

Quelqu'un a-t-il une idée ? merci beaucoup.