This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/OOoTep/Module3.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
<?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="Module3" script:language="StarBasic">&apos;OOoTep
&apos;Copyright (C) 2005-2006 Gilles Daurat

&apos;This program is free software; you can redistribute it and/or
&apos;modify it under the terms of the GNU General Public License
&apos;as published by the Free Software Foundation; either version 2
&apos;of the License, or (at your option) any later version.

&apos;This program 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
&apos;GNU General Public License for more details.

&apos;You should have received a copy of the GNU General Public License
&apos;along with this program; if not, write to the Free Software
&apos;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301, USA.

Public oTepForm as Object
Public RetourTepForm as Integer
Public DescriptionOOoTep as String
Public clipBoardTexte as String
Public gauche_cadre as long
Public haut_cadre as long
Public largeur_cadre as long
Public hauteur_cadre as long
Public angle_en_radian as Boolean

Sub Main()
	AfficheDialog1()
End Sub

Sub InitialiseOptions()
Dim s

	s=RetourneOptionOOoTep(&quot;nompolice&quot;)
	s=RetourneOptionOOoTep(&quot;taillepolice&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur0&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur1&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur2&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur3&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur4&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur6&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur7&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur8&quot;)
	s=RetourneOptionOOoTep(&quot;epaisseur9&quot;)
	s=RetourneOptionOOoTep(&quot;croix0&quot;)
	s=RetourneOptionOOoTep(&quot;croix1&quot;)
	s=RetourneOptionOOoTep(&quot;croix2&quot;)
	s=RetourneOptionOOoTep(&quot;croix3&quot;)
	s=RetourneOptionOOoTep(&quot;rond1&quot;)
	s=RetourneOptionOOoTep(&quot;rond2&quot;)
	s=RetourneOptionOOoTep(&quot;rond3&quot;)
	s=RetourneOptionOOoTep(&quot;codageangle&quot;)
	s=RetourneOptionOOoTep(&quot;codagelongueur&quot;)
	s=RetourneOptionOOoTep(&quot;couleurpolice&quot;)
	s=RetourneOptionOOoTep(&quot;couleurdutrait&quot;)
	s=RetourneOptionOOoTep(&quot;tracenpoche&quot;)
	s=RetourneOptionOOoTep(&quot;optionbutton&quot;)
	angle_en_radian = False
End Sub

Sub AfficheDialog1()
Dim nCommande as String
Dim xShape as Object


	InitialiseOptions()
	on error goto pas_de_cadre

	hauteur_cadre = 0	
	largeur_cadre = 0
	gauche_cadre = 0
	haut_cadre = 0
	xShape = thisComponent.CurrentSelection(0)
	gauche_cadre = xShape.Position.X
	haut_cadre = xShape.Position.Y
	largeur_cadre = xShape.Size.width
	hauteur_cadre = xShape.Size.height
	thiscomponent.DrawPage.remove(xShape)
pas_de_cadre:
	on error goto 0
	oTepForm = LoadDialog(&quot;OOoTep&quot;, &quot;Dialog1&quot;)
	ChangeTitreDialog(oTepForm)

	nCommande = RetourneOptionOOoTep(&quot;optionbutton&quot;)
	Select Case nCommande
	case &quot;1&quot;
		oTepForm.Model.OptionButton1.State = True
		OptionButton1_Click()
	case &quot;2&quot;
		oTepForm.Model.OptionButton2.State = True
		OptionButton2_Click()
	case &quot;3&quot;
		oTepForm.Model.OptionButton3.State = True
		OptionButton3_Click()
	End Select

	oTepForm.Model.Step = 1
	oTepForm.Execute()
	RemplaceTexte(clipBoardTexte, chr(10), chr(10) &amp; chr(13))
	RemplaceTexte(clipBoardTexte, chr(13) &amp; chr(13), chr(13))
	TextToClipBoard(clipBoardTexte)
End Sub

Sub CommandButton1_Click()
	RetourTepForm = OuvreFichierTEP()
	if RetourTepForm = 1 then oTepForm.Model.TextField2.Text = NomFichier
End Sub

