This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/Dmaths/Tableau_de_variations.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
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
<?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="Tableau_de_variations" 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; Jerome Ortais
&apos; Gisbert Friege
&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;************************************************


rem Option Explicit
Public oTava as Object
Public iCheckIndex as Integer
Public iNbreInter as Integer
rem Macros écrites par Didier Dorange-Pattoret
rem Buttons for brackets, pi, inf, cdot added by Gisbert Friege, mai 2007
rem Options for second derivative added by Gisbert Friege, june/july 2007
rem Dialogue: textfields for signs replaced by command bttons by Gisbert Friege nov 2007

Public bDerivee,bDerivee1,bDerivee2,bDerivee12,bSignesF, bSignesD as Boolean

rem cette macro lance la boite de dialogue 
Sub LanceTableVar 
	Call VerifOperationnel
	Dim I as Integer
	oTava = LoadDialog(&quot;Dmaths&quot;,&quot;Tava&quot;)

&apos; following two lines needed for the use of Module2.TextIndexSet_any and Module1.MetEntre	GF
	oBoite = oTava 
	Form1=True 
&apos; state for the start with bDerivee1
	bDerivee = TRUE
	bSignesF = FALSE
	bSignesD = TRUE
	bDerivee1 = TRUE
	bDerivee2 = FALSE
	
	iNbreInter = 1
	For I=2 To 6
		oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).Visible = False
	Next I
	For I=0 To 5
		oTava.GetControl(&quot;Label&quot;&amp;cstr(I*3+7)).Visible = False
	Next I
	oTava.GetControl(&quot;Label4&quot;).Visible = False
	For I=4 To 8
		oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = False
	Next I
	For I=14 To 43
		If (I Mod 5 &lt;&gt; 1) then oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = False
	Next I
	oTava.GetControl(&quot;TextField41&quot;).Visible = False &apos;sorry!
	For I=10 To 14
		oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I)).Visible = False
		oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+6)).Visible = False
	Next I
	oTava.Execute()
End Sub

rem ajuste au nombre d&apos;intervalles choisis
Sub AjusteNbreIntervalles
Dim I as Integer
	iNbreInter = cint(oTava.GetControl(&quot;ComboBox1&quot;).SelectedText)
	If iNbreInter &lt; 1 Then
		iNbreInter = 1
	Endif
	If iNbreInter &gt; 6 Then
		iNbreInter = 6
	Endif

	For I=0 To 6
		oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).State = False 
		If I &lt; iNbreInter+1 Then 
			oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).Visible = True 
		Else 
			oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).Visible = False
		End If
	Next I

	For I=0 To 6
		 oTava.GetControl(&quot;Label&quot;&amp;cstr(I*3+4)).Visible = False
	Next I

	For I=4 To 8
		If I &lt; iNbreInter+3 Then
			oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = True
			oTava.GetControl(&quot;TextField&quot;&amp;cstr(I+35)).Visible = True
			oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+6)).Visible = True
			oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+12)).Visible = True
		Else
			oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = False
			oTava.GetControl(&quot;TextField&quot;&amp;cstr(I+35)).Visible = False
			oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+6)).Visible = False	
			oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+12)).Visible = False	
	Endif
	Next I

	For I=10 To 38
		If I mod 5 = 0 Then
			If I = iNbreInter*5 + 5 Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = True Else oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = False 
		ElseIf I mod 5 = 3 Then
			If I = iNbreInter*5 + 8 Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = True Else oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = False 
		Elseif (I mod 5 = 4 or (I&gt; 12 and I mod 5 = 2)) Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = False
		Elseif (I mod 5 &lt;&gt;1 ) and (I &lt; iNbreInter*5 + 9) Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = True
		Else
			If (I mod 5 &lt;&gt;1 ) Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Visible = False
		Endif
	Next I
	MetenCreationTableauSignes
End Sub

rem Met la boite de dialogue en mode tableau de signes
Sub MetenCreationTableauSignes
Dim bEtat as Boolean
Dim I as Integer

	bEtat = bDerivee
	iNbreInter = cint(oTava.GetControl(&quot;ComboBox1&quot;).Peer.Text)
	oTava.GetControl(&quot;Label3&quot;).Visible = bEtat
	oTava.GetControl(&quot;TextField12&quot;).Visible = bEtat
	oTava.GetControl(&quot;TextField2b&quot;).Visible = bEtat
	oTava.GetControl(&quot;TextField3&quot;).Visible = bEtat
	oTava.GetControl(&quot;TextField&quot;&amp;cstr(iNbreInter*5+8)).Visible = bEtat
	oTava.GetControl(&quot;CommandButton15&quot;).Visible = bEtat

	For I = 1 To iNbreInter-1
		If oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).State Then
			oTava.GetControl(&quot;TextField&quot;&amp;cstr(I+38)).Visible = False
		Else
			oTava.GetControl(&quot;TextField&quot;&amp;cstr(I+38)).Visible = bEtat
		EndIf
		oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+15)).Visible = bEtat
	Next I

	For I = 0 To iNbreInter
		oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).Visible = bEtat
	Next I

End Sub

sub EchangeTF23
Dim sEchange as String
	sEchange = 	oTava.GetControl(&quot;TextField3&quot;).Peer.Text
	oTava.GetControl(&quot;TextField3&quot;).Peer.Text = oTava.GetControl(&quot;TextField2&quot;).Peer.Text
	oTava.GetControl(&quot;TextField2&quot;).Peer.Text = sEchange
End Sub


