This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/Dmaths/Module4.xba is in libreoffice-dmaths 3.4+dfsg1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Module4" script:language="StarBasic">&apos;************************************************
&apos;Copyright (C) 2008 Didier Dorange-Pattoret
&apos;38, chemin de l&apos;Abbaye 
&apos;74940 Annecy le Vieux
&apos;France
&apos;ddorange@dmaths.com
&apos;
&apos;
&apos;This library is free software; you can redistribute it and/or
&apos;modify it under the terms of the GNU General Public Licence (GPL)
&apos;as published by the Free Software Foundation; either
&apos;version 2.1 of the License, or (at your option) any later version.

&apos;This library is distributed in the hope that it will be useful,
&apos;but WITHOUT ANY WARRANTY; without even the implied warranty of
&apos;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
&apos;General Public License for more details.

&apos;You should have received a copy of the GNU General Public Licence (GPL)
&apos;along with this library; if not, write to the Free Software
&apos;Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
&apos;************************************************

Public  sPoints(8) as String
Public sCoordPoints(8,1) as Single 
Public oPoints as Object
Public bPoints as Boolean rem bPoints=True si on trace des points
Public NbrePoints as Integer


Sub Repoints
	oPoints = LoadDialog(&quot;Dmaths&quot;,&quot;Points&quot;)
	If bCalcul=true Then 
	oValeurs.Visible=False
	If bParam(Nbrecourbes) = False Then
	oPoints.Model.TextField2.Text = oValeurs.GetControl(&quot;TextField1&quot;).Peer.Text
	oPoints.Model.TextField3.Text = oValeurs.GetControl(&quot;TextField2&quot;).Peer.Text
	Else
	oPoints.Model.TextField2.Text = oValeurs.GetControl(&quot;TextField2&quot;).Peer.Text
	oPoints.Model.TextField3.Text = oValeurs.GetControl(&quot;TextField3&quot;).Peer.Text
	Endif
	ElseIf bGrille=True Then
	oGrille.Visible=False
	Else
	oRepFonctions.Visible=False
	Endif

	
	NbrePoints=0
	oPoints.Execute()
	End Sub
	
	Sub PointSupplementaire
	If NbrePoints=8 Then 
	Dmaths.Module5.Avertir(24)
	bError=True
	Goto Fin
	Endif
	sPoints(NbrePoints)=oPoints.Model.TextField1.Text
	sCoordPoints(NbrePoints,0)=CsngPlus(oPoints.GetControl(&quot;TextField2&quot;).Peer.Text)
	sCoordPoints(NbrePoints,1)=CsngPlus(oPoints.GetControl(&quot;TextField3&quot;).Peer.Text)
	NbrePoints=NbrePoints+1
	oPoints.Model.TextField1.Text=&quot; &quot;
	oPoints.GetControl(&quot;TextField1&quot;).SetFocus
	Fin:
	End Sub

Sub TracePoints
	bPoints=True
	sPoints(NbrePoints)=oPoints.Model.TextField1.Text
	sCoordPoints(NbrePoints,0)=CsngPlus(oPoints.GetControl(&quot;TextField2&quot;).Peer.Text)
	sCoordPoints(NbrePoints,1)=CsngPlus(oPoints.GetControl(&quot;TextField3&quot;).Peer.Text)
	oPoints.Endexecute()
	If bCalcul=True Then	
	oValeurs.Visible=True
	Elseif bGrille=True then
	oGrille.Visible=True
	Else oRepFonctions.Visible=True
	Endif
End Sub

Sub FinRepoints
	oPoints.EndExecute()
	If bCalcul=True Then
	oValeurs.Visible=True
	Elseif bGrille=True Then 
	oGrille.Visible=True
	Else
	oRepfonctions.Visible=True 
	End If
End Sub

rem lance le logiciel