Sub CommandButton2_Click()
Dim leTexte as String

	if oTepForm.Model.OptionButton2.State Or oTepForm.Model.OptionButton3.State then
	 	leTexte = oTepForm.Model.TextField1.Text
	 	clipBoardTexte = leTexte
	 	DescriptionOOoTep = RetrouveScriptTep(leTexte)
	 	if instr(lcase(leTexte),&quot;@oootep&quot;) = 0 then
	 		MsgBox1 &quot;Le script dans la zone texte ne semble pas être correct !&quot;
	 		RetourTepForm = 0
	 	else
	 		oTepForm.Model.Label2.Label = &quot;Analyse du script...&quot;
			oTepForm.Model.Step = 2
			oTepForm.SetPosSize(0, 0, 0, 125, 8)
			RetourTepForm = 1
			leTexte = leTexte + chr(10)
			ExtraitBoiteTEP(leTexte)
			TraceFigure()
		end if
	End If
	If oTepForm.Model.OptionButton1.State then
		clipBoardTexte = &quot;&quot;
 		oTepForm.Model.Label2.Label = &quot;Analyse du script...&quot;
		oTepForm.Model.Step = 2
		oTepForm.SetPosSize(0, 0, 0, 125, 8)
		RetourTepForm = 1
		ExtraitLigneTep(ligne, options)
		TraceFigure()
	End if
	oTepForm.Model.Label2.Label = &quot;Sauvegarde Option...&quot;
	If oTepForm.Model.OptionButton1.State then nCommande = &quot;1&quot;
	If oTepForm.Model.OptionButton2.State then nCommande = &quot;2&quot;
	If oTepForm.Model.OptionButton3.State then nCommande = &quot;3&quot;
	EcritOptionOOoTep(&quot;optionbutton&quot;, nCommande)
	oTepForm.Model.Label2.Label = &quot;Fin execution Tep...&quot;
	oTepForm.EndExecute()
End Sub

Sub OptionButton1_Click()
	oTepForm.Model.TextField2.Enabled = True
	oTepForm.Model.CommandButton1.Enabled = True
&apos;	oTepForm.SetPosSize(0, 0, 0, 100, 8)
	if oTepForm.Model.Height&gt;100 Then oTepForm.Model.Height = oTepForm.Model.Height - oTepForm.Model.TextField1.Height - 15
End Sub

Sub OptionButton2_Click()
	oTepForm.Model.TextField2.Enabled = False
	oTepForm.Model.CommandButton1.Enabled = False
	oTepForm.Model.TextField1.Text = &quot;&quot;
	if oTepForm.Model.Height&lt;100 Then oTepForm.Model.Height = oTepForm.Model.Height + oTepForm.Model.TextField1.Height + 15
&apos;	oTepForm.SetPosSize(0, 0, 0, 190 + oTepForm.Model.TextField1.Height, 8)
End Sub

Sub OptionButton3_Click()
Dim leTexte as String
	ClipBoardToText(leTexte)
	RemplaceTexte leTexte, chr(10), &quot;&quot;
	RemplaceTexte leTexte, chr(0), &quot;&quot;
	oTepForm.Model.TextField2.Enabled = False
	oTepForm.Model.CommandButton1.Enabled = False
	oTepForm.Model.TextField1.Text = leTexte
	if oTepForm.Model.Height&lt;100 Then oTepForm.Model.Height = oTepForm.Model.Height + oTepForm.Model.TextField1.Height + 15
&apos;	oTepForm.SetPosSize(0, 0, 0, 190 + oTepForm.Model.TextField1.Height, 8)
End Sub

Sub TraceFigure()
dim i as integer, j as integer
dim param() as string
dim x0 as long, y0 as long, x1 as long, y1 as long, x2 as long, y2 as long, x3 as long, y3 as long
dim xc as long, yc as long, unRayon as long
dim unTrait as Object
dim unPolygone as Object
dim ang as double, ang1 as integer, ang2 as integer