Sub MetenAfficheSignes &apos;seulement signes de f(x)
	oTava.GetControl(&quot;OptionButton1&quot;).Enable = FALSE
	oTava.GetControl(&quot;OptionButton2&quot;).Enable = FALSE
	oTava.GetControl(&quot;OptionButton6&quot;).Enable = FALSE
	oTava.GetControl(&quot;Label2&quot;).Visible = FALSE
	AjusteNbreIntervalles
	EchangeTF23
	bSignesF = TRUE
	bDerivee = FALSE
	bDerivee1 = FALSE
	bDerivee2 = FALSE
	Call MetenCreationTableauSignes
End Sub

Sub MetenSansSignesD &apos;seulement fleches/arcfleches de f(x)
	oTava.GetControl(&quot;OptionButton1&quot;).Enable = TRUE
	oTava.GetControl(&quot;OptionButton2&quot;).Enable = TRUE
	oTava.GetControl(&quot;OptionButton6&quot;).Enable = TRUE
	If bSignesF Then 
		EchangeTF23
		oTava.GetControl(&quot;Label2&quot;).Visible = TRUE
	EndIf
	bSignesF = FALSE
	bSignesD = FALSE
	bDerivee = TRUE
	Call MetenCreationTableauSignes
End Sub

Sub MetenComplete
	oTava.GetControl(&quot;OptionButton1&quot;).Enable = TRUE
	oTava.GetControl(&quot;OptionButton2&quot;).Enable = TRUE
	oTava.GetControl(&quot;OptionButton6&quot;).Enable = TRUE
	bSignesD = TRUE
	If bSignesF Then 
		EchangeTF23
		oTava.GetControl(&quot;Label2&quot;).Visible = TRUE
	EndIf
	bSignesF = FALSE
	bDerivee = TRUE
	Call MetenCreationTableauSignes
End Sub

Sub MetenDerivee1
	bDerivee1 = TRUE
	bDerivee2 = FALSE
	Call MetenCreationTableauSignes
End Sub

Sub MetenDerivee2
	bDerivee1 = FALSE
	bDerivee2 = TRUE
	Call MetenCreationTableauSignes
End Sub

Sub MetenDerivee12
	bDerivee1 = TRUE
	bDerivee2 = TRUE
	Call MetenCreationTableauSignes
End Sub

rem remplace le -, pi, inf
Function Dixio5(sMot as String)
Dim I as Integer
For I = 1 To Len(sMot)
	If Mid(sMot,I,1)=&quot;-&quot; Then Mid(sMot,I,1,&quot;&quot;)
Next I
For I = 1 To Len(sMot)-1
	If Mid(sMot,I,2)=&quot;pi&quot; Then Mid(sMot,I,2,&quot;&quot;)
Next I
For I = 1 To Len(sMot)-2
	If Mid(sMot,I,3)=&quot;inf&quot; Then Mid(sMot,I,3,&quot;&quot;)
Next I
For I = 1 To Len(sMot)-5
	If Mid(sMot,I,6)=&quot;`cdot`&quot; Then Mid(sMot,I,6,&quot;·&quot;)
Next I
Dixio5 = sMot
End Function

rem cree le tableau de variation ou de signes
Sub Cree_Tava
Dim oDoc as Object, oVCurs as Object, sMot as String
Dim I as Integer
Dim Signval as String
	iNbreInter = cint(oTava.GetControl(&quot;ComboBox1&quot;).Peer.Text) rem releve le nbre d&apos;intervalles
	oDoc=ThisComponent
	oVCurs=oDoc.CurrentController.ViewCursor

	For I=4 To 43
		If Not((I&gt;10) and (I&lt;40) and (I mod 5 =1)) then
	If oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Peer.Text = &quot;&quot; Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(I)).Text = &quot;?&quot;
		EndIf
	Next I

	sMot = oTava.GetControl(&quot;TextField1&quot;).Peer.Text &amp;&quot;;&quot; &amp; oTava.GetControl(&quot;TextField9&quot;).Peer.Text &apos; ligne x

	If oTava.GetControl(&quot;CheckBox0&quot;).State = 1 Then sMot = sMot &amp;&quot;*&quot;
	For I = 1 To iNbreInter-1
		sMot = sMot &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;TextField&quot;&amp;cstr(I+3)).Peer.Text
		If oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).State = 1 Then sMot = sMot &amp;&quot;*&quot;
	Next I
	sMot = sMot &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;TextField&quot;&amp;cstr(iNbreInter*5+5)).Peer.Text
	If oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(iNbreInter)).State = 1 Then sMot = sMot &amp;&quot;*&quot;
	sMot = sMot &amp; &quot;;;&quot; 


	If bDerivee then
		sMot = sMot &amp; oTava.GetControl(&quot;TextField3&quot;).Peer.Text
	Else
		sMot = sMot &amp; oTava.GetControl(&quot;TextField2&quot;).Peer.Text
	End If

	Signval = oTava.GetControl(&quot;CommandButton9&quot;).Model.Label
	sMot = sMot &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;TextField12&quot;).Peer.Text &amp; &quot;;&quot; &amp; Signval &apos;y1 and first sign

 	sMot = sMot &amp; oTava.GetControl(&quot;CommandButton15&quot;).Model.Label &apos;sign of f&apos;&apos;

	For I = 1 To iNbreInter-1
		If oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(I)).State = 0 Then
			sMot = sMot &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;TextField&quot;&amp;cstr(I+38)).Peer.Text &apos;yi
		Else
			sMot = sMot &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;TextField&quot;&amp;cstr(I*5+8)).Peer.Text &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;TextField&quot;&amp;cstr(I*5+12)).Peer.Text
		End If
	 	sMot = sMot &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+9)).Model.Label &apos;signs of f&apos;
	 	sMot = sMot &amp; oTava.GetControl(&quot;CommandButton&quot;&amp;cstr(I+15)).Model.Label &apos;signs of f&apos;&apos;
	Next I  
	sMot = sMot &amp; &quot;;&quot; &amp; oTava.GetControl(&quot;TextField&quot;&amp;cstr(iNbreInter*5+8)).Peer.Text

	rem affiche la ligne de derivee
	If bDerivee Then
			sMot = sMot &amp; &quot;;;&quot; &amp; oTava.GetControl(&quot;TextField2&quot;).Peer.Text
			sMot = sMot &amp; &quot;;;&quot; &amp; oTava.GetControl(&quot;TextField2b&quot;).Peer.Text
	Else
	  sMot = sMot &amp; &quot;;;TS&quot;
	Endif

	oTava.EndExecute()	 		
	TableVar(oDoc, oVCurs, sMot)
