This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/DmInstall/Options.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
<?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="Options" script:language="StarBasic">&apos;************************************************
&apos;Copyright (C) 2006-2010 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 oLanguesSelect as Object
Public oDmOptions as Object
Private oAddonBarre, oAddon, oConfigAccess, oConfigAccessToolBarre,oDmBarre  as Object
Public oCopyDmaths as Object
Public sNomFichierInstall as String
Public bIconesChangees, bAfficherMasquerIcones as Boolean
Public sSource as String


Sub ChoixOptionsDmaths	
	BasicLibraries.loadLibrary(&quot;Dmaths&quot;)
	Call VerifOperationnel
	bIconesChangees = False
	bAfficherMasquerIcones = False
	If bFigure=True Then oFigure.Visible=False
	If bGrille=True or bDiagBox=True or bRepreGra=True Then oPoints.Visible=False

	
	oDmOptions = Dmaths.Module5.LoadDialog(&quot;DmInstall&quot;,&quot;DmOptions&quot;)
 
&apos;	If GetguiType &lt;&gt; 4 or Not FileExists(&quot;/Users&quot;) Then
		DmInstall.Install_Addon.LoadAppsPref(oDmOptions,False,True,sThemeIcons) rem bPremInstall=False bRegleOptions = True
&apos;	Endif
	If bPremInstall Then Call ReinitialiseOptions
	exitOK = com.sun.star.ui.dialogs.ExecutableDialogResults.OK
	exitCANCEL = com.sun.star.ui.dialogs.ExecutableDialogResults.CANCEL
	If oDmOptions.Execute = exitOK Then ValidOptionsDmaths
&apos;	elseif  oDmOptions.Execute = exitCANCEL Then
&apos;		AfficherMasquerIcones
&apos;	Endif
End Sub

Sub ReinitialiseOptions
	oDmOptions.Model.CheckBox1.State=1
	oDmOptions.Model.CheckBox2.State=1
	oDmOptions.Model.CheckBox3.State=1
	oDmOptions.Model.CheckBox4.State=1
	oDmOptions.Model.CheckBox5.State=1
	oDmOptions.Model.CheckBox16.State=1
	oDmOptions.Model.CheckBox6.State=1
	oDmOptions.Model.CheckBox7.State=1
	oDmOptions.Model.CheckBox7.State=1
	oDmOptions.Model.CheckBox8.State=0 
	oDmOptions.Model.CheckBox9.State=0
	oDmOptions.Model.CheckBox10.State=0 
	oDmOptions.Model.CheckBox11.State=0
	oDmOptions.Model.CheckBox12.State=1
	oDmOptions.GetControl(&quot;TextField1&quot;).Enable = False
	oDmOptions.Model.CheckBox13.State=0
	oDmOptions.Model.CheckBox14.State=0
	oDmOptions.Model.CheckBox15.State=1
	oDmOptions.Model.CheckBox17.State=0
	oDmOptions.Model.CheckBox18.State=0
	oDmOptions.Model.CheckBox19.State=1
	If OOoNumVersion &lt; 300 Then   rem modifie le 15-11-08
		oDmOptions.Model.CheckBox20.State = 1
	Else
		oDmOptions.Model.CheckBox20.State = 0
	Endif
	oDmOptions.Model.CheckBox21.State=1
	oDmOptions.Model.CheckBox22.State=1
	If iLang = 0 Then 
		oDmOptions.Model.CheckBox23.State=0
	Else
		oDmOptions.Model.CheckBox23.State=1
	Endif
	oDmOptions.Model.OptionButton1.State=1
	oDmOptions.Model.TextField6.Text=&quot;0&quot;
	oDmOptions.Model.TextField4.Text=&quot;0&quot;
	oDmOptions.Model.TextField2.Text=&quot;40&quot;
	oDmOptions.Model.TextField3.Text=&quot;0&quot;
	oDmOptions.Model.TextField1.Text=&quot;12&quot;
	If (GetguiType = 4 and FileExists(&quot;/Users&quot;)) Then 
		oDmOptions.Model.TextField5.Text = &quot;Apple Chancery&quot;
	Else
		oDmOptions.Model.TextField5.Text = &quot;Atalante&quot;
	Endif
	oDmOptions.GetControl(&quot;TextField7&quot;).Enable = True
	oDmOptions.Model.TextField7.Text = &quot;abcdexyzt&quot;
End Sub

Sub ReinitialiseCheminsApps
	rem recherche des logiciels installes
	BasicLibraries.loadLibrary(&quot;DmInstall&quot;)
	sThemeIconesChoisi = DmInstall.Install_Addon.DeterminesThemeIcons(oDmOptions)
	bIconesChangees = True
	DmInstall.Install_Addon.LoadAppsPref(oDmOptions,True,True,sThemeIconesChoisi)	
