This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/Dmaths2/GraphDialogFns.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
<?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="GraphDialogFns" script:language="StarBasic">&apos;************************************************
&apos;Copyright (C) Andy Lewis.  (lewiss@ntlworld.com)
&apos;téléchargé sur www.ooomacros.org
&apos;
&apos;This library is free software; you can redistribute it and/or
&apos;modify it under the terms of the GNU Lesser General Public Licence (LGPL)
&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;************************************************
&apos;Routines required by the GraphDialog box
&apos;This module requires modules &quot;AxesDrawing&quot; and &quot;GraphDrawing&quot;

option explicit

private goGraphDialog as object
private GraphDialogExists as boolean

&apos;___________________________________________________________________________________________

sub OpenGraphDialog()
	DialogLibraries.loadLibrary( &quot;Dmaths&quot; )
	DialogLibraries.loadLibrary( &quot;Dmaths2&quot; )
	if not GraphDialogExists then
		goGraphDialog = Dmaths.LoadDialog(&quot;Dmaths2&quot;,&quot;GraphDialog&quot;)
		GraphDialogExists=TRUE
	end if
	goGraphDialog.SetVisible(TRUE)
	goGraphDialog.SetPosSize(0,0,0,0,com.sun.star.awt.PosSize.POS)
	If getguitype = 1 Then oDocumentCourant.CurrentController.Frame.ContainerWindow.Visible = False
	do
	loop
end sub

&apos;___________________________________________________________________________________________

sub GraphDialog_Close_Click()
	goGraphDialog.SetVisible(FALSE)
end sub	

&apos;___________________________________________________________________________________________

sub GraphDialog_SetupAxes_Click()
	if not AxesDialogExists then
		goAxesDialog=LoadDialog(&quot;Dmaths2&quot;,&quot;AxesDialog&quot;)
		AxesDialogExists=TRUE
	end if
	AutoScaleAxes()
	SetUpDefaultTicks()
	goAxesDialog.SetVisible(TRUE)
	goAxesDialog.SetPosSize(0,0,0,0,com.sun.star.awt.PosSize.POS)	
end sub

&apos;___________________________________________________________________________________________

sub GraphDialog_DrawGraph_Click()
	Dim stFunction as String, xMin as single, xMax as single
	Dim m as single, c as single, ineq as string, index as integer
	Dim k as single
	Dim oIntersection as object
&apos;-----------------------------------------------------------------------
&apos;determine si les axes ont ete parametres
	If AxesParametres = FALSE Then
	MsgBox sVocab(iLang,368),48,&quot;Dmaths&quot;
	Goto Fin
	Endif
	
	goShadings = createUnoService( &quot;com.sun.star.drawing.ShapeCollection&quot; )

	For index=1 to 2
		if goGraphDialog.getControl(&quot;fCheck&quot; &amp; cStr(index)).getState() = 1 then
			stFunction = goGraphDialog.getControl(&quot;Function&quot; &amp; cStr(index)).Peer.getText()
			stFunction = ChangeVirgulePoint(stFunction) rem modifié par Didier Dorange-Pattoret
			xMin = goGraphDialog.getControl(&quot;xmin&quot; &amp; cStr(index)).getValue()
			xMax = goGraphDialog.getControl(&quot;xmax&quot; &amp; cStr(index)).getValue()
			ineq = goGraphDialog.getControl(&quot;fIneq&quot; &amp; cStr(index)).Peer.getText()
			If stFunction &lt;&gt; &quot;&quot; then DrawGraph(stFunction,xMin,xMax,ineq)
		End If
	Next index

	For index=1 to 3
		if goGraphDialog.getControl(&quot;slgCheck&quot; &amp; cStr(index)).getState() = 1 then
			m =	goGraphDialog.getControl(&quot;m&quot; &amp; cStr(index)).getValue()
			c =	goGraphDialog.getControl(&quot;c&quot; &amp; cStr(index)).getValue()
			ineq = goGraphDialog.getControl(&quot;slgIneq&quot; &amp; cStr(index)).Peer.getText()
			StraightLineGraph(m,c,ineq)
		End If
	Next index

	For index=1 to 2
		if goGraphDialog.getControl(&quot;vlCheck&quot; &amp; cStr(index)).getState() = 1 then
			k =	goGraphDialog.getControl(&quot;k&quot; &amp; cStr(index)).getValue()
			ineq = goGraphDialog.getControl(&quot;vlIneq&quot; &amp; cStr(index)).Peer.getText()
			VerticalStraightLineGraph(k,ineq)
		End If
	Next index

	if goGraphDialog.getControl(&quot;IntersectCheck&quot;).getState() = 1 and goshadings.count&gt;1 then
		oIntersection = Intersection(goDoc,goShadings)
		oIntersection.Zorder=0
	end if
	
	Call GraphDrawing.Grouper rem fait grouper les objets
	
	Fin:
