/usr/lib/libreoffice/share/extensions/DmathsAddon/OOoGdmath/Rapporteur.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 | <?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="Rapporteur" script:language="StarBasic">'OOoGdmath
'Copyright (C) 2005-2009 Gilles Daurat
'This program is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public License
'as published by the Free Software Foundation; either version 2
'of the License, or (at your option) any later version.
'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'GNU General Public License for more details.
'You should have received a copy of the GNU General Public License
'along with this program; if not, write to the Free Software
'Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Option Explicit
Dim oRapporteurForm as Object
Sub Main
oRapporteurForm=LoadDialog("OOoGdmath","RapporteurForm")
ChangeTitreDialog(oRapporteurForm)
oRapporteurForm.Model.Step=1
' RestaureForm(oRapporteurForm)
oRapporteurForm.Execute()
End Sub
Private Sub RapporteurForm_CheckBox1_Click()
oRapporteurForm.Model.CheckBox4.Enabled = oRapporteurForm.Model.CheckBox1.State
End Sub
Private Sub RapporteurForm_CheckBox2_Click()
oRapporteurForm.Model.CheckBox5.Enabled = oRapporteurForm.Model.CheckBox2.State
End Sub
Private Sub RapporteurForm_CheckBox3_Click()
oRapporteurForm.Model.CheckBox6.Enabled = oRapporteurForm.Model.CheckBox3.State
End Sub
Private Sub RapporteurForm_CheckBox7_Click()
oRapporteurForm.Model.CheckBox8.Enabled = oRapporteurForm.Model.CheckBox7.State
oRapporteurForm.Model.TextBox1.Enabled = oRapporteurForm.Model.CheckBox7.State
oRapporteurForm.Model.Label1.Enabled = oRapporteurForm.Model.CheckBox7.State
End Sub
Private Sub RapporteurForm_CheckBox9_Click()
oRapporteurForm.Model.CheckBox10.Enabled = oRapporteurForm.Model.CheckBox9.State
End Sub
Private Sub RapporteurForm_CommandButton1_Click()
Dim unnom As String
Dim posx, posy, a, i, can, san, an
Dim unArc as Object
Dim Shapes as Object
Dim rayon,pg,ng,gg,tg,pt
Dim t1 as String
oRapporteurForm.Model.Step = 2
oRapporteurForm.Model.Label4.Label = Chaine("tracrapp") '"Tracé du rapporteur"
InitialiseDessin(False)
Shapes=InitialiseGroupe
PointInsertion posx, posy
t1 = oRapporteurForm.Model.TextField1.Text
RemplaceVirgulePoint t1
rayon = val(t1)*1000
pg = 200
ng = 300
gg = 500
tg = 700
pt = 800
if oRapporteurForm.Model.OptionButton2.State then
unArc=InsereCercle(posx,posy,rayon,Shapes)
else
unArc=InsereArcDeCercle(posx,posy,0,18000,rayon,Shapes)
end if
InsereLigne posx - MIif(oRapporteurForm.Model.OptionButton2.State,400,rayon), posy, posx + rayon, posy,Shapes
InsereLigne posx, posy - 400, posx, posy + 400, Shapes
InsereLigne posx, posy - rayon/2+tg, posx, posy - rayon/2-tg, Shapes
If oRapporteurForm.Model.OptionButton2.State Then
InsereLigne posx, posy + rayon/2+tg, posx, posy + rayon/2-tg, Shapes
InsereLigne posx - rayon/2+tg, posy, posx - rayon/2-tg, posy, Shapes
End If
If oRapporteurForm.Model.CheckBox1.State Then
oRapporteurForm.Model.Label4.Label = Chaine("tracgrad10") '"Tracé des graduations 10°.."
a = (rayon - gg) * (1 - oRapporteurForm.Model.CheckBox4.State)
For i = 10 To MIif(oRapporteurForm.Model.OptionButton2.State,350,170) Step 10
can = Cos(i * Pi / 180)
san = Sin(i * Pi / 180)
InsereLigne posx + a * can, posy - a * san, posx + rayon * can, posy - rayon * san, Shapes
If oRapporteurForm.Model.CheckBox9.State Then
InsereTexte(Trim(Str(i)), posx + (rayon-pt) * can, posy - (rayon-pt) * san, Shapes,(i - 90)*100,0,0).Text.CharHeight=10
If oRapporteurForm.Model.CheckBox10.State Then InsereTexte(Trim(Str(180 - 180 * oRapporteurForm.Model.OptionButton2.State - i)), posx + (rayon-pt) * can, posy - (rayon-pt) * san, Shapes,(i - 90 - 180 * oRapporteurForm.Model.OptionButton2.State)*100,0,0).Text.CharHeight=10
End If
Next i
End If
If oRapporteurForm.Model.CheckBox2.State Then
oRapporteurForm.Model.Label4.Label =Chaine("tracgrad5") '"Tracé des graduations 5°.."
a = (rayon - ng) * (1 - oRapporteurForm.Model.CheckBox5.State)
For i = 5 To MIif(oRapporteurForm.Model.OptionButton2.State,355,175) Step MIif(oRapporteurForm.Model.CheckBox1.State,10,5)
can = Cos(i * Pi / 180)
san = Sin(i * Pi / 180)
InsereLigne posx + a * Can, posy - a * San, posx + rayon * Can, posy - rayon * San, Shapes
Next i
End If
If oRapporteurForm.Model.CheckBox3.State Then
oRapporteurForm.Model.Label4.Label = Chaine("tracgrad1") '"Tracé des graduations 1°.."
a = (rayon - pg) * (1 - oRapporteurForm.Model.CheckBox6.State)
For i = 1 To MIif(oRapporteurForm.Model.OptionButton2.State,359,179)
can = Cos(i * Pi / 180)
san = Sin(i * Pi / 180)
If Not (Int(i / 10) * 10 = i And oRapporteurForm.Model.CheckBox1.State) And Not (Not (Int(i / 10) * 10 = i) And Int(i / 5) * 5 = i And oRapporteurForm.Model.CheckBox2.State) Then
InsereLigne posx + a * can, posy - a * san, posx + rayon * can, posy - rayon * san, Shapes
End If
Next i
End If
If oRapporteurForm.Model.CheckBox7.State Then
oRapporteurForm.Model.Label4.Label = Chaine("tracgrad") '"Tracé des graduations autres.."
a = (rayon - tg) * (1 - oRapporteurForm.Model.CheckBox8.State)
For i = 1 To Int(Val(oRapporteurForm.Model.TextBox1.Text)) - 1
an = i * ((180 - 180 * oRapporteurForm.Model.OptionButton2.State) / Val(oRapporteurForm.Model.TextBox1.Text)) * Pi / 180
can = Cos(i * Pi / 180)
san = Sin(i * Pi / 180)
InsereLigne posx + a * can, posy - a * san, posx + rayon * can, posy - rayon * san, Shapes
Next i
End If
oRapporteurForm.Model.Label4.Label = Chaine("tracfin") '"Finalisation du tracé.."
GroupeObjet(Shapes)
oRapporteurForm.EndExecute()
sauveForm(oRapporteurForm)
TermineDessin()
End Sub
Private Sub RapporteurForm_CommandButton2_Click()
oRapporteurForm.EndExecute()
End Sub
</script:module>
|