End Sub



Sub FinChoixOptionsDmaths
	oDmOptions.EndExecute()
	If bFigure=True Then oFigure.Visible=True
	If bGrille=True or bDiagBox=True or bRepreGra=True Then oPoints.Visible=True
End Sub

Sub ValidOptionsDmaths
&apos;	Print &quot;change les options&quot;
	Dim sMatricesRondes as String
	Dim sWidevec,sWidehat,sOverline,sItalic,sTailleFormules,sMarqHorPoints,sMarqVerPoints,sFormulesGras,sMessage as String
	Dim sLettresAreScalaires, sLettresScalaires as String
	Dim sPoliceFormCarac, sMargesFormules, sConcateneFormules, sThemeIconesChoisi as String
	Dim sIdroit, sEdroit, sFractions, sModeFactoriel, sbXpointaulieux, sDelaiEntreSauvegardes as String
	Dim sTextMode, sBorneInfIntegrales, sBorneSupIntegrales,sFormulesEspacees, sTailleFormCarac, sNomPoliceCursive as String
	Dim sFormulesEncadrees, sGrandesParentheses, sUsingDispatcher as String 
	Dim sCheminSoftware1,sCheminSoftware2,sCheminSoftware3 as String
	Dim iLangChoisie as Integer
	If oDmOptions.Model.CheckBox1.State=1 Then sItalic = &quot;TRUE&quot; Else sItalic = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox2.State=1 Then sWidevec = &quot;TRUE&quot; Else sWidevec = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox3.State=1 Then sWidehat = &quot;TRUE&quot; Else sWidehat = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox4.State=1 Then sOverline = &quot;TRUE&quot; Else sOverline = &quot;FALSE&quot;	
	If oDmOptions.Model.CheckBox5.State=1 Then sEdroit = &quot;TRUE&quot; Else sEdroit = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox16.State=1 Then sIdroit = &quot;TRUE&quot; Else sIdroit = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox6.State=1 Then sChiffresDroits = &quot;TRUE&quot; Else sChiffresDroits = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox7.State=1 Then sBorneInfIntegrales = &quot;from&quot; Else sBorneInfIntegrales = &quot;_&quot;
	If oDmOptions.Model.CheckBox7.State=1 Then sBorneSupIntegrales = &quot;to&quot; Else sBorneSupIntegrales = &quot;^&quot;
	If oDmOptions.Model.CheckBox8.State=1 Then sTextMode = &quot;TRUE&quot; Else sTextMode = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox9.State=1 Then sCoordColonne = &quot;TRUE&quot; Else sCoordColonne = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox10.State=1 Then sFormulesGras = &quot;TRUE&quot; Else sFormulesGras = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox11.State=1 Then sSystemesAlignes = &quot;TRUE&quot; Else sSystemesAlignes = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox12.State=1 Then sTailleFormCarac = &quot;TRUE&quot; Else sTailleFormCarac = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox13.State=1 Then sFormulesEspacees = &quot;TRUE&quot; Else sFormulesEspacees = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox14.State=1 Then sFormulesEncadrees = &quot;TRUE&quot; Else sFormulesEncadrees = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox15.State=1 Then sGrandesParentheses = &quot;TRUE&quot; Else sGrandesParentheses = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox17.State=1 Then sFractions = &quot;TRUE&quot; Else sFractions = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox18.State=1 Then sModeFactoriel = &quot;TRUE&quot; Else sModeFactoriel = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox19.State=1 Then sPoliceFormCarac = &quot;TRUE&quot; Else sPoliceFormCarac = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox20.State=1 Then sUsingDispatcher = &quot;TRUE&quot; Else sUsingDispatcher = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox21.State=1 Then sConcateneFormules = &quot;TRUE&quot; Else sConcateneFormules = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox22.State=1 Then sLettresAreScalaires = &quot;TRUE&quot; Else sLettresAreScalaires = &quot;FALSE&quot;
	If oDmOptions.Model.CheckBox23.State=1 Then sbXpointaulieux = &quot;TRUE&quot; Else sbXpointaulieux = &quot;FALSE&quot;
	If oDmOptions.Model.MatriceButton1.State=1 Then sMatricesRondes = &quot;TRUE&quot; Else sMatricesRondes = &quot;FALSE&quot;
	sThemeIconesChoisi = DmInstall.Install_Addon.DeterminesThemeIcons(oDmOptions) 


	rem choix du theme des icones si modification demandée
	If sThemeIconesChoisi &lt;&gt; sThemeIcons Then bIconesChangees = True
	&apos;-------------------------------------------------------------------------------------
	
	sTailleFormules=oDmOptions.Model.TextField1.Text
	sMarqHorPoints=oDmOptions.Model.TextField2.Text
	sMarqVerPoints=oDmOptions.Model.TextField3.Text
	sDelaiEntreSauvegardes = oDmOptions.Model.TextField4.Text
	sNomPoliceCursive = oDmOptions.Model.TextField5.Text
	sMargesFormules = oDmOptions.Model.TextField6.Text
	sLettresScalaires = oDmOptions.Model.TextField7.Text
	sCheminSoftware1 = oDmOptions.Model.FileControl2.Text
	sCheminSoftware2 = oDmOptions.Model.FileControl3.Text
	sCheminSoftware3 = oDmOptions.Model.FileControl4.Text

	If GetguiType = 4 Then 
	sCheminSoftware1 = RegleAppsSousLinux(sCheminSoftware1)
	sCheminSoftware2 = RegleAppsSousLinux(sCheminSoftware2)
	sCheminSoftware3 = RegleAppsSousLinux(sCheminSoftware3)
	Endif
	
	rem valeur langue choisie
	iLangChoisie = oDmOptions.GetControl(&quot;ListBox1&quot;).SelectedItemPos

	sSource=&quot;Rem (C) Didier Dorange-Pattoret www.dmaths.org&quot;+Chr(13)
	
	sSource=sSource+&quot;Global const iLang = &quot;+iLangChoisie+Chr(13)
	
	sSource=sSource+&quot;Public const iNumVersionDmathsCourante = &quot;+ iNumVersionDmaths + &quot;&quot; + Chr(13)
	sSource=sSource+&quot;Public const sChemindmaths = &quot;&quot;&quot; + DetermineRepertoireDmaths + &quot;&quot;&quot;&quot;+ Chr(13)
	sSource=sSource+&quot;Public const sChemindmathsODS = &quot;&quot;&quot; + fCheminduFichierDmathsODS + &quot;&quot;&quot;&quot; + Chr(13) rem sChemindmathsODS est le fichier dmaths.ods
	
	sSource=sSource+&quot;Public const bItalic = &quot;+sItalic+Chr(13)
	sSource=sSource+&quot;Public const bEdroit = &quot;+sEdroit+Chr(13)
	sSource=sSource+&quot;Public const bIdroit = &quot;+sIdroit+Chr(13)
	sSource=sSource+&quot;Public const bChiffresDroits = &quot;+sChiffresDroits+Chr(13)
	sSource=sSource+&quot;Public const bVecteursItalic = &quot;+sWidevec+Chr(13)
	sSource=sSource+&quot;Public const bAnglesItalic = &quot;+sWidehat+Chr(13)
	sSource=sSource+&quot;Public const bMesuresAlgItalic = &quot;+sOverline+Chr(13)
	sSource=sSource+&quot;Public const bLettresAreScalaires = &quot;+sLettresAreScalaires+Chr(13)		
	sSource=sSource+&quot;Public const sLettresScalaires = &quot;&quot;&quot;+sLettresScalaires+&quot;&quot;&quot;&quot;+Chr(13)	
	sSource=sSource+&quot;Public const bFormulesGras = &quot;+sFormulesGras+Chr(13)
	sSource=sSource+&quot;Public const iTailleFormules = &quot;+sTailleFormules+Chr(13)
	sSource=sSource+&quot;Public const bTailleFormCarac = &quot;+sTailleFormCarac+Chr(13)
	sSource=sSource+&quot;Public const bPoliceFormCarac = &quot;+sPoliceFormCarac+Chr(13)
	sSource=sSource+&quot;Public const iMargesFormules = &quot;+sMargesFormules+Chr(13)
	sSource=sSource+&quot;Public const bConcateneFormules = &quot;+sConcateneFormules+Chr(13)	
	sSource=sSource+&quot;Public const iMarqHorPoints = &quot;+sMarqHorPoints+Chr(13)
	sSource=sSource+&quot;Public const iMarqVerPoints = &quot;+sMarqVerPoints+Chr(13)
	sSource=sSource+&quot;Public const sBorneInfIntegrales = &quot;&quot;&quot;+sBorneInfIntegrales+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Public const sBorneSupIntegrales = &quot;&quot;&quot;+sBorneSupIntegrales+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Public const bTextMode = &quot;+sTextMode+Chr(13)
	sSource=sSource+&quot;Public const bCoordColonne = &quot;+sCoordColonne+Chr(13)
	sSource=sSource+&quot;Public const bSystemesAlignes = &quot;+sSystemesAlignes+Chr(13)
	sSource=sSource+&quot;Public const bMatricesRondes = &quot;+sMatricesRondes+Chr(13)
	sSource=sSource+&quot;Public const bFormulesEspacees = &quot;+sFormulesEspacees+Chr(13)
	sSource=sSource+&quot;Public const bFormulesEncadrees = &quot;+sFormulesEncadrees+Chr(13)
	sSource=sSource+&quot;Public const bGrandesParentheses = &quot;+sGrandesParentheses+Chr(13)
	sSource=sSource+&quot;Public const bModeFactoriel = &quot;+sModeFactoriel+Chr(13)
	sSource=sSource+&quot;Public const bFractions = &quot;+sFractions+Chr(13)
	sSource=sSource+&quot;Public const bXpointaulieux = &quot;+sbXpointaulieux+Chr(13)
	sSource=sSource+&quot;Public const bUsingDispatcher = &quot;+ sUsingDispatcher +Chr(13)
	sSource=sSource+&quot;Public const iDelaiEntreSauvegardes = &quot;+sDelaiEntreSauvegardes+Chr(13)
	sSource=sSource+&quot;Public const sThemeIcons = &quot;&quot;&quot;+sThemeIconesChoisi+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Public const sCheminSoftware1 = &quot;&quot;&quot;+sCheminSoftware1+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Public const sCheminSoftware2 = &quot;&quot;&quot;+sCheminSoftware2+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Public const sCheminSoftware3 = &quot;&quot;&quot;+sCheminSoftware3+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Public const sNomPoliceCursive = &quot;&quot;&quot;+sNomPoliceCursive+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Public const sOptionsTraceCourbe = &quot;&quot;&quot;+sOptionsTraceCourbe+&quot;&quot;&quot;&quot;+Chr(13)
	sSource=sSource+&quot;Sub MyTest2&quot; &amp; Chr(13) &amp; &quot;Print &quot;&quot;Vive Dmaths !&quot;&quot;&quot; &amp; Chr(13) &amp; &quot;End Sub&quot;


	If bFigure=True Then oFigure.Visible=True
	If bGrille=True or bDiagBox=True or bRepreGra=True Then oPoints.Visible=True
