/usr/lib/libreoffice/share/extensions/DmathsAddon/OOoGdmath/ArcDCForm.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 | <?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="ArcDCForm" 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 oArcDCForm as Object
Sub Main
REM '' and AfficheArcDCForm() by Gisbert
'' oArcDCForm = LoadDialog("OOoGdmath", "ArcDCForm")
'' ChangeTitreDialog(oArcDCForm)
' ChargeCouleurDefaut oArcDCForm.Model.ImageControl1
' ChargeCouleurDefaut oArcDCForm.Model.ImageControl2
' RestaureForm(oArcDCForm)
'' oArcDCForm.Execute()
AfficheArcDCForm()
End Sub
Sub AfficheArcDCForm()
oArcDCForm = LoadDialog("OOoGdmath","ArcDCForm")
ChangeTitreDialog(oArcDCForm)
oArcDCForm.Model.Image1.ImageURL=fCheminImages & "arccercle.gif"
'' RestaureForm(oArcDCForm)
oArcDCForm.Execute()
End Sub
Private Sub ArcDCForm_CheckBox1_Click()
oArcDCForm.Model.TextField4.Enabled = oArcDCForm.Model.CheckBox1.State
oArcDCForm.Model.Label7.Enabled = oArcDCForm.Model.CheckBox1.State
End Sub
Private Sub ArcDCForm_CheckBox3_Click()
oArcDCForm.Model.TextField5.Enabled = oArcDCForm.Model.CheckBox3.State
End Sub
Private Sub ArcDCForm_CommandButton1_Click()
Dim posx, posy, angled as long, anglea as long, rayon, centrevisible as boolean, NomCentre, rayonvisible as boolean
Dim UneForme, x0, y0, x1, y1, x2, y2, UneLigne$, ga, gb, x3, y3, x4, y4, xn, yn
Dim Shapes as Object
oArcDCForm.EndExecute()
sauveForm(oArcDCForm)
InitialiseDessin(False)
Shapes = InitialiseGroupe()
If (oArcDCForm.Model.Label8.Label <> "") Then
posx = Val(oArcDCForm.Model.Label10.Label)
posy = Val(oArcDCForm.Model.Label11.Label)
Else
PointInsertion posx, posy
End If
angled = oArcDCForm.Model.TextField1.Text
RemplaceVirgulePoint angled
anglea = oArcDCForm.Model.TextField2.Text
RemplaceVirgulePoint anglea
anglea = Val(angled) + Abs(Val(anglea))
rayon = oArcDCForm.Model.TextField3.Text
RemplaceVirgulePoint rayon
rayon = Val(rayon) * 1000
centrevisible = oArcDCForm.Model.CheckBox1.State
NomCentre = ""
If centrevisible Then NomCentre = oArcDCForm.Model.TextField4.Text
rayonvisible = oArcDCForm.Model.CheckBox2.State
InsereArcDeCercle posx, posy, angled * 100, anglea * 100, rayon, Shapes, oArcDCForm.Model.ImageControl1
x0 = posx
y0 = posy
x1 = x0 + rayon * Cos(angled * Pi / 180)
y1 = y0 - rayon * Sin(angled * Pi / 180)
x2 = x0 + rayon * Cos(anglea * Pi / 180)
y2 = y0 - rayon * Sin(anglea * Pi / 180)
If centrevisible Then
InsereLigne x0 - 100, y0 - 100, x0 + 100, y0 + 100, Shapes, oArcDCForm.Model.ImageControl1
InsereLigne x0 - 100, y0 + 100, x0 + 100, y0 - 100, Shapes, oArcDCForm.Model.ImageControl1
NormaliseCoordonnees(xn, yn, x1, y1, x0, y0, x2, y2)
InsereTexte NomCentre, xn, yn, Shapes, 0, 0, 0
End If
If rayonvisible Then
InsereLigne x0, y0, x1, y1, Shapes, oArcDCForm.Model.ImageControl2
InsereLigne x0, y0, x2, y2, Shapes, oArcDCForm.Model.ImageControl2
End If
If oArcDCForm.Model.CheckBox3.State Then
If Not rayonvisible Then
x3 = x1 + 100 * Cos(angled * Pi / 180)
y3 = y1 - 100 * Sin(angled * Pi / 180)
x4 = x1 - 100 * Cos(angled * Pi / 180)
y4 = y1 + 100 * Sin(angled * Pi / 180)
InsereLigne x3, y3, x4, y4, Shapes, oArcDCForm.Model.ImageControl1
x3 = x2 + 100 * Cos(anglea * Pi / 180)
y3 = y2 - 100 * Sin(anglea * Pi / 180)
x4 = x2 - 100 * Cos(anglea * Pi / 180)
y4 = y2 + 100 * Sin(anglea * Pi / 180)
InsereLigne x3, y3, x4, y4, Shapes, oArcDCForm.Model.ImageControl1
End If
NormaliseCoordonnees(xn, yn, x0, y0, x1, y1, x2, y2)
InsereTexte Left$(oArcDCForm.Model.TextField5.Text, 1), xn, yn, Shapes, 0, 0, 0
NormaliseCoordonnees(xn, yn, x0, y0, x2, y2, x1, y1)
InsereTexte Right$(oArcDCForm.Model.TextField5.Text, 1), xn, yn, Shapes, 0, 0, 0
End If
GroupeObjet(Shapes)
TermineDessin()
End Sub
Private Sub ArcDCForm_CommandButton2_Click()
oArcDCForm.EndExecute()
End Sub
Private Sub ArcDCForm_ImageControl1_Click()
ChangeCouleur oArcDCForm.Model.ImageControl1
End Sub
Private Sub ArcDCForm_ImageControl2_Click()
ChangeCouleur oArcDCForm.Model.ImageControl2
End Sub
</script:module>
|