Sub LanceAppli(sChemin as String)
	On Error Goto ImpLancer
	If Len(sChemin) &gt; 0 Then  
		If DetermineOS = 4 Then	
		&apos;	Print sChemin
			Shell(sChemin,2)
		Else
			Dim sys As Object
			Dim iFlags As Integer
		&apos;	If DetermineOS = 3 Then sChemin = ConvertToUrl(sChemin)
			sys = CreateUnoService(&quot;com.sun.star.system.SystemShellExecute&quot;)
			iFlags = com.sun.star.system.SystemShellExecuteFlags.NO_SYSTEM_ERROR_MESSAGE &apos; = 0
			sys.execute(ConvertToUrl(sChemin),&quot; &quot;, iFlags)
		End if		
	Else 
		Avertir(236)		
	Endif
	Exit Sub
	
	ImpLancer:
	MsgBox(sMessag,48,&quot;Dmaths&quot;)
End Sub

Sub Launchsoftware1
	Call VerifOperationnel	
	LanceAppli(sCheminSoftware1)
End Sub

Sub Launchsoftware2
	Call VerifOperationnel
	LanceAppli(sCheminSoftware2)
End Sub

Sub Launchsoftware3
	Call VerifOperationnel
	LanceAppli(sCheminSoftware3)
End Sub


Rem Corrige le bug de Csng sus linux
Function CsngPlus(sMot as String)
	On Error Goto Fin
	Dim resultat as Single
	Dim I,N as Integer
	I=1
	N=0
	Do While (Mid(sMot,I,1)&lt;&gt;&quot;,&quot; and I&lt;&gt;Len(sMot))
	I=I+1
	Loop
	If Mid(sMot,I,1)=&quot;,&quot; Then
	If I=1 Then
	sMot=Mid(sMot,2,Len(sMot)-1)
	Elseif I=Len(sMot) Then
	sMot=Mid(sMot,1,Len(sMot)-1)
	Else
	sMot=Mid(sMot,1,I-1)+Mid(sMot,I+1,Len(sMot)-I)
	EndIf
	N=Len(sMot)-I+1
	EndIf
	rem Print &quot;sMot   &quot;,sMot
	resultat=Csng(sMot)/(10^N)
	CsngPlus=resultat
	Fin:
	End Function

rem ecrit l&apos;adresse à la norme linux
Function NormFile(sString as String)
For I=1 To Len(sString)
If Mid(sString,I,1)=&quot;\&quot; Then
	If I=0 Then
	sString=&quot;/&quot;+Mid(sString,2,Len(sString)-1)
	ElseIf I=Len(sString) Then
	sString=Mid(sString,1,Len(sString)-1)+&quot;/&quot;
	Else sString=Mid(sString,1,I-1)+&quot;/&quot;+Mid(sString,I+1,Len(sString)-I)
	Endif
Endif
Next I
For I=1 To Len(sString)
If Mid(sString,I,1)=&quot;:&quot; Then
	If I=0 Then
	sString=&quot;|&quot;+Mid(sString,2,Len(sString)-1)
	ElseIf I=Len(sString) Then
	sString=Mid(sString,1,Len(sString)-1)+&quot;|&quot;
	Else sString=Mid(sString,1,I-1)+&quot;|&quot;+Mid(sString,I+1,Len(sString)-I)
	Endif
Endif
Next I
NormFile=sString
End Function