End Sub


Sub Cancel_TaVa
	oTava.EndExecute()
End Sub


&apos;The following macro replaces all previous CheckIndexN macros (see below)
&apos;Gisbert Friege nov 2007
Sub CheckIndex_any(event)
	TF = event.source.model.name
&apos;	msgbox right(TF,1) &apos;last character only, must be changed if more than 9 checkboxes are needed
    iCheckIndex = CINT(right(TF,1))
    Call DoubleBarre
End Sub

Sub NextSign_any(event)
	ESM = event.source.model
&apos;XRay ESM	
	TFText = ESM.Label
	If TFText = &quot;0&quot; then
		ESM.Label = &quot;+&quot;
	ElseIf  TFText = &quot;+&quot; then
		ESM.Label = &quot;-&quot;
	ElseIf  TFText = &quot;-&quot; then
		ESM.Label = &quot;0&quot;
	End If		
End Sub	

rem met en mode valeur interdite
Sub DoubleBarre
Dim bEtat as Boolean
bEtat = (oTava.GetControl(&quot;CheckBox&quot;&amp;cstr(iCheckIndex)).State = 1)
oTava.GetControl(&quot;Label&quot;&amp;cstr(iCheckIndex*3+4)).Visible = bEtat
If  iCheckIndex &lt;&gt; 0 Then 
	If iCheckIndex&lt;&gt;6 and  iCheckIndex &lt;&gt; iNbreInter Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(iCheckIndex+38)).Visible = Not bEtat
	If  iCheckIndex &lt;&gt; iNbreInter  Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(iCheckIndex*5+8)).Visible =  bEtat
	If  iCheckIndex &lt;&gt; iNbreInter  Then oTava.GetControl(&quot;TextField&quot;&amp;cstr(iCheckIndex*5+12)).Visible = bEtat
Endif
End Sub


&apos; Jerome Ortais
&apos; Ces fonctions permettent la creation de tableau de variations a deux ou trois lignes ainsi que de tableaux de signes. 
&apos; Elles prennent en compte les equations starMath, les fonctions constantes, croissantes ou decroissantes
&apos;  sur un intervalle.
&apos; Merci a tous les contributeurs du forum http://www.oooforum.org sans qui je n&apos;y serais jamais parvenu.
&apos; Version 3.2

&apos; Jerome Ortais
&apos; Selectionne la zone a traiter.
Sub Main
Dim oDoc as Object, oVCurs as Object, sMot as String
	oDoc=ThisComponent
	oVCurs=oDoc.CurrentController.ViewCursor
	GlobalScope.BasicLibraries.loadLibrary(&quot;Dmaths&quot;)
	sMot=Dmaths.Module1.Selec
	TableVar(oDoc, oVCurs, sMot)
End Sub

&apos; Jerome Ortais
&apos; Cette fonction est la fonction principale. C&apos;est elle qui cree et remplit le tableau.
&apos; Gisbert Friege added the Derivee1/Derivee2-cases
Sub TableVar(oDoc as Object, oVcurs as Object, sMot as String)
Dim oText as Object, oWCurs as Object
Dim oTable as Object, oCell as Object, oCellCurs as Object, oLignes as Object, olaLigne as Object
Dim oBorderLine as Object
rem Dim oBorderLine as New com.sun.star.table.BorderLine
Dim oDispHelper as Object, oProvider as Object, iCptErreur as Integer
Dim iCpt as Integer, iNbLigne as Integer, iNbCol as Integer
Dim iDblPtVirg as Integer, iListPos1 as Integer, iListPos2 as Integer
Dim sString as String, memo_d1 as String ,memo_d2 as String
Dim bEstInterdit as Boolean, iNbInterdit as Integer

	bEstInterdit=False
	iNbInterdit=0
	iNbCol=0
	iDblPtVirg=InStr(sMot,&quot;;;&quot;)

