4 messages in org.openoffice.fr.progRE: [prog] Ajout d'un Numberformat en...
FromSent OnAttachments
DAVID Jean-Claude - CETE Ouest/DU/AEHMar 15, 2006 5:21 am 
DAVID Jean-Claude - CETE Ouest/DU/AEHMar 15, 2006 7:33 am 
pacMar 15, 2006 7:39 am 
DAVID Jean-Claude - CETE Ouest/DU/AEHMar 15, 2006 7:55 am 
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:RE: [prog] Ajout d'un Numberformat en 2.0Actions...
From:DAVID Jean-Claude - CETE Ouest/DU/AEH (Jean@i-carre.net)
Date:Mar 15, 2006 7:33:46 am
List:org.openoffice.fr.prog

Bon, je fais avancer mon Shmilblick...

En fait il apparait que c'est avec le getByKey que j'ai des problèmes. Vous pouvez essayer le code ci dessous, qui indique que '# ##0' est différent de '# ##0' !!!???... ;-((((

S1 est codé en dur comme '# ##0', S2 est affecté par le 3ème format de la liste qui est égal à '# ##0'. Le test avec S1 ne fonctionne pas, celui avec S2 fonctionne.

Une idée ? JCD

Sub Test Dim i as Integer Dim NLS As New com.sun.star.lang.Locale dim s1 as String dim s2 as String dim oFormats as Object dim oFormat as Object

s1 = "# ##0"

oFormats = ThisComponent.getNumberFormats() oFormat = oFormats.getByKey(3) s2 = oFormat.FormatString()

if (s1 <> s2) then MsgBox "s1 <> s2 (S1 = '" & s1 & "', s2 = '" & s2 & "')", sbOkOnly, Titre_Appli MsgBox "oFormat.FormatString = " & oFormat.FormatString MsgBox "oFormat.Locale.Language = " & oFormat.Locale.Language MsgBox "oFormat.Locale.Country = " & oFormat.Locale.Country MsgBox "oFormat.Locale.Variant = " & oFormat.Locale.Variant MsgBox "oFormat.Type = " & oFormat.Type '16 ==> Type = "NUMBER" MsgBox "oFormat.Comment = " & oFormat.Comment else MsgBox "s1 = s2 (S1 = '" & s1 & "', s2 = '" & s2 & "')" end if

'Test 1 with s2 i = oFormats.queryKey ( s2, NLS, TRUE) MsgBox "With s2, i = '" & i & "'"

'Test with s1 NLS.Language = "fr" NLS.Country = "FR" i = oFormats.queryKey ( s1, NLS, TRUE) MsgBox "With s1, i = '" & i & "'"

'Test 2 with s2 (with NLS Specified) i = oFormats.queryKey ( s2, NLS, TRUE) MsgBox "With s2, i = '" & i & "'" End Sub