Sub CalcDiagBox     				rem mise au point le 2/01/03
	Dim Numero as integer &apos;numéro de courbe
	oRepfonctions.Model.CheckBox5.State=1
	oRepfonctions.Model.CheckBox4.State=0
	If oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text=&quot;&quot; or  oRepboites.GetControl(&quot;TextField2&quot;).Peer.Text=&quot;&quot; or  oRepboites.GetControl(&quot;TextField3&quot;).Peer.Text=&quot;&quot; or  oRepboites.GetControl(&quot;TextField4&quot;).Peer.Text=&quot;&quot; or  oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text=&quot;&quot; Then
	Dmaths.Module5.Avertir(18)
	Goto Fin
	EndIf
	&apos;Numero=0
	sFormul(0)=&quot;x=&quot;+oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text
	Xmin(0)=CsngPlus(oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text)
	Xmax(0)=CsngPlus(oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text)
	Ymin(0)=2-CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)*0.1
	Ymax(0)=2+CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)*0.1
	&apos;Numero=1
	sFormul(1)=&quot;2&quot;
	Xmin(1)=CsngPlus(oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text)
	Xmax(1)=CsngPlus(oRepboites.GetControl(&quot;TextField2&quot;).Peer.Text)
	&apos;Numero=2
	sFormul(2)=&quot;x=&quot;+oRepboites.GetControl(&quot;TextField2&quot;).Peer.Text
	Xmin(2)=CsngPlus(oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text)
	Xmax(2)=CsngPlus(oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text)
	Ymin(2)=2-CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)/2
	Ymax(2)=2+CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)/2
	&apos;Numero=3
	sFormul(3)=&quot;2+&quot;+oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text+&quot;/2&quot;
	Xmin(3)=CsngPlus(oRepboites.GetControl(&quot;TextField2&quot;).Peer.Text)
	Xmax(3)=CsngPlus(oRepboites.GetControl(&quot;TextField4&quot;).Peer.Text)
	&apos;Numero=4
	sFormul(4)=&quot;2-&quot;+oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text+&quot;/2&quot;
	Xmin(4)=CsngPlus(oRepboites.GetControl(&quot;TextField2&quot;).Peer.Text)
	Xmax(4)=CsngPlus(oRepboites.GetControl(&quot;TextField4&quot;).Peer.Text)
	&apos;Numero=5
	sFormul(5)=&quot;x=&quot;+oRepboites.GetControl(&quot;TextField3&quot;).Peer.Text
	Xmin(5)=CsngPlus(oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text)
	Xmax(5)=CsngPlus(oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text)
	Ymin(5)=2-CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)/2
	Ymax(5)=2+CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)/2
	&apos;Numero=6
	sFormul(6)=&quot;x=&quot;+oRepboites.GetControl(&quot;TextField4&quot;).Peer.Text
	Xmin(6)=CsngPlus(oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text)
	Xmax(6)=CsngPlus(oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text)
	Ymin(6)=2-CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)/2
	Ymax(6)=2+CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)/2
	&apos;Numero=7
	sFormul(7)=&quot;2&quot;
	Xmin(7)=CsngPlus(oRepboites.GetControl(&quot;TextField4&quot;).Peer.Text)
	Xmax(7)=CsngPlus(oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text)
	&apos;Numero=8
	sFormul(8)=&quot;x=&quot;+oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text
	Xmin(8)=CsngPlus(oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text)
	Xmax(8)=CsngPlus(oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text)
	Ymin(8)=2-CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)*0.1
	Ymax(8)=2+CsngPlus(oRepboites.GetControl(&quot;TextField8&quot;).Peer.Text)*0.1
	oRepfonctions.Model.TextField1.Text=&quot;x=&quot;+oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text
	oRepfonctions.Model.TextField13.Text=oRepboites.GetControl(&quot;TextField1&quot;).Peer.Text
	oRepfonctions.Model.TextField14.Text=oRepboites.GetControl(&quot;TextField5&quot;).Peer.Text
	oRepfonctions.getControl(&quot;CheckBox1&quot;).visible = False
	oRepfonctions.getControl(&quot;CheckBox5&quot;).visible = False
	oRepfonctions.getControl(&quot;CheckBox9&quot;).visible = False
	oRepfonctions.getControl(&quot;CommandButton4&quot;).visible = False
	oRepfonctions.getControl(&quot;CommandButton5&quot;).visible = False
	oRepfonctions.getControl(&quot;CommandButton7&quot;).visible = False
	oRepfonctions.getControl(&quot;TextField17&quot;).visible = False
	oRepfonctions.getControl(&quot;TextField4&quot;).visible = False
	oRepfonctions.getControl(&quot;TextField5&quot;).visible = False
	oRepfonctions.getControl(&quot;CheckBox9&quot;).visible = False
	oRepfonctions.getControl(&quot;CheckBox10&quot;).visible = False
	oRepfonctions.getControl(&quot;TextField1&quot;).visible = False
	oRepfonctions.getControl(&quot;OptionButton1&quot;).visible = False
	oRepfonctions.getControl(&quot;OptionButton2&quot;).visible = False
	oRepfonctions.getControl(&quot;FrameControl3&quot;).visible = False
	oRepfonctions.getControl(&quot;FrameControl4&quot;).visible = False
	oRepfonctions.getControl(&quot;Label6&quot;).visible = False
	oRepfonctions.getControl(&quot;Label7&quot;).visible = False
	oRepboites.Visible=False
	oRepfonctions.Execute()
	Fin:
