This file is indexed.

/usr/lib/libreoffice/share/extensions/DmathsAddon/OOoGdmath/DivisionCode.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
<?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="DivisionCode" script:language="StarBasic">&apos;OOoGdmath
&apos;Copyright (C) 2005-2009  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.

Option Explicit

Global oDivisionForm as object

Sub Main
	oDivisionForm = LoadDialog(&quot;OOoGdmath&quot;,&quot;DivisionForm&quot;)
	ChangeTitreDialog(oDivisionForm)
&apos;	RestaureForm(oDivisionForm)
	oDivisionForm.Execute()
End Sub

Private Sub DivisionCode_CheckBox1_Click()
    oDivisionForm.Model.TextBox4.Enabled = oDivisionForm.Model.CheckBox1.State
End Sub

Private Sub DivisionCode_CommandButton1_Click()
Dim DD, d, param() as string

    oDivisionForm.EndExecute
	sauveForm(oDivisionForm)
	ChargeParametre oDivisionForm.Model.TextBox1.Text, param(), &quot;/&quot;
	DD=param(0)
	d=param(1)
    RemplaceVirgulePoint DD
    RemplaceVirgulePoint d
    InsereDivisionEntiere DD, d, MIif(oDivisionForm.Model.CheckBox1.State, MIif(oDivisionForm.Model.TextBox4.Text = &quot;&quot;, &quot;.&quot;, oDivisionForm.Model.TextBox4.Text), &quot;&quot;)
End Sub

Private Sub DivisionCode_CommandButton2_Click()
    oDivisionForm.EndExecute
End Sub

Private Sub DivisionCode_Image1_Click()
    ChangeCouleur oDivisionForm.Model.Image1
End Sub

Private Sub DivisionCode_TextBox4_Change()
    oDivisionForm.Model.TextBox4.Text = Left$(oDivisionForm.Model.TextBox4.Text, 1)
End Sub