end sub

&apos;___________________________________________________________________________________________

Sub AutoScaleAxes()
	Dim stFunction(2) as String, xMin(2) as single, xMax(2) as single
	Dim sgap as single, yMin(2) as single, yMax(2) as single
	Dim TempyMin1 as single,TempyMin2 as single,TempyMax1 as single,TempyMax2 as single
	Dim x as single, y as single, index as integer, erflag as integer, nLog as integer
	Dim oNull as object
	
	For index=1 to 2
		if goGraphDialog.getControl(&quot;fCheck&quot; &amp; cStr(index)).getState() = 1 then
			stFunction(index) = ChangeVirgulePoint(goGraphDialog.getControl(&quot;Function&quot; &amp; cStr(index)).Peer.getText())
		&apos; modifié par Didier Dorange-Pattoret
			xMin(index) = goGraphDialog.getControl(&quot;xmin&quot; &amp; cStr(index)).getValue()
			xMax(index) = goGraphDialog.getControl(&quot;xmax&quot; &amp; cStr(index)).getValue()
		else
			xMin(index)=notdef:xMax(index)=notdef
		endif
	Next index
	If min(xMin(1),xMin(2)) = notdef then exit sub
	gsScaleLeft=min(xMin(1), xMin(2))
	gsScaleRight=max(xMax(1),xMax(2))
	sgap=(gsScaleRight-gsScaleLeft)/200

	For index=1 to 2
		if goGraphDialog.getControl(&quot;fCheck&quot; &amp; cStr(index)).getState() = 1 then
			parse (stFunction(index),erflag)
			TempyMin1=notdef : TempyMin2=notdef
			TempyMax1=-notdef : TempyMax2=-notdef
			x=xMin(index)
			Do while x&lt;=xMax(index)
				y=f(x)
				if y&lt;&gt;notdef then
				if y&lt;Tempymin1 then
					TempyMin2=TempyMin1 : TempyMin1=y 
				elseif y&lt;tempyMin2 then
					Tempymin2=y
				end if
				if y&gt;TempyMax1 then
					TempyMax2=TempyMax1 : TempyMax1=y 
				elseif y&gt;tempyMax2 then
					Tempymax2=y
				end if
				end if
				x=x+sgap
			loop			
			if abs(TempyMin1)&gt;1.5*abs(TempyMin2) then yMin(index)=TempyMin2 else yMin(index)=TempyMin1
			if abs(TempyMax1)&gt;1.5*abs(TempyMax2) then yMax(index)=TempyMax2 else yMax(index)=TempyMax1
		endif
	Next index
	
	gsScaleBottom = min(yMin(1),yMin(2))
	gsScaleTop = max(ymax(1), ymax(2))
	nLog=int(log10(gsScaleTop-gsScaleBottom))
	gsScaleBottom = RoundDown(gsScaleBottom,-nLog)
	gsScaleTop = RoundUp(gsScaleTop,-nLog)
		
	goAxesDialog.getControl(&quot;ScaleLeft&quot;).setText(CStr(gsScaleLeft))
&apos;	goAxesDialog.getControl(&quot;ScaleLeft&quot;).TextChanged(oNull)
	goAxesDialog.getControl(&quot;ScaleRight&quot;).setText(CStr(gsScaleRight))
&apos;	goAxesDialog.getControl(&quot;ScaleRight&quot;).TextChanged(oNull)
	goAxesDialog.getControl(&quot;ScaleTop&quot;).setText(CStr(gsScaleTop))
&apos;	goAxesDialog.getControl(&quot;ScaleTop&quot;).TextChanged(oNull)
	goAxesDialog.getControl(&quot;ScaleBottom&quot;).setText(CStr(gsScaleBottom))
&apos;	goAxesDialog.getControl(&quot;ScaleBottom&quot;).TextChanged(oNull)
	
End Sub	

rem macro ajoutée par Didier Dorange-Pattoret
Function ChangeVirgulePoint(sFunction as String) &apos;tranforme la virgule d&apos;un chaine en un point
	Dim I as integer
	For I=1 To Len(sFunction)
	If Mid(sFunction,I,1)=&quot;,&quot; Then Mid(sFunction,I,1,&quot;.&quot;)
	Next I
	ChangeVirgulePoint=sFunction
End Function





</script:module>