&apos;	on error resume next

	oTepForm.Model.Label2.Label = &quot;Le graphisme se prépare...&quot;
	oTepForm.GetControl(&quot;ProgressBar1&quot;).Value = 0
	xunit = 1000
	yunit = xunit
	pasx = 2
	pasy = 2
	xmin = 0
	ymin = 0
	xmax = 19700
	ymax = xmax * 3 / 4
	xorig = (xmin + xmax) / 2
	yorig = (ymin + ymax) / 2

	ChargeLimite()

	if hauteur_cadre &lt;&gt; 0 Then	
		largeur_cadre = hauteur_cadre * (xmax-xmin) / (ymax-ymin)
		xunit = hauteur_cadre / (ymax - ymin) 
		yunit = xunit
&apos;		xmin = gauche_cadre
&apos;		ymin = haut_cadre
	End if
	
	if ubound(ligne) &gt; 0 then
		NbObjet = 0
		InitialiseDessin(DEBUG)
		oGroupeDessin = InitialiseGroupe()
		for i = LBound(ligne) to UBound(ligne)
			If DEBUG Then
				oTepForm.Model.Label2.Label = ligne(i)
			End If
			oTepForm.GetControl(&quot;ProgressBar1&quot;).Value = 100 * i / UBound(ligne())
			if ChargeParametre(ligne(i), param(), &quot;;&quot;) &gt; 0 then
				select case Lcase(param(0))
				case &quot;repere&quot;
					RemplaceTexte ligne(i), &quot;;&quot;, &quot;,&quot;
					ChargeParametre(param(1), param(), &quot;,&quot;)
					pasx = val(param(4))
					pasy = val(param(5))
					AjouteRepere(0, 0, xunit, yunit, pasx, pasy, options(i))
				case &quot;repereortho&quot;
					RemplaceTexte ligne(i), &quot;;&quot;, &quot;,&quot;
					ChargeParametre(param(1), param(), &quot;,&quot;)
&apos;					xunit = val(param(2))*1000 / 30
&apos;					yunit = xunit
&apos;					xorig = 0
&apos;					yorig = 0
					pasx = val(param(3))
					pasy = val(param(4))
					AjouteRepere(0, 0, xunit, yunit, pasx, pasy, options(i))
				case &quot;var&quot;
					AjouteVariable(param(1), &quot;&quot;, options(i))
				case else
					if lcase(left(param(0), 1)) = &quot;@&quot; and lcase(left(param(0), 7)) &lt;&gt; &quot;@figure&quot; and lcase(left(param(0), 7)) &lt;&gt; &quot;@option&quot; then
						if lcase(left(param(0), 7)) = &quot;@oootep&quot; then
							i = i + 1
							oTepForm.GetControl(&quot;ProgressBar1&quot;).Value = 100 * i / UBound(ligne())
							while((left(ligne(i), 1) &lt;&gt; &quot;@&quot;) and (i &lt; ubound(ligne))) 