End Sub

Sub CalculValeurs                              				rem: mise au point le 2/01/03
	Dim sFormule,sCalc as String
	Dim oDeskTop as Object
	Dim oSheets as Object
	oDesktop=createUnoService(&quot;com.sun.star.frame.Desktop&quot;)
	Dim mFileProperties(0) As New com.sun.star.beans.PropertyValue
	mFileProperties(0).Name=&quot;Hidden&quot;
	mFileProperties(0).Value=True
	BasicLibraries.LoadLibrary(&quot;Standard&quot;)
	sCalc = sChemindmathsODS
&apos;	Print sChemindmaths
	oNewCalcVal = oDesktop.LoadComponentFromURL(sCalc,&quot;_blank&quot;,0,mFileProperties())
	oSheetVal=oNewCalcVal.Sheets(0)
	sFormule=oRepfonctions.GetControl(&quot;TextField1&quot;).Peer.Text
	FdeX(sFormule,NbreCourbes)
	bCalcul=True
	oRepfonctions.Visible=False
	oValeurs = LoadDialog(&quot;Dmaths&quot;,&quot;Valeurs&quot;)
	If bParam(NbreCourbes)=False Then 
	oValeurs.GetControl(&quot;TextField3&quot;).Visible=False
	oValeurs.GetControl(&quot;Label3&quot;).Visible=False
	Else
	oValeurs.GetControl(&quot;Label2&quot;).Text=Mid(oValeurs.GetControl(&quot;Label2&quot;).Peer.Text,1,Len(oValeurs.GetControl(&quot;Label2&quot;).Peer.Text)-4)+&quot;x(t)&quot;
	oValeurs.GetControl(&quot;Label1&quot;).Text=Mid(oValeurs.GetControl(&quot;Label1&quot;).Peer.Text,1,Len(oValeurs.GetControl(&quot;Label1&quot;).Peer.Text)-1)+&quot;t&quot;
	Endif
	oValeurs.Execute()
End Sub

Sub DonneValeurs               									rem: mis au point le 2/01/03
	Dim Variable as Single
	Variable=Csng(oValeurs.GetControl(&quot;TextField1&quot;).Peer.Text)
	Dim NbreA as integer
	NbreA = Cint(oValeurs.GetControl(&quot;TextField4&quot;).Peer.Text)
	If bParam(NbrePoints)=False Then
		If sNewFormul(NbreCourbes,1)&lt;&gt;&quot;Spline cubique&quot; Then
			parse(sNewFormul(NbreCourbes,1),erflag)
			oValeurs.Model.TextField2.Text = Cstr(Arrondir(f(Variable),NbreA))
		Else
			NumInter = 1			
			Do while (Variable&gt;=Csng(sNewFormulSpline(NbreCourbes,NumInter,1)) and Len(sNewFormulSpline(NbreCourbes,NumInter-1,0))&gt;0 and NumInter&lt;8)
				NumInter = NumInter+1
			Loop				
			If (Len(sNewFormulSpline(NbreCourbes,NumInter-1,0))&gt;0 or NumInter = 1) Then
				parse(sNewFormulSpline(NbreCourbes,NumInter-1,0),erflag)
			Else
				parse(sNewFormulSpline(NbreCourbes,NumInter-2,0),erflag)
			Endif			
			oValeurs.Model.TextField2.Text = Cstr(Arrondir(f(Variable),NbreA))
		Endif	
	Else
			parse0(sNewFormul(NbreCourbes,0),erflag)		
			oValeurs.Model.TextField2.Text = Cstr(Arrondir(f0(Variable),NbreA))
			parse(sNewFormul(NbreCourbes,1),erflag)
			oValeurs.Model.TextField3.Text = Cstr(Arrondir(f(Variable),NbreA))
	Endif
	oValeurs.GetControl(&quot;TextField1&quot;).SetFocus