&apos; write iDblPtVirg &apos;is always 6

	If InStr(iDblPtVirg+1,sMot,&quot;;;&quot;)&gt;0 Then
		iNbLigne=3
		If InStr(InStr(iDblPtVirg+1,sMot,&quot;;;&quot;)+1,sMot,&quot;;;&quot;)&gt;0 Then iNbLigne=4
	Else
		iNbLigne=2   &apos;does this ever happen??? GF june 2007
	EndIf

	iCpt=InStr(sMot,&quot;*;&quot;)
	While iCpt&lt;&gt;0 And iCpt&lt;iDblPtVirg
		iNbCol=iNbCol+1
		iCpt=InStr(iCpt+2,sMot,&quot;*;&quot;)
	WEnd
	iCpt=InStr(sMot,&quot;;&quot;)
	While iCpt&lt;&gt;0 And iCpt&lt;iDblPtVirg
		iNbCol=iNbCol+2
		iCpt=InStr(iCpt+2,sMot,&quot;;&quot;)
	WEnd
	If iNbLigne&lt;2 Or iNbCol&lt;4 Then
		Print &quot;Format de tableau invalide&quot;
		Exit Sub
	EndIf
	iListPos1=1
	iListPos2=InStr(iListPos1,sMot,&quot;;&quot;)
	oText=oDoc.Text	
	oTable=oDoc.createInstance(&quot;com.sun.star.text.TextTable&quot;)
	oTable.Split=False
	oTable.initialize(iNbLigne,iNbCol)
	
	If IsEmpty(oVCurs.TextTable) Then 
		oWCurs=oText.createTextCursorByRange(oVCurs)
		oText.insertTextContent(oWCurs,oTable,false)
	Else
		oWCurs=oVCurs.Cell.createTextCursor
		oVCurs.Cell.insertTextContent(oWCurs,oTable,false)
	EndIf
	
	&apos; Gere les bordures
	oBorderLine = createUnoStruct( &quot;com.sun.star.table.BorderLine&quot; )
	With oBorderLine
		.InnerLineWidth = 0
		.OuterLineWidth = 0
	End With
	For iCpt=2 To  iNbCol-1
		oCell=oTable.getCellRangeByPosition(iCpt,0,iCpt,iNbLigne-1)
		oCell.LeftBorder=oBorderLine
	Next
	&apos; Fixe la hauteur de la dernière ligne à 1,6cm pour que les points de flèches soient face aux nombres.
	oLignes=oTable.Rows
	olaLigne=oLignes(iNbLigne-1)
	With olaLigne
		.Height=1600
		.IsAutoHeight=False
	End With
	oTable.Rows(iNbLigne-1)=olaLigne
	
	&apos;Ecrit la premiere valeur dans le tableau
	EcritCellule(oTable,0,0,Mid(sMot,iListPos1,iListPos2-iListPos1),2)
	iListPos1=iListPos2+1
	iListPos2=InStr(iListPos1,sMot,&quot;;&quot;)
	
	iCpt=1
	iNbInterdit=0
	&apos; Cree et remplit la premiere ligne des autres colonnes du tableau
  	While iListPos2&lt;=iDblPtVirg
		If Mid(sMot,iListPos2-1,1)=&quot;*&quot; Then
			EcritCellule(oTable,iCpt,0,Mid(sMot,iListPos1,iListPos2-iListPos1-1),2)
			bEstInterdit=True
		Else
			EcritCellule(oTable,iCpt,0,Mid(sMot,iListPos1,iListPos2-iListPos1),2)
		EndIf
		If bEstInterdit Then 
			With oBorderline
				.OuterLineWidth=35.28
				.InnerLineWidth=35.28
				.LineDistance=35.28
			End With
			oTable.getCellRangeByPosition(iCpt+iNbInterdit,1,iCpt+iNbInterdit,iNbLigne-1).RightBorder=oBorderLine
			oCell=oTable.getCellByPosition(iCpt,0)
			oCellCurs=oTable.createCursorByCellName(oCell.CellName)
			oCellCurs.goRight(1,True)
			oCellCurs.mergeRange
			bEstInterdit=False
			iNbInterdit=iNbInterdit+1
		EndIf
		iListPos1=iListPos2+1
		iListPos2=InStr(iListPos1,sMot,&quot;;&quot;)
		iCpt=iCpt+2

	Wend
		
	iDblPtVirg=InStr(iDblPtVirg+1,sMot,&quot;;;&quot;) &apos;Ende 1.Zeile
	iListPos1=iListPos2+1
	iListPos2=InStr(iListPos1,sMot,&quot;;&quot;)

&apos;msgbox sMot &amp; &quot;   Dbl=&quot; &amp; iDblPtVirg &amp; &quot;   LP1=&quot; &amp; iListPos1 &amp; &quot;   LP2=&quot; &amp; iListPos2 

	&apos; On remplit la ligne 2 (pas de ligne 3) &apos;this case cannot happen! GF
	If iNbLigne=2 Then
		msgbox &quot;doch Zeile 2!&quot;
	Else
	&apos; On remplit les lignes 2 et 3 et 4
		If Mid(sMot,iDblPtVirg+2)=&quot;TS&quot; Then
			EcritCellule(oTable,0,1,Mid(sMot,iListPos1,iListPos2-iListPos1),2)
		Else
			&apos;write f&apos;(x)
			EcritCellule(oTable,0,1,Mid(sMot,iDblPtVirg+2,Instr(iDblPtVirg+2,sMot,&quot;;;&quot;)-(iDblPtVirg+2)),2) 
			&apos;write f&apos;&apos;(x) and f(x)
			If iNbLigne=4 Then
				EcritCellule(oTable,0,2,Mid(sMot,Instr(iDblPtVirg+2,sMot,&quot;;;&quot;)+2),2) 
				EcritCellule(oTable,0,3,Mid(sMot,iListPos1,iListPos2-iListPos1),2)
			Else &apos;iNbLigne=3
				EcritCellule(oTable,0,2,Mid(sMot,iListPos1,iListPos2-iListPos1),2)
			End If 
		EndIf
		
		&apos; now the data
		iListPos1=iListPos2+1
		iListPos2=InStr(iListPos1,sMot,&quot;;&quot;)