&apos;								if ChargeParametre(ligne(i), param(), &quot;;&quot;) &gt; 0 then
&apos;									if Sorte(ChercheObjet(param(0))) = TEP_FONCTION then
&apos;										AjouteFonction(param(0), ligne(i), &quot;&quot;)
&apos;									end if
&apos;								end if
								i = i + 1
								oTepForm.GetControl(&quot;ProgressBar1&quot;).Value = 100 * i / UBound(ligne())
							wend
							if left(ligne(i), 1) = &quot;@&quot; then i = i - 1
						else
							i = i + 1
							oTepForm.GetControl(&quot;ProgressBar1&quot;).Value = 100 * i / UBound(ligne())
							while((left(ligne(i), 1) &lt;&gt; &quot;@&quot;) and (i &lt; ubound(ligne))) 
								i = i + 1
								oTepForm.GetControl(&quot;ProgressBar1&quot;).Value = 100 * i / UBound(ligne())
							wend
							if left(ligne(i), 1) = &quot;@&quot; then i = i - 1
						end if
					else
						if UBound(param) &gt; 0 then
							select case LCase(param(1))
							case &quot;tangente&quot;
								AjouteTangente(param(0), coords(i), options(i))
							case &quot;fonction&quot;
								AjouteFonction(param(0), ChargeFonction(param(0)), options(i))
							case &quot;point&quot;
								AjoutePoint(param(0), param(2), options(i))
							case &quot;segmentlong&quot;
								AjouteSegmentLong(param(0), param(2), options(i), TEP_SEGMENT)
							case &quot;segment&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_SEGMENT)
							case &quot;droite&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_DROITE)
							case &quot;droiteeqr&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_DROITEEQR)
							case &quot;droiteeq&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_DROITEEQ)
							case &quot;droitev&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_DROITEV)
							case &quot;droiteangle&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_DROITEANGLE)
							case &quot;demidroite&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_DEMIDROITE)
							case &quot;polygone&quot;
								AjoutePolygone(param(0), param(2), options(i))
							case &quot;vecteur&quot;
								AjouteSegment(param(0), param(2), options(i), TEP_VECTEUR)
							case &quot;vecteurcoord&quot;
								AjouteVecteur(param(0), param(2))
							case &quot;cercle&quot;
								AjouteCercle(param(0), param(2), options(i), TEP_CERCLE)
							case &quot;cercledia&quot;
								AjouteCercle(param(0), param(2), options(i), TEP_CERCLEDIA)
							case &quot;cerclerayon&quot;
								AjouteCercle(param(0), param(2), options(i), TEP_CERCLERAYON)
							case &quot;pointsur&quot;
								AjoutePointSur(param(0), param(2) , options(i), coords(i))
							case &quot;parallele&quot;
								AjouteDroite(param(0), param(2), options(i), TEP_DROITEPARALLELE)
							case &quot;perpendiculaire&quot;
								AjouteDroite(param(0), param(2), options(i), TEP_DROITEPERPENDICULAIRE)
							case &quot;homothetie&quot;
								AjouteHomothetie(param(0), param(2))
							case &quot;similitude&quot;
								AjouteSimilitude(param(0), param(2))
							case &quot;rotation&quot;
								AjouteRotation(param(0), param(2))
							case &quot;translation&quot;
								AjouteTranslation(param(0), param(2))
							case &quot;symetrie&quot;, &quot;reflexion&quot;
								AjouteSymetrie(param(0), param(2))
							case &quot;image&quot;
								AjouteImage(param(0), param(2), options(i))
							case &quot;symetrique&quot;
								AjouteSymetrique(param(0), param(2), options(i))
							case &quot;angle&quot;
								AjouteArc(param(0), param(2), options(i), TEP_ANGLE)
							case &quot;arc&quot;
								AjouteArc(param(0), param(2), options(i), TEP_ARC)
							case &quot;barycentre&quot;
								AjouteBarycentre(param(0), param(2), options(i))
							case &quot;bissectrice&quot;
								AjouteBissectrice(param(0), param(2), options(i))
							case &quot;entier&quot;, &quot;reel&quot;
								AjouteReel(param(0), param(2), coords(i), options(i))
							case &quot;distance&quot;
								AjouteDistance(param(0), param(2), options(i))
							case &quot;aire&quot;
								AjouteAire(param(0), param(2), options(i))
							case &quot;perimetre&quot;
								AjoutePerimetre(param(0), param(2), options(i))
							case &quot;milieu&quot;
								AjouteMilieu(param(0), param(2), options(i))
							case &quot;mediatrice&quot;
								AjouteMediatrice(param(0), param(2), options(i))
							case &quot;groupe&quot;
								AjouteGroupe(param(0), param(2), options(i))
							case &quot;projete&quot;
								AjouteProjete(param(0), param(2), options(i))
							case &quot;intersection&quot;
								AjouteIntersection(param(0), param(2), options(i), coords(i))
							case &quot;texte&quot;
								AjouteTexte(param(0), param(2), options(i), coords(i))
							case &quot;mesurearc&quot;
								AjouteMesureArc(param(0), param(2), options(i))
							end select
						else
							select case LCase(param(0))
							case &quot;radians&quot;
								angle_en_radian = True
							end Select
						end If
					end if
				end select			
			end if
		next i
		oTepForm.Model.Label2.Label = &quot;Finalisation des tracés...&quot;
		TermineDessin()
	end if
End Sub

</script:module>