Sub InsereDivisionEntiere(DD, d, OperationTrou)
Dim l,h, nchiffre, nchiffred, nchiffreq, nDD, zz, Q, qq$, Debut, DD1
Dim restei, qqTempo$, i, DD2, qi, di$, j
Dim Shapes as Object

	InitialiseDessin(False)
    Shapes=InitialiseGroupe
    DimensionTexte &quot;8&quot;,12,l,h
    
    nchiffre = Val(oDivisionForm.Model.TextBox3.Text)
    
    nchiffred = InStr(1, DD, &quot;.&quot;)
    If nchiffred &lt;&gt; 0 Then nchiffred = Len(DD) - nchiffred
    nchiffreq = InStr(1, d, &quot;.&quot;)
    If nchiffreq &lt;&gt; 0 Then nchiffreq = Len(d) - nchiffreq
    
    If nchiffreq &gt; 0 Then
        DD = Trim(Val(DD) * 10 ^ nchiffreq)
        d = Trim(Val(d) * 10 ^ nchiffreq)
        nchiffred = InStr(1, DD, &quot;.&quot;)
        If nchiffred &lt;&gt; 0 Then nchiffred = Len(DD) - nchiffred
        nchiffreq = InStr(1, d, &quot;.&quot;)
        If nchiffreq &lt;&gt; 0 Then nchiffreq = Len(d) - nchiffreq
    End If
    
    If nchiffre &lt; nchiffred Then nchiffre = nchiffred
    If nchiffre &lt; nchiffred Then
        nchiffre = nchiffred
        nDD = DD
    Else
        nDD = Str(Val(DD) * (10 ^ nchiffre))
        nDD = Right$(nDD, Len(nDD) - 1)
        If Val(DD) &lt; 1 Then nDD = &quot;0&quot; &amp; nDD
    End If
    zz = MIif(Val(DD) &lt; Val(d), &quot;0&quot;, &quot;&quot;)
    DD = nDD
    If Val(d) = Int(Val(d)) Then
        Q = Str(Int(Val(DD) / Val(d)))
        qq$ = zz &amp; Right$(Q, Len(Q) - InStr(1, Q, &quot; &quot;))
        If Len(qq$) &lt;= nchiffre Then qq$ = &quot;0&quot; &amp; qq$
        Debut = Len(DD) - Len(qq$)
        DD1 = Left$(DD, Debut)
        InsereLigne 2*l * (Len(DD)  - Debut+1.2), h*(1+0.2), 2*l * (Len(DD)  - Debut+1.2), h*(3+0.2), Shapes, oDivisionForm.Model.Image1
        InsereLigne 2*l * (Len(DD)  - Debut+1.2), h*(2+0.2), 2*l * (Len(DD)  - Debut + Len(d)+1.5), h*(2+0.2), Shapes, oDivisionForm.Model.Image1
        AfficheTexte Len(DD) + 1 - Debut, 1, DD, nchiffre &gt; 0, nchiffre, Shapes,l,h
        AfficheTexte Len(DD) + 2 - Debut + Len(d), 1, d, False, 0, Shapes,l,h
        If OperationTrou &lt;&gt; &quot;&quot; Then
            qqTempo$ = qq$
            RemplaceChiffreCaractere qq$, OperationTrou
            AfficheTexte Len(DD) + 2 - Debut + Len(qq$), 2, qq$, nchiffre &gt; 0, nchiffre, Shapes,l,h
            qq$ = qqTempo$
        Else
            AfficheTexte Len(DD) + 2 - Debut + Len(qq$), 2, qq$, nchiffre &gt; 0, nchiffre, Shapes,l,h
        End If
        For i = 1 To Len(qq)
            DD2 = DD1 &amp; Mid$(DD, Debut + i, 1)
            qi = Mid$(qq$, i, 1)
            di$ = Str(Val(qi) * Val(d))
            di$ = Right$(di, Len(di$) - 1)
            restei = Str(Val(DD2) - Val(di$))
            DD1 = Right$(restei, Len(restei) - 1)
            For j = 1 To Len(DD2) - Len(di$)
                di$ = &quot; &quot; &amp; di$
            Next j
            If i = Len(qq$) Then
                AfficheDivisionP i + 1, 2 * i, di$, DD1 &amp; &quot; &quot;, OperationTrou,Shapes,l,h
            Else
                AfficheDivisionP i + 1, 2 * i, di$, DD1 &amp; Mid$(DD, Debut + i + 1, 1), OperationTrou,Shapes,l,h
            End If
        Next i
		Dim aPoint As New com.sun.star.awt.Point
	    Dim TheSize as new com.sun.star.awt.Size
	    Dim Group as Object
    
		aPoint.x=3000
		aPoint.y=3000
		Group = GroupeObjet(Shapes)
		Group.Position=aPoint
		TermineDessin()
    Else
    End If
End Sub

Sub AfficheDivisionP(x, y, d$, r$, OperationTrou,Shapes,l,h)
    If oDivisionForm.Model.CheckBox2.State Then
        If OperationTrou &lt;&gt; &quot;&quot; Then RemplaceChiffreCaractere d$, OperationTrou
        AfficheTexte x, y, &quot;-&quot; &amp; d$, False, 0, Shapes,l,h
        InsereLigne 2*l * (x - 1.5 - Len(d$)),  h * (y + 1.2), 2*l * (x - 0.5),  h * (y + 1.2), Shapes, oDivisionForm.Model.Image1
    End If
    If OperationTrou &lt;&gt; &quot;&quot; Then RemplaceChiffreCaractere r$, OperationTrou
    If oDivisionForm.Model.CheckBox2.State Then
        AfficheTexte x + 1, y + 1, r$, False, 0, Shapes,l,h
    Else
        AfficheTexte x + 1, Int(y / 2) + 1, r$, False, 0, Shapes,l,h
    End If
End Sub

</script:module>