End Sub

Sub FinCalculValeurs									rem: mis au point le 2/01/03
	bCalcul=False
	oValeurs.EndExecute()
	oRepfonctions.Visible=True
	&apos;oNewCalcVal.Store()
	oNewCalcVal.Dispose()
End Sub

rem ------------------------------------------------------------------------------------------------------------------
Sub CalculStat												rem: mis au point le 2/01/03
	Dim sValeurs,sCalc,sToto,sLettre,sRange as String
	rem valeurs contient les valeurs, sLettre la lettre de plage de cellule
	Dim oNewCalc,oSheet,oCell,oDocument1 as Object
	Dim oDonneesRange,oSheets as Object
	Dim nDonnee as Single
	rem le classeur de données 
	Dim iNbre,K,iMed,iMed1,iMed2,nSheet,nRow,nCol,iNbreValeurs as Integer
	bError=False
	rem chargement du fichier tableur
	sUrl = &quot;private:factory/sdraw&quot;
	oDesktop=createUnoService(&quot;com.sun.star.frame.Desktop&quot;)
	Dim mFileProperties(0) As New com.sun.star.beans.PropertyValue
	mFileProperties(0).Name=&quot;Hidden&quot;
	mFileProperties(0).Value=True
	sCalc=sChemindmathsODS
	oNewCalc = oDesktop.LoadComponentFromURL(sCalc,&quot;_blank&quot;,0,mFileProperties())
	bNewCalc=True
	oSheet=oNewCalc.Sheets(1)
	oCell=GetCell(oSheet,0,0)
	oCell.Setvalue(1)
	
	
	sValeurs = oRepboites.Getcontrol(&quot;TextField9&quot;).Peer.Text

	If sValeurs&lt;&gt;&quot;&quot; Then
	rem: cas où la série est saisie dans la fenêtre de la boîte de dialogue.
	rem remplissage des cellules
	RempliCellules(sValeurs,iNbreValeurs,0,oSheet)
		If (Int(iNbreValeurs/2)&lt;&gt;(iNbreValeurs/2) and oRepboites.Model.CheckBox2.State=1)  Then
		Dmaths.Module5.Avertir(19)
		Goto Fin
	EndIf
	Else
		rem: la série est dans une feuille de calcul.
		Rem: on choisit le classeur
	
		If oRepboites.Getcontrol(&quot;TextField12&quot;).Peer.Text = &quot;&quot; Then rem message d&apos;erreur si pas de classeur sélectionné
		Dmaths.Module5.Avertir(20)
		Goto Fin	
		Endif
	&apos;	Print oRepboites.Model.FileControl1.Text
		If oRepboites.Model.FileControl1.Text=&quot;&quot; Then
		oDocument1=oDeskTop.GetCurrentComponent()
		Else
		Dim mFileProperties1(0) As New com.sun.star.beans.PropertyValue
		mFileProperties1(0).Value=True
		sCalc=&quot;file:///&quot;+NormFile(oRepboites.Model.FileControl1.Text)
		oDocument1 = oDesktop.LoadComponentFromURL(sCalc,&quot;_blank&quot;,0,mFileProperties1())
		Endif
		rem le classeur est choisi
		nSheet=Int(Csng(oRepboites.Getcontrol(&quot;TextField11&quot;).Peer.Text))-1
		oSheet1=oDocument1.Sheets(nSheet)
		sRange = oRepboites.GetControl(&quot;TextField12&quot;).Peer.Text
		oDonneesRange=oSheet1.GetCellRangeByName(sRange)
		nRow=oDonneesRange.Rows.Count
		nCol=oDonneesRange.Columns.Count
		If nCol=1 Then
		iNbreValeurs=nRow
		For I=0 To nRow-1
		oCell=oDonneesRange.GetCellByPosition(0,I)
		nDonnee=oCell.GetValue()
		oCell=GetCell(oSheet,0,I)
		oCell.Value=nDonnee
		Next I
		ElseIf nCol=2 Then
		iNbreValeurs=nRow*2
		oRepboites.Model.Checkbox2.State=1
		For I=0 To nRow-1
		oCell=oDonneesRange.GetCellByPosition(0,I)
		nDonnee=oCell.Value
		oCell=GetCell(oSheet,0,2*I)
		oCell.Value=nDonnee
		oCell=oDonneesRange.GetCellByPosition(1,I)
		nDonnee=oCell.Value
		oCell=GetCell(oSheet,0,2*I+1)
		oCell.Value=nDonnee
		Next I
		Else
		Dmaths.Module5.Avertir(21)
		Goto Fin
		Endif
	Endif
	
	If oRepboites.Model.CheckBox2.State=1 Then 
	iNbreValeurs=iNbreValeurs/2
	EcriSerie(iNbreValeurs,oSheet)
	EndIf
	If bError=True Then Goto Fin
	If oRepboites.Model.CheckBox2.State=1 Then
	iNbre=iEfftotal
	rem variable public qui contient l&apos;effectif total de la série à coefficients
	sLettre=&quot;B&quot;
	Else
	iNbre=iNbreValeurs
	sLettre=&quot;A&quot;
	EndIf
	rem calcule le minimum
	oCell=GetCell(oSheet,3,0)
	sToto=Str(iNbre)
	sToto=Mid(sToto,2,Len(sToto)-1)
	oCell.Formula=&quot;=ROUND(MIN(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	oRepboites.Model.TextField1.Text=oCell.Value
	rem calcule le maximum
	oCell=GetCell(oSheet,3,4)
	oCell.Formula=&quot;=ROUND(MAX(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	oRepboites.Model.TextField5.Text=oCell.Value
	rem calcule la moyenne
	oCell=GetCell(oSheet,3,7)
	oCell.Formula=&quot;=ROUND(AVERAGE(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	oRepboites.Model.TextField6.Text=oCell.Value
	rem calcule l&apos;écart-type
	oCell=GetCell(oSheet,3,8)
	oCell.Formula=&quot;=ROUND(STDEVP(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	oRepboites.Model.TextField7.Text=oCell.Value
	rem calcule la médiane tableur
	oCell=GetCell(oSheet,3,9)
	oCell.Formula=&quot;=ROUND(MEDIAN(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=0 Then oRepboites.Model.TextField3.Text=oCell.Value
	rem calcule le Q1
	oCell=GetCell(oSheet,3,10)
	oCell.Formula=&quot;=ROUND(PERCENTILE(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;; 0.25 );&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=0 Then oRepboites.Model.TextField2.Text=oCell.Value
	rem calcule le Q3
	oCell=GetCell(oSheet,3,11)
	oCell.Formula=&quot;=ROUND(PERCENTILE(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;; 0.75 );&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=0 Then oRepboites.Model.TextField4.Text=oCell.Value
	rem calcule le D1
	oCell=GetCell(oSheet,3,12)
	oCell.Formula=&quot;=ROUND(PERCENTILE(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;; 0.1 );&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=0 Then oRepboites.Model.TextField10.Text=oCell.Value
	rem calcule le D9
	oCell=GetCell(oSheet,3,13)
	oCell.Formula=&quot;=ROUND(PERCENTILE(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;; 0.9 );&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=0 Then oRepboites.Model.TextField14.Text=oCell.Value
	rem Calcule le Q1 programme
	If Int(iNbre/4)=iNbre/4 Then K=iNbre/4 Else K=Int(iNbre/4)+1
	oCell=GetCell(oSheet,3,1)
	oCell.Formula=&quot;=ROUND(SMALL(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;;&quot;+K+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=1 Then oRepboites.Model.TextField2.Text=oCell.Value
	rem Calcule le Q3 programme
	If Int(3*iNbre/4)=3*iNbre/4 Then K=3*iNbre/4 Else K=Int(3*iNbre/4)+1
	oCell=GetCell(oSheet,3,3)
	oCell.Formula=&quot;=ROUND(SMALL(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;;&quot;+K+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=1 Then oRepboites.Model.TextField4.Text=oCell.Value
	rem Calcule le D1 programme
	If Int(iNbre/10)=iNbre/10 Then K=iNbre/10 Else K=Int(iNbre/10)+1
	oCell=GetCell(oSheet,3,5)
	oCell.Formula=&quot;=ROUND(SMALL(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;;&quot;+K+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=1 Then oRepboites.Model.TextField10.Text=oCell.Value
	rem Calcule le D9 programme
	If Int(9*iNbre/10)=9*iNbre/10 Then K=9*iNbre/10 Else K=Int(9*iNbre/10)+1
	oCell=GetCell(oSheet,3,6)
	oCell.Formula=&quot;=ROUND(SMALL(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;;&quot;+K+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=1 Then oRepboites.Model.TextField14.Text=oCell.Value
	rem Calcule le médiane programme
	If Int((iNbre+1)/2)=(iNbre+1)/2 Then 
	K=(iNbre+1)/2
	oCell=GetCell(oSheet,3,2)
	oCell.Formula=&quot;=ROUND(SMALL(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;;&quot;+K+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	If oRepboites.Model.CheckBox1.State=1 Then oRepboites.Model.TextField3.Text=oCell.Value
	Else 
	K=Int(iNbre/2)
	oCell=GetCell(oSheet,3,14)
	oCell.Formula=&quot;=ROUND(SMALL(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;;&quot;+K+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	iMed1=oCell.GetValue
	oCell=GetCell(oSheet,3,15)
	K=K+1
	oCell.Formula=&quot;=ROUND(SMALL(&quot;+sLettre+&quot;1:&quot;+sLettre+sToto+&quot;;&quot;+K+&quot;);&quot;+oRepboites.GetControl(&quot;TextField15&quot;).Peer.Text+&quot;)&quot;
	iMed2=oCell.GetValue
	iMed=(iMed1+iMed2)/2
	oCell=GetCell(oSheet,3,2)
	oCell.Value=iMed
	If oRepboites.Model.CheckBox1.State=1 Then oRepboites.Model.TextField3.Text=oCell.Value
	Endif
	iNbreValeurs1=iNbreValeurs
	Fin:
	If bNewCalc=True Then
	&apos;oNewCalc.Store()
	oNewCalc.Dispose()
	bNewCalc=False
	Endif
End Sub

Sub SauvStat									rem: mis au point le 2/01/03
Dim nRow,nCol as Integer
Dim sValeurs,sCalc,sRange,sUrl as String
Dim nDonnee as Single
Dim sDonnee as String
rem valeurs contient les valeurs, sLettre la lettre de plage de cellule
Dim oNewCalc,oSheet,oSheet2,oCell,oDonneesRange as Object
rem le classeur de données 
bError=False
rem chargement du fichier tableur

oDesktop=createUnoService(&quot;com.sun.star.frame.Desktop&quot;)
Dim mFileProperties(0) As New com.sun.star.beans.PropertyValue
mFileProperties(0).Name=&quot;Hidden&quot;
mFileProperties(0).Value=True
sCalc=sChemindmathsODS
oNewCalc = oDesktop.LoadComponentFromURL(sCalc,&quot;_blank&quot;,0,mFileProperties())
bNewCalc=True
oSheet=oNewCalc.Sheets(1)
oCell=GetCell(oSheet,0,0)
oCell.Setvalue(1)

sValeurs=oRepboites.Model.TextField9.Text
If sValeurs&lt;&gt;&quot;&quot; Then
	rem: on ouvre un nouveau classeur
	Dim noArgs(0) As New com.sun.star.beans.PropertyValue
	sUrl = &quot;private:factory/scalc&quot;
	oDocument2 = oDesktop.LoadComponentFromURL(sUrl,&quot;_blank&quot;,0,noArgs())
	oSheet2=oDocument2.Sheets(0)
	If oRepboites.Model.CheckBox2.State=0 Then
		For I=0 To iNbreValeurs1-1
		oCell=GetCell(oSheet,0,I)
		nDonnee=oCell.GetValue()
		oCell=GetCell(oSheet2,0,I)
		oCell.Value=nDonnee
		Next I
	Else
		For I=0 To iNbreValeurs1-1
		oCell=GetCell(oSheet,0,2*I)
		nDonnee=oCell.GetValue()
		oCell=GetCell(oSheet2,0,I)
		oCell.Value=nDonnee
		oCell=GetCell(oSheet,0,2*I+1)
		nDonnee=oCell.GetValue()
		oCell=GetCell(oSheet2,1,I)
		oCell.Value=nDonnee
		Next I
	Endif
Else
oSheet2=oSheet1
Endif
sRange = oRepboites.Getcontrol(&quot;TextField13&quot;).Peer.Text
If sRange=&quot;&quot; Then 
Dmaths.Module5.Avertir(22)
bError=True
rem marque l&apos;erreur
Goto Fin
Endif
oDonneesRange=oSheet2.GetCellRangeByName(sRange)
nRow=oDonneesRange.Rows.Count
nCol=oDonneesRange.Columns.Count
If nRow&lt;&gt;16 or nCol&lt;&gt;2 Then
Dmaths.Module5.Avertir(22)
bError=True
rem marque l&apos;erreur
Goto Fin
Else
For I=0 To nRow-1
oCell=GetCell(oSheet,2,I)
sDonnee=oCell.String
oCell=GetCell(oSheet,3,I)
nDonnee=oCell.GetValue()
oCell=oDonneesRange.GetCellByPosition(0,I)
oCell.String=sDonnee
oCell=oDonneesRange.GetCellByPosition(1,I)
oCell.String=nDonnee
Next I
Endif
Fin:
If bNewCalc=True Then
&apos;oNewCalc.Store()
oNewCalc.Dispose()
bNewCalc=False
Endif
End Sub
rem: sauvegarde les résultats obtenus.



Rem iNombre contiendra le nombre de données.
Sub RempliCellules(sString as String,iNombre,iColonne as Integer,oSheet as Object)
Dim N1,N2 as Integer
Dim oCell as Object
iNombre=0
N1=1
N2=1
Do while N1+N2&lt;=Len(sString)+1
Do while (Mid(sString,N1+N2,1)&lt;&gt;&quot;;&quot; and N1+N2&lt;=Len(sString)) 
N2=N2+1
Loop
oCell=GetCell(oSheet,iColonne,iNombre)
oCell.SetValue(CsngPlus(Mid(sString,N1,N2)
N1=N1+N2+1
N2=1
iNombre=iNombre+1
Loop
For I=iNombre To 100
oCell=GetCell(oSheet,iColonne,I)
oCell.Setvalue(&quot;&quot;)
rem iNombre est le nombre de données saisies
Next I
End Sub

Sub EcriSerie(iNombre as Integer, oSheet as Object)
Dim oCellule as Object
Dim iValPro,iDonnee,iEff as Integer
rem iNombre est le nombre de valeurs prise par la série, iEff contiendra le nombre total de valeurs de la série
iEff=0
For I=0 To iNombre-1
oCellule=GetCell(oSheet,0,2*I)
iDonnee=oCellule.GetValue()
oCellule=GetCell(oSheet,0,2*I+1)
iValPro=oCellule.GetValue()
If (iValPro&lt;0 or Int(iValPro)&lt;&gt;iValPro)  Then
Dmaths.Module5.Avertir(23)
bError=True
rem marque l&apos;erreur
Goto Fin
EndIf
For J=1 To iValPro
oCellule=GetCell(oSheet,1,iEff)
oCellule.SetValue(iDonnee)
iEff=1+iEff
Next J
Next I
iEfftotal=iEff
For I=iEff To 100
oCellule=GetCell(oSheet,1,I)
oCellule.Setvalue(&quot;&quot;)
Next I
Fin:
End Sub







 

</script:module>