&apos;msgbox sMot &amp; &quot;   Dbl=&quot; &amp; iDblPtVirg &amp; &quot;   LP1=&quot; &amp; iListPos1 &amp; &quot;   LP2=&quot; &amp; iListPos2 
		
		&apos;Gere le cas ou la premiere valeur est interdite
		If Mid(sMot,InStr(InStr(sMot,&quot;;&quot;)+1,sMot,&quot;;&quot;)-1,1)=&quot;*&quot; Then
			iCpt=2
		Else
			iCpt=1
		EndIf
		While iListPos2&lt;=iDblPtVirg
			sString=Mid(sMot,iListPos1,iListPos2-iListPos1) &apos;piece of text from iListPos1 to ;
			oCell=oTable.getCellByPosition(iCpt,2)
			If iNbLigne=4 Then oCell=oTable.getCellByPosition(iCpt,3)
	
			If sString=&quot;+ &quot; or sString=&quot;+0&quot; or sString=&quot;++&quot; or sString=&quot;+-&quot; or sString=&quot; +&quot; or sString=&quot; -&quot;  or sString=&quot;0+&quot; or sString=&quot;0-&quot; Then
				EcritCellule(oTable,iCpt,1,Mid(sString,1,1),2)
				EcritCellule(oTable,iCpt,2,Mid(sString,2,1),2)
				If (bDerivee1 and not bDerivee2) or (sString=&quot;+ &quot;) or (sString=&quot;+0&quot;) Then				
						If (mid(sString,1,1)=&quot;+&quot;) Then	
							Fleche(oCell,40,2) &apos;straight arrow up
						ElseIf (mid(sString,1,1)=&quot;0&quot;) or (mid(sString,1,1)=&quot; &quot;) Then 
							Fleche(oCell,0,oTable.getCellByPosition(iCpt-1,3).getPropertyValue(&quot;VertOrient&quot;)) &apos;gerader Pfeil horiz. 
						EndIf
				ElseIf (bDerivee2 and not bDerivee1) Then 
						If (mid(sString,2,1)=&quot;+&quot;) or (mid(sString,2,1)=&quot;-&quot;) Then 
							ArcFleche(oCell,sString,2)
						&apos;Else empty 
						EndIf	
				Else ArcFleche(oCell,sString,2)
				EndIf
				oBorderLine=oTable.getCellRangeByPosition(iCpt-2,1,iCpt-2,2).RightBorder

				&apos; check for change of sign, if yes insert 0
				If oBorderLine.LineDistance&lt;35 And iCpt&gt;2 Then 
					If (memo_d1&lt;&gt;&quot; &quot;) and (mid(sString,1,1)&lt;&gt;memo_d1) Then EcritCellule(oTable,iCpt-1,1,0,2)
					If (memo_d2&lt;&gt;&quot; &quot;) and (mid(sString,2,1)&lt;&gt;memo_d2) Then EcritCellule(oTable,iCpt-1,2,0,2)
				EndIf
				memo_d1=mid(sString,1,1)
				memo_d2=mid(sString,2,1)

			ElseIf sString=&quot;- &quot; or sString=&quot;-0&quot; or sString=&quot;-+&quot; or sString=&quot;--&quot; Then
				EcritCellule(oTable,iCpt,1,Mid(sString,1,1),2)
				EcritCellule(oTable,iCpt,2,Mid(sString,2,1),2)
				If (bDerivee1 and not bDerivee2) or  (sString=&quot;- &quot;) or (sString=&quot;-0&quot;)   Then
						If (mid(sString,1,1)=&quot;-&quot;) Then	
							Fleche(oCell,-40,2) &apos;gerader Pfeil down
						EndIf
				ElseIf (bDerivee2 and not bDerivee1) Then 
						If (mid(sString,2,1)=&quot;+&quot;) or (mid(sString,2,1)=&quot;-&quot;) Then 
							ArcFleche(oCell,sString,2)
						&apos;Else empty 
						EndIf	
				Else ArcFleche(oCell,sString,2)
				EndIf
				oBorderLine=oTable.getCellRangeByPosition(iCpt-2,1,iCpt-2,2).RightBorder

				&apos; check for change of sign, if yes write 0
				If oBorderLine.LineDistance&lt;35 And iCpt&gt;2 Then
					If (memo_d1&lt;&gt;&quot; &quot;) and (mid(sString,1,1)&lt;&gt;memo_d1) Then EcritCellule(oTable,iCpt-1,1,0,2)
					If (memo_d2&lt;&gt;&quot; &quot;) and mid(sString,2,1)&lt;&gt;memo_d2 Then EcritCellule(oTable,iCpt-1,2,0,2)
				EndIf
				memo_d1=mid(sString,1,1)
				memo_d2=mid(sString,2,1)

			ElseIf (sString=&quot;0 &quot;) or (sString=&quot;00&quot;) Then
				EcritCellule(oTable,iCpt,1,Mid(sString,1,1),2)
				EcritCellule(oTable,iCpt,2,Mid(sString,2,1),2)
				If bDerivee1 or bDerivee2 Then Fleche(oCell,0,oTable.getCellByPosition(iCpt-1,3).getPropertyValue(&quot;VertOrient&quot;))
				oBorderLine=oTable.getCellRangeByPosition(iCpt-2,1,iCpt-2,2).RightBorder
				memo_d1=mid(sString,1,1)
				memo_d2=mid(sString,2,1)

			Else &apos; yi to line 3 or 4
				If iNbLigne=4 Then
					EcritCellule(oTable,iCpt,3,sString,AlignementVertical(oTable,iCpt,3,sMot,iListPos1,iListPos2))
				Else
					EcritCellule(oTable,iCpt,2,sString,AlignementVertical(oTable,iCpt,2,sMot,iListPos1,iListPos2))
				EndIf
			EndIf
			iListPos1=iListPos2+1
			iListPos2=InStr(iListPos1,sMot,&quot;;&quot;)
			iCpt=iCpt+1
		Wend
	EndIf	

	If bSignesF Then 
		oTable.Rows.removeByIndex(2,1) 
	ElseIf (not bSignesD) Then 
			oTable.Rows.removeByIndex(1,1)
			If bDerivee1 or bDerivee2 Then oTable.Rows.removeByIndex(1,1)
	ElseIf (not bDerivee2) Then
			oTable.Rows.removeByIndex(2,1)
	ElseIf (not bDerivee1) Then
			oTable.Rows.removeByIndex(1,1)
	EndIf

	&apos; Adapte la largeur des colonnes au contenu du tableau
	oDoc.getCurrentController().select(oTable)
	oVCurs=oDoc.getCurrentController().getViewCursor()
	oVCurs.gotoEnd(True)
	oVCurs.gotoEnd(True)
	oProvider = oDoc.CurrentController.Frame
	oDispHelper = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
	&apos; Gere le probleme du executeDispatch qui se fait parfois trop rapidement
	On Error GoTo TraiteErreur
	DIM Array(0) as new com.sun.star.beans.PropertyValue 
	oDispHelper.executeDispatch(oProvider, &quot;.uno:SetOptimalColumnWidth&quot;, &quot;&quot;, 0, Array())
	oDispHelper.executeDispatch(oProvider, &quot;.uno:Escape&quot;, &quot;&quot;, 0, Array())
	DIM args1(1) as new com.sun.star.beans.PropertyValue
	args1(0).Name = &quot;Count&quot;
	args1(0).Value = 1
	args1(1).Name = &quot;Select&quot;
	args1(1).Value = false
	oDispHelper.executeDispatch(oProvider, &quot;.uno:GoRight&quot;, &quot;&quot;, 0, args1())
	Exit Sub
	TraiteErreur:
	If err=1 Then 
		wait 50
		iCptErreur=iCptErreur+50
		If iCptErreur&lt;2500 Then
			Resume
		Else
			On Error GoTo 0
		EndIf
	Else On Error GoTo 0
	EndIf
End Sub

&apos; Jerome Ortais
&apos; Cette fonction ecrit sMot dans une cellule de coordonnes iCol et iLig d&apos;un tableau oTable.
Sub EcritCellule(oTable as Object, iCol as Integer, iLig as Integer, sMot as String, iVertAlign as Integer)
Dim oCell as Object, oCurseur as Object, iCptErreur as Integer
Dim oProvider as Object, oDispHelper as Object
	oCell=oTable.getCellByPosition(iCol,iLig)
	&apos; Centre horizontalement et ajuste l&apos;alignement vertical des donnees de la cellule du tableau
	oCell.setPropertyValue(&quot;VertOrient&quot;,iVertAlign)
	oCell.getText().createTextCursor().ParaAdjust=com.sun.star.style.ParagraphAdjust.CENTER
&apos;	If iCol&gt;0 Then Print &quot;Alignement précédent : &quot; &amp; oTable.getCellByPosition(iCol-1,iLig).getPropertyValue(&quot;VertOrient&quot;)
	oCurseur=oCell.createTextCursor
	rem met en fonte normale la premiere ligne
	If iLig = 0 Then
	oCurseur.CharWeight = com.sun.star.awt.FontWeight.NORMAL
	If iCol &gt; 0 Then oCurseur.CharPosture = com.sun.star.awt.FontSlant.NONE
	Endif
	If iCol = 0 Then oCurseur.CharPosture = com.sun.star.awt.FontSlant.ITALIC
	
	If Mid(sMot,1,1)=&quot;$&quot; Then
		iCptErreur=0
		oCell.String=Dmaths.Module2.Dixio(Mid(sMot,2,Len(sMot)-2))
		oCurseur.gotoStart(False)
		oCurseur.gotoEnd(True)
		ThisComponent.getcurrentcontroller().select(oCurseur)
		oProvider = ThisComponent.CurrentController.Frame
		oDispHelper = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
		&apos; Gere le probleme du executeDispatch qui se fait parfois trop rapidement
		On Error GoTo TraiteErreur
		dim Array(0) as new com.sun.star.beans.PropertyValue 
		oDispHelper.executeDispatch(oProvider, &quot;.uno:InsertObjectStarMath&quot;, &quot;&quot;, 0, Array())
		Exit Sub
		
		TraiteErreur:
		If err=1 Then 
			wait 50
			iCptErreur=iCptErreur+50
			If iCptErreur&lt;2500 Then
				Resume
			Else
				On Error GoTo 0
			EndIf
		Else On Error GoTo 0
		EndIf
 	Else
 		sMot = Dixio5(sMot) rem ajouté par Didier Dorange-Pattoret
		oCell.String=sMot
	EndIf
End Sub

&apos; Jerome Ortais
&apos; Cette fonction aligne verticalement la cellule de oTable de coordonnees iCol et iLigne en fonction des +, - ou 0
&apos; trouves dans sMot
&apos; Gisbert Friege: adaption to signs for the second derivative
Sub AlignementVertical(oTable as Object, iCol as Integer, iLigne as Integer, sMot as String,_
					 iListPos1 as Integer, iListPos2 as Integer) as Integer
Dim iAlignementVertical as Integer, iPosPlus as Integer, iPosMoins as Integer, iPosMoins2 as Integer, iFin as Integer
Dim signbefore as String, signafter as String

	If iListPos2=0 Then
	&apos;shoul not happen ???
		msgbox &quot;why did iListPos=0 happen?&quot;
		iFin=1
	Else iFin=iListPos2 &apos;position of &quot;;&quot;
	EndIf


	signbefore=Mid(sMot,iListPos1-3,1) &apos;nonsense for first value
	signafter=Mid(sMot,iFin+1,1)       &apos;nonsense for last value
&apos; msgbox signbefore &amp; &quot;  &quot; &amp; signafter
&apos; example:   123;+0;8901;-0;678    iLIstPos1=8 iLIstPos2=12 signafter=- signbefore=+

	Select Case signafter 
	Case &quot;+&quot;
			Select Case signbefore 
			Case &quot;+&quot;
				iAlignementVertical=2
			Case &quot;0&quot;
				If iCol&gt;3 Then 	iAlignementVertical=oTable.getCellByPosition(iCol-2,iLigne).getPropertyValue(&quot;VertOrient&quot;)				
			Case Else	
			&apos; Align Bottom
			iAlignementVertical=3
			End Select
	Case &quot;-&quot;
			Select Case signbefore 
			Case &quot;-&quot;
				iAlignementVertical=2
			Case &quot;0&quot;
				If iCol&gt;3 Then 	iAlignementVertical=oTable.getCellByPosition(iCol-2,iLigne).getPropertyValue(&quot;VertOrient&quot;)				
			Case Else	
			&apos; Align Top
			iAlignementVertical=1
			End Select

	Case Else &apos; signafter is 0 or undefind for last value
		Select Case signbefore
		Case &quot;+&quot;
			&apos; Align Top
			iAlignementVertical=1&apos;2
		Case &quot;-&quot;
			&apos; Align Bottom
			iAlignementVertical=3&apos;2
		Case Else
			&apos; Meme alignement vertical
			If iCol&gt;3 Then 
				iAlignementVertical=oTable.getCellByPosition(iCol-2,iLigne).getPropertyValue(&quot;VertOrient&quot;)
			Else
				iAlignementVertical=2
			End If
&apos; following lines just for reference to the original treatment 
&apos;		Case Else
&apos;			iPosPlus=InStr(iListPos2,sMot,&quot;;+;&quot;)
&apos;			iPosMoins=InStr(iListPos2,sMot,&quot;;-;&quot;)
&apos;			iPosMoins2=InStr(iListPos2,sMot,&quot;;–;&quot;)
&apos;			If iPosPlus=0 And iPosMoins=0 And iPosMoins2=0 Then
&apos;				&apos; La fonction est une fonction constante
&apos;				iAlignementVertical=2
&apos;			ElseIf iPosPlus&lt;&gt;0 And (iPosPlus&lt;iPosMoins Or iPosMoins=0) And (iPosPlus&lt;iPosMoins2 Or iPosMoins2=0) Then
&apos;				&apos; La fonction sera croissante sut le prochain interval non constant
&apos;				iAlignementVertical=3
&apos;			Else
&apos;				iAlignementVertical=1
&apos;			EndIf
		End Select
	End Select
	AlignementVertical=iAlignementVertical
End Sub


&apos; Jerome Ortais
&apos; Cette fonction dessine puis insere une fleche dans une cellule oCell ayant un angle de iAngle degres.
Sub Fleche(oCell as Object, iAngle as Integer, iVertAlign as Integer)
Dim oText as Object, oCursor as Object
Dim oFleche as Object
Dim lesPoints(4) As New com.sun.star.awt.Point
	&apos; Centre horizontalement et verticalement les donnees de la cellules du tableau
	oCell.setPropertyValue(&quot;VertOrient&quot;, iVertAlign)
	oCell.getText().createTextCursor().ParaAdjust=com.sun.star.style.ParagraphAdjust.CENTER

	oFleche=ThisComponent.CreateInstance(&quot;com.sun.star.drawing.PolyPolygonShape&quot;)

	lesPoints(0).X=0
	lesPoints(0).Y=0
	lesPoints(1).X=750
	lesPoints(1).Y=0
	lesPoints(2).X=600
	lesPoints(2).Y=50
	lesPoints(3).X=600
	lesPoints(3).Y=-50
	lesPoints(4).X=750
	lesPoints(4).Y=0

	oText = oCell.getText()
	oCursor = oText.createTextCursor()
	oText.insertTextContent(oCursor,oFleche,False)
	oFleche.PolyPolygon=Array(lesPoints())
	oFleche.RotateAngle=iAngle*100
	oFleche.FillColor=RGB(0,0,0)
	oFleche.AnchorType=com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH
	oFleche.AnchorType=com.sun.star.text.TextContentAnchorType.AS_CHARACTER
	If iAngle=0 Then
		&apos; Decale les fleches horizontales pour qu&apos;elles soient face aux nombres
		Dim oPoint as New com.sun.star.awt.Point
		oPoint.x=0
		Select Case iVertAlign
		Case 1
			oPoint.y=150
			oFleche.Position=oPoint
		Case 3
			oPoint.y=-300
			oFleche.Position=oPoint
		End Select
	EndIf
End Sub

&apos; Gisbert Friege
&apos; Cette fonction dessine puis insere une groupe arc et fleche dans une cellule oCell.
Sub ArcFleche(oCell as Object, afType as String, iVertAlign as Integer)
Dim oText as Object, oCursor as Object
Dim oArc as Object
Dim oFleche as Object
Dim aSize As New com.sun.star.awt.Size
Dim aPoint As New com.sun.star.awt.Point
Dim oGruppe As Object

&apos; +left, -right, ++leftup, +-leftdown, -+rightup, --rightdown
	oDrawPage = ThisComponent.GetDrawPage()
	oShapesToGroup = createUnoService( &quot;com.sun.star.drawing.ShapeCollection&quot; )

	&apos; Centre horizontalement et verticalement les donnees de la cellules du tableau
	oCell.setPropertyValue(&quot;VertOrient&quot;, iVertAlign)
	oCell.getText().createTextCursor().ParaAdjust=com.sun.star.style.ParagraphAdjust.CENTER

	oArc=ThisComponent.CreateInstance(&quot;com.sun.star.drawing.EllipseShape&quot;)

	oText = oCell.getText()
	oCursor = oText.createTextCursor()
	oText.insertTextContent(oCursor,oArc,False)
	
	oArc.FillStyle = com.sun.star.drawing.FillStyle.NONE
	oArc.CircleKind = com.sun.star.drawing.CircleKind.ARC

	If (afType=&quot;0+&quot;) or (afType=&quot;0-&quot;) or (afType=&quot; +&quot;) or (afType=&quot; -&quot;)Then
		aSize.width = 750
		aSize.height = 750
	ElseIf (afType=&quot;++&quot;) or (afType=&quot;--&quot;) Then
		aSize.width = 1500
		aSize.height = 1050
	Else			&apos; (afType=&quot;+-&quot;) or (afType=&quot;-+&quot;)
		aSize.width = 2000
		aSize.height = 1150
	EndIf
	oArc.Size = aSize
&apos;	oArc.LineWidth = 50
	oArc.FillColor=RGB(255,255,255)
	oArc.AnchorType=com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH

	Select Case afType 		
	Case &quot;0+&quot;,&quot; +&quot;
		oArc.CircleStartAngle = 17000 &apos;nCircleStartAngle
		oArc.CircleEndAngle = 1000 &apos;nCircleEndAngle
		aPoint.x = 0 &apos;x
		aPoint.y = 250 &apos;y
	Case &quot;0-&quot;,&quot; -&quot;
		oArc.CircleStartAngle = 35000
		oArc.CircleEndAngle = 19000
		aPoint.x = 0 &apos;x
		aPoint.y = 100 &apos;y
	Case &quot;++&quot;
		oArc.CircleStartAngle = 27000
		oArc.CircleEndAngle = 34000
		aPoint.x = 0 &apos;x
		aPoint.y = 250 &apos;y
	Case &quot;+-&quot;
		oArc.CircleStartAngle = 11500
		oArc.CircleEndAngle = 17000
		aPoint.x = 0 &apos;x
		aPoint.y = 250 &apos;y
	Case &quot;--&quot;
		oArc.CircleStartAngle = 2000
		oArc.CircleEndAngle = 9000
		aPoint.x = 0 &apos;x
		aPoint.y = 250 &apos;y
	Case &quot;-+&quot;
		oArc.CircleStartAngle = 19000
		oArc.CircleEndAngle = 24500
		aPoint.x = 0 &apos;x
		aPoint.y = 250 &apos;y
	End Select

	oArc.Position = aPoint

	&apos; Arrowhead
	oFleche=ThisComponent.CreateInstance(&quot;com.sun.star.drawing.PolyPolygonShape&quot;)
Dim lesPoints(2) As New com.sun.star.awt.Point
	lesPoints(0).X=0
	lesPoints(0).Y=0
	lesPoints(1).X=50
	lesPoints(1).Y=-150
	lesPoints(2).X=100
	lesPoints(2).Y=0

	oText.insertTextContent(oCursor,oFleche,False)
	oFleche.PolyPolygon=Array(lesPoints())
	oFleche.FillColor=RGB(0,0,0)
	oFleche.AnchorType=com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH

	Select Case afType 		
	Case &quot;0+&quot;, &quot; +&quot;
		oFleche.RotateAngle= 1000
		aPoint.x=650
		aPoint.y=0
	Case &quot;0-&quot;,&quot; -&quot;
		oFleche.RotateAngle= 17000
		aPoint.x=650
		aPoint.y=500
	Case &quot;++&quot;
		oFleche.RotateAngle= 33500
		aPoint.x=630 &apos;650
		aPoint.y=0
	Case &quot;+-&quot;
		oFleche.RotateAngle= 28500
		aPoint.x=530
		aPoint.y=160
	Case &quot;--&quot;
		oFleche.RotateAngle= 20500
		aPoint.x=600
		aPoint.y=500
	Case &quot;-+&quot;
		oFleche.RotateAngle= 25500
		aPoint.x=530
		aPoint.y=560
	End Select

	oFleche.Position = aPoint
&apos;	oFleche.LineWidth = 50

	oShapesToGroup.Add( oFleche )
	oShapesToGroup.Add( oArc )
	oGroupe = oDrawPage.Group( oShapesToGroup )
 	oGroupe.AnchorType=com.sun.star.text.TextContentAnchorType.AS_CHARACTER
	oGroupe.RotateAngle=0 
End Sub



</script:module>