&apos;---------------------------------------------------------------------------------------------------------------------------
rem inscription de la taille des formules dans le fichier de configuration.
	If iTailleFormules&lt;&gt;Cint(sTailleFormules) Then
		oConfigAccess = GetConfigAccess( &quot;/org.openoffice.Office.Math&quot;, True )
		oTailleDesFormules = oConfigAccess.getByName( &quot;StandardFormat&quot; )
		oTailleDesFormules.BaseSize = Cint(sTailleFormules)
		oConfigAccess.commitChanges()
		bModifieTailleFormule = TRUE
	End if
rem installation du process mise à jour automatique
&apos;	oConfigAccess = GetConfigAccess( &quot;/org.openoffice.Office.Events/ApplicationEvents/Bindings&quot;, True )
&apos;	If oConfigAccess.hasByName(&quot;OnStartApp&quot;) Then oConfigAccess.removeByName(&quot;OnStartApp&quot;)
&apos;	If sMiseAJourManuel = &quot;FALSE&quot; Then
&apos;	oEvene = oConfigAccess.createInstance
&apos;	oEvene.BindingURL = &quot;vnd.sun.star.script:DmInstall.MajAuto.TestNewVersionDemarrage?language=Basic&amp;location=application&quot;
&apos;	oConfigAccess.insertByName(&quot;OnStartApp&quot;,oEvene)
&apos;	End if	
&apos;	oConfigAccess.CommitChanges
&apos;----------------------------------------------------------------------------------------------------------------------------
rem validation des icones
	&apos;If (GetguiType = 1 or Not FileExists(&quot;/Users&quot;))  Then
	DmInstall.Install_Addon.RegleIconesAppsPref(oDmOptions,sThemeIconesChoisi)
	DmInstall.Install_Addon.ChoisirThemeIcone(sThemeIconesChoisi)
	&apos;Endif
&apos;----------------------------------------------------------------------------------------------------------------------------
rem affiche masque les icones
	If bAfficherMasquerIcones = True Then RegleAffichageIcones
	
rem on considère le dictionnaire comme déchargé
	DictionnaireCharge = False
	
rem message de fin
	
	Call ChargementDuVocabulaire
	
	sMessage = Trad(iLangChoisie,3) &amp; &quot; &quot;
	
	If bIconesChangees = True Then
		If IsMacOS Then
			sMessage = sMessage &amp; Chr(13) &amp; Chr(13) &amp; Trad(iLangChoisie,5) rem Quittez et relancer OOo/SO/NeO
		Else
			sMessage = sMessage &amp; Chr(13) &amp; Chr(13) &amp; Trad(iLangChoisie,0) rem OOo va être redémarré.
		Endif
	Endif
	
	
	If bMiseAJour = FALSE Then msgbox(sMessage,64,&quot;Dmaths&quot;)

	If (bIconesChangees = True and bMiseAJour = False) Then
		If IsMacOS Then
		&apos;	If OOoName = &quot;NeoOffice&quot; Then
				ReLanceOOoMac
		&apos;	Else
			&apos;	EcritFichierDmOptionsTXT(sSource) rem ecrit le fichier dmoptions.txt
			&apos;	InsertModuleDmOptions(sSource)    rem ecrit le module DmOptions	
		&apos;	Endif
		Else
			ReLanceOOo
		End if
	Else rem si icones pas changées
		EcritFichierDmOptionsTXT(sSource) rem ecrit le fichier dmoptions.txt
		InsertModuleDmOptions(sSource)    rem ecrit le module DmOptions	
	EndIf
End Sub


Sub CreeIconesOptionsSoft1
	BasicLibraries.loadLibrary(&quot;DmInstall&quot;)
	DmInstall.ToolsImages.CreeIcones(oDmOptions,1)
	bIconesChangees = True
End Sub

Sub CreeIconesOptionsSoft2
	BasicLibraries.loadLibrary(&quot;DmInstall&quot;)
	DmInstall.ToolsImages.CreeIcones(oDmOptions,2)
	bIconesChangees = True
End Sub

Sub CreeIconesOptionsSoft3
	BasicLibraries.loadLibrary(&quot;DmInstall&quot;)
	DmInstall.ToolsImages.CreeIcones(oDmOptions,3)
	bIconesChangees = True
End Sub

&apos;Sub GereSoftButton1Options
&apos;	Print &quot;ICI3&quot;
&apos;	Xray oDmOptions
&apos;	GereSoftButton(oDmOptions,1)
&apos;End Sub

&apos;Sub GereSoftButton2Options
&apos;	GereSoftButton(oDmOptions,2)
&apos;End Sub

&apos;Sub GereSoftButton3Options
&apos;	GereSoftButton(oDmOptions,3)
&apos;End Sub


Sub AfficherMasquerIcones rem cette macro permet de masquer ou d&apos;afficher des icones de la barre dmaths
	rem chargement des boites de dialogues
	Dim sImage, sRacineImage as String
	oDmOptions.Visible = False
	DialogLibraries.loadLibrary( &quot;Dmaths&quot; )
	oAddonBarre = CreateUnoDialog( DialogLibraries.DmInstall.AddonBarre )
	oConfigAccessToolBarre = GetConfigAccess( &quot;/org.openoffice.Office.Addons/AddonUI/OfficeToolBar&quot;, True )
	oDmBarre = oConfigAccessToolBarre.getByName(&quot;org.openoffice.Office.addon.DMathsBarre&quot;)
	oAddonBarre.GetControl(&quot;CheckBox42&quot;).Visible = 0
	Dim sElementNames$()
	sElementNames = oDmBarre.getElementNames()
	For I = LBound(sElementNames()) To UBound(sElementNames())
	sImage = NomFichier(oDmBarre.getByname(sElementNames(I)).ImageIdentifier)
	oAddonBarre.GetControl(&quot;ImageControl&quot;&amp;cStr(I+1)).Model.Width = 8
	oAddonBarre.GetControl(&quot;ImageControl&quot;&amp;cStr(I+1)).Model.Height = 8
	oAddonBarre.GetControl(&quot;ImageControl&quot;&amp;cStr(I+1)).Model.ImageUrl = oDmBarre.getByname(sElementNames(I)).ImageIdentifier &amp; &quot;_16.bmp&quot; 
	If Instr(sImage,&quot;choixoptionsdmaths&quot;) &gt; 0 Then oAddonBarre.GetControl(&quot;CheckBox&quot;&amp;cStr(I+1)).Enable = False
	If oDmBarre.getByname(sElementNames(I)).Context &lt;&gt; &quot;hidden&quot; Then oAddonBarre.GetControl(&quot;CheckBox&quot;&amp;cStr(I+1)).State = 1
	Next I
	exitOK = com.sun.star.ui.dialogs.ExecutableDialogResults.OK
    if oAddonBarre.Execute = exitOK then RetourChoixOptionsDmaths
&apos;    oAddonBarre.Execute()
End Sub

Sub RetourChoixOptionsDmaths
	bAfficherMasquerIcones = True
	oDmOptions.Visible = True
End Sub

	
Sub RegleAffichageIcones
	Dim sElementNames$()
	sElementNames = oDmBarre.getElementNames()
	For I = LBound(sElementNames()) To UBound(sElementNames())
		If oAddonBarre.GetControl(&quot;CheckBox&quot;&amp;cStr(I+1)).State = 1 Then
			oDmBarre.getByname(sElementNames(I)).Context = &quot;com.sun.star.text.TextDocument&quot;
		Else 
			oDmBarre.getByname(sElementNames(I)).Context = &quot;hidden&quot;
		End if
	Next I
	oAddonBarre.EndExecute()
	oConfigAccessToolBarre.commitChanges()
	bIconesChangees = True

End Sub



Sub CancelMasquerIcones
	oAddonBarre.EndExecute()
	oDmOptions.Visible = True
End Sub



Sub About_Dmaths rem enregistré le 7 mai 2004
	DialogLibraries.loadLibrary(&quot;DmInstall&quot;)
	BasicLibraries.loadLibrary(&quot;Dmaths&quot;)
	Call Dmaths.Tools.VerifOperationnel
	Dim oImage as Object
	Dim sInfo as String
	oCopyDmaths = CreateUnoDialog( DialogLibraries.DmInstall.CopyDmaths )
	oImage = oCopyDmaths.Model.ImageControl1
	oImage.ImageUrl=sChemindmaths+&quot;Images/logo.png&quot;	
	sInfo = &quot;Dmaths version &quot;+iVersion+&quot; Licence GPL&quot;+Chr(13)
	sInfo = sInfo+&quot;Copyright 2001-2010 Didier Dorange-Pattoret&quot;+Chr(13)
	sInfo = sInfo+ &quot;http://www.dmaths.org&quot;+Chr(13) +Chr(13)
	sInfo = sInfo+ &quot;Remerciements à: &quot;+Chr(13)
	sInfo = sInfo+ &quot;- Laurent Godard (lgodard@indesko.com http://www.indesko.com)&quot;+Chr(13)
	sInfo = sInfo+ &quot;  pour ses conseils, TailleFormule et BatchConv (LGPL),&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Andy Lewis pour GraphPlotter et Box Plot Histogram (LGPL),&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Gilles Daurat pour les macros de Gdmath (GPL),&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Christophe Devalland pour les macros SPIP/LateX (GPL),&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Agnès Simonet pour la macro qui permet d&apos;encadrer du texte,&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Jérôme Ortais pour ses macros et les modifications apportées,&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Jacqueline Gouguenheim-Desloy pour l&apos;installation sous Mac,&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Jean Marc Gervais pour le mémo et le mini mémo,&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Arnaud Kientz et Sébastien Estrade pour le logo et le site,&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Gisbert Friege pour la traduction en allemand&quot;+Chr(13)
	sInfo = sInfo+ &quot;  et l&apos;introduction de la dérivée seconde dans les tableaux de variations.&quot;+Chr(13)
	sInfo = sInfo+ &quot;-  Jean-Luc Guillot pour l&apos;amélioration du traceur de courbes.&quot;+Chr(13)
	sInfo = sInfo+ &quot;-  Romain Dorange-Pattoret pour celle du module figures géométriques.&quot;+Chr(13)
	sInfo = sInfo+ &quot;- Jean Marc Gervais, Gisbert Friege et Jacqueline Gouguenheim-Desloy&quot;+Chr(13)+&quot;   pour leurs suggestions et leur aide précieuse.&quot;+Chr(13)+Chr(13)
	sInfo = sInfo +&quot;Dmaths is a free software under the GPL Licence&quot;+Chr(13)
	sInfo = sInfo +&quot;of the Free Software Foundation (www.fsf.org)&quot;+Chr(13)

	
	oCopyDmaths.GetControl(&quot;Label1&quot;).Text = sInfo
	oCopyDmaths.Execute()
End Sub

Sub End_About_Dmaths
	oCopyDmaths.Endexecute()
End Sub

Sub Display_Licence
	Dim oLicence as Object
	Dim mFileProperties(0) As New com.sun.star.beans.PropertyValue
	Dim sUrl as String
	mFileProperties(0).Value=True
	sUrl=sChemindmaths+&quot;licence.odt&quot;
	oDesktop=createUnoService(&quot;com.sun.star.frame.Desktop&quot;)
	oLicence= oDesktop.LoadComponentFromURL(sUrl,&quot;_blank&quot;,0,mFileProperties())
End Sub



Sub Join_dmaths
	On error resume next
&apos;	If GetGuiType = 1 Then
	Dim sUrl as String
	Dim sys As Object
	Dim iFlags As Integer
	sUrl=ConvertToURL(&quot;http://www.dmaths.org&quot;)
	sys = CreateUnoService(&quot;com.sun.star.system.SystemShellExecute&quot;)
	iFlags = com.sun.star.system.SystemShellExecuteFlags.NO_SYSTEM_ERROR_MESSAGE &apos; = 0
	sys.execute(sUrl,&quot; &quot;, iFlags)
&apos;	Elseif FileExists (&quot;/usr/bin/konqueror&quot;) Then
&apos;	shell(&quot;/usr/bin/konqueror http://www.dmaths.org&quot;)
&apos;	Endif
End Sub


rem cette macro sert a relancer la mise a jour
Sub Repare_Dmaths
	oDmOptions.EndExecute()
	Wait 100
	Call Install_Addon.LanceFinInstallation(TRUE)
End Sub

&apos;---------------------------------------------------------------------------------------------------------
Rem Cette macro transforme les raccourcis F10 en F8 et F9 en F4 ecrite le 17 octobre 2010 par Didier DP
Sub Config4Mac(bForMac as Boolean)
	Dim oConfigAccess,MyProp as Object 
	oConfigAccess = GetConfigAccess( &quot;/org.openoffice.Office.Accelerators/PrimaryKeys/Modules/com.sun.star.text.TextDocument&quot;, True )
	If oConfigAccess.hasByName(&quot;F4&quot;) Then oConfigAccess.removeByName(&quot;F4&quot;)
	If oConfigAccess.hasByName(&quot;F8&quot;) Then oConfigAccess.removeByName(&quot;F8&quot;)
	If oConfigAccess.hasByName(&quot;F9&quot;) Then oConfigAccess.removeByName(&quot;F9&quot;)
	If oConfigAccess.hasByName(&quot;F10&quot;) Then oConfigAccess.removeByName(&quot;F10&quot;)
	
	MyProp = oConfigAccess.CreateInstance
	If bForMac Then
		MyProp.Command = &quot;vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&amp;location=application&quot;
		oConfigAccess.insertByName(&quot;F4&quot;,myProp)
	Endif
	
	
	MyProp = oConfigAccess.CreateInstance
	If bForMac Then
		MyProp.Command = &quot;vnd.sun.star.script:Dmaths.Module1.MetenFormule?language=Basic&amp;location=application&quot;
	Else
		MyProp.Command = &quot;.uno:SetExtSelection&quot;
	Endif
	oConfigAccess.insertByName(&quot;F8&quot;,myProp)
	
	oConfigAccess.CommitChanges()
End Sub 

rem --------------------------------------------------------------------------------------------------------------------------------
rem la macro suivante permet dechanger F4-F9 et F8-F10
Sub SwitchF4F8
	Dim oConfigAccess,MyProp as Object 
	Dim bDefaultConfig as Boolean
	
	bIconesChangees = True rem commande le redemarrage apres validation des options.
	
	bDefaultConfig = False
	oConfigAccess = GetConfigAccess( &quot;/org.openoffice.Office.Accelerators/PrimaryKeys/Modules/com.sun.star.text.TextDocument&quot;, True )
	If oConfigAccess.hasByName(&quot;F8&quot;) Then bDefaultConfig = (oConfigAccess.getByName(&quot;F8&quot;).Command = &quot;.uno:SetExtSelection&quot;)

&apos;	MyProp = oConfigAccess.CreateInstance
	If oConfigAccess.hasByName(&quot;F4&quot;) Then oConfigAccess.removeByName(&quot;F4&quot;)
	If oConfigAccess.hasByName(&quot;F8&quot;) Then oConfigAccess.removeByName(&quot;F8&quot;)
	If oConfigAccess.hasByName(&quot;F9&quot;) Then oConfigAccess.removeByName(&quot;F9&quot;)
	If oConfigAccess.hasByName(&quot;F10&quot;) Then oConfigAccess.removeByName(&quot;F10&quot;)
	
&apos;	Print oConfigAccess.getByName(&quot;F8&quot;).Command
	
	oConfigAccess.CommitChanges()
	If bDefaultConfig Then 	
		MyProp = oConfigAccess.CreateInstance	
		MyProp.Command = &quot;vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&amp;location=application&quot;
		oConfigAccess.insertByName(&quot;F4&quot;,myProp)
		MyProp = oConfigAccess.CreateInstance
		MyProp.Command = &quot;vnd.sun.star.script:Dmaths.Module1.MetenFormule?language=Basic&amp;location=application&quot;
		oConfigAccess.insertByName(&quot;F8&quot;,myProp)		
	Else
		MyProp = oConfigAccess.CreateInstance
		MyProp.Command = &quot;vnd.sun.star.script:Dmaths.Module1.MetentreAccolades?language=Basic&amp;location=application&quot;
		oConfigAccess.insertByName(&quot;F9&quot;,myProp)
		MyProp = oConfigAccess.CreateInstance
		MyProp.Command = &quot;vnd.sun.star.script:Dmaths.Module1.MetenFormule?language=Basic&amp;location=application&quot;
		oConfigAccess.insertByName(&quot;F10&quot;,myProp)
		MyProp = oConfigAccess.CreateInstance		
		MyProp.Command = &quot;.uno:SetExtSelection&quot;
		oConfigAccess.insertByName(&quot;F8&quot;,myProp)	
	Endif
	oConfigAccess.CommitChanges()
End Sub 



&apos;----------------------------------------------------------------------------------------------------------


Sub ModifieCheckBoxTailleFormule
	If oDmOptions.GetControl(&quot;CheckBox12&quot;).State=1 Then
	oDmOptions.GetControl(&quot;TextField1&quot;).Enable = False
	Else
	oDmOptions.GetControl(&quot;TextField1&quot;).Enable = True
	End If
End Sub


&apos;---------------------------------------------------------------------------------------------------------



Sub InsertModuleDmOptions(srce as String)
	Dim oLib as Object
    oLib = GlobalScope.BasicLibraries.Standard
    If oLib.hasByName(&quot;DmOptions&quot;) Then
       oLib.removeByName(&quot;DmOptions&quot;)
    EndIf
     If oLib.hasByName(&quot;Lang&quot;) Then
       oLib.removeByName(&quot;Lang&quot;)
    EndIf
	oLib.InsertByName(&quot;DmOptions&quot;,srce)
End Sub

Function GetConfigAccess( ByVal cNodePath As String,ByVal bWriteAccess As Boolean,Optional bEnableSync,Optional bLazyWrite) As Object
	If IsMissing(bEnableSync) Then 	bEnableSync = True 
	If IsMissing( bLazyWrite ) Then bLazyWrite = False
	Dim oConfigProvider, oConfigAccess as Object
	oConfigProvider = GetProcessServiceManager.createInstanceWithArguments(&quot;com.sun.star.configuration.ConfigurationProvider&quot;,Array( MakePropertyValue( &quot;enableasync&quot;, bEnableSync)))
	If bWriteAccess Then
		cServiceName = &quot;com.sun.star.configuration.ConfigurationUpdateAccess&quot;
	Else
		cServiceName = &quot;com.sun.star.configuration.ConfigurationAccess&quot;
	EndIf
	oConfigAccess = oConfigProvider.createInstanceWithArguments( cServiceName, Array( MakePropertyValue( &quot;nodepath&quot;, cNodePath ), MakePropertyValue( &quot;lazywrite&quot;, bLazyWrite )))
	GetConfigAccess() = oConfigAccess
End Function

&apos;----------
&apos;	Create and return a new com.sun.star.beans.PropertyValue.
&apos;
Function MakePropertyValue( Optional cName As String, Optional uValue ) As com.sun.star.beans.PropertyValue
	Dim oPropertyValue As New com.sun.star.beans.PropertyValue
	If Not IsMissing( cName ) Then
		oPropertyValue.Name = cName
	EndIf
	If Not IsMissing( uValue ) Then
		oPropertyValue.Value = uValue
	EndIf
	MakePropertyValue() = oPropertyValue
End Function

rem cette fonction retourne True pour les installation multi-utilisateurs.
Function TestInstallRezo as Boolean
		Dim LeTest As Boolean
		Dim oAC As Object
		LeTest = False 
 		oCmdEnv = CreateUnoListener( &quot;CmdEnv_&quot;, _
    		&quot;com.sun.star.deployment.XCommandEnvironment&quot; )
 		GetPMF = GetDefaultContext.getValueByName( _
    		&quot;/singletons/com.sun.star.deployment.thePackageManagerFactory&quot;)    
    	oPackages = GetPMF.getPackageManager(&quot;shared&quot;).getDeployedPackages(oAc,oCmdEnv)  
	   	For I = LBound(oPackages) To UBound(oPackages)
   			If oPackages(I).Name = &quot;DmathsAddon.oxt&quot; Then 
   				LeTest = True
   			Endif
   		Next I
   		TestInstallRezo = LeTest	
End Function


rem cette fonction donne le nom d&apos;un fichier connaissant son URL
Function NomFichier(sURL as String) as String
	Dim iPos,iLongUrl as integer
	iLongUrl = Len(sUrl)
	iPos = iLongUrl
	Do 
	iPos = iPos - 1	
	Loop until (Mid(sUrl,iPos,1) = &quot;/&quot; or iPos = 0)
	NomFichier = Mid(sUrl,iPos+1,iLongUrl-iPos)
end function

rem cette macro active ou desactive le champ de texte des scalaires lettres
Sub ChangeLettresStatuts(oEvt as Object)
 	oEvt.Source.Context.GetControl(&quot;TextField7&quot;).Enable = (oEVt.Source.State = 1)
End Sub


</script:module>