/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">'OOoTep
'Copyright (C) 2005-2006 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.
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("nompolice")
s=RetourneOptionOOoTep("taillepolice")
s=RetourneOptionOOoTep("epaisseur0")
s=RetourneOptionOOoTep("epaisseur1")
s=RetourneOptionOOoTep("epaisseur2")
s=RetourneOptionOOoTep("epaisseur3")
s=RetourneOptionOOoTep("epaisseur4")
s=RetourneOptionOOoTep("epaisseur6")
s=RetourneOptionOOoTep("epaisseur7")
s=RetourneOptionOOoTep("epaisseur8")
s=RetourneOptionOOoTep("epaisseur9")
s=RetourneOptionOOoTep("croix0")
s=RetourneOptionOOoTep("croix1")
s=RetourneOptionOOoTep("croix2")
s=RetourneOptionOOoTep("croix3")
s=RetourneOptionOOoTep("rond1")
s=RetourneOptionOOoTep("rond2")
s=RetourneOptionOOoTep("rond3")
s=RetourneOptionOOoTep("codageangle")
s=RetourneOptionOOoTep("codagelongueur")
s=RetourneOptionOOoTep("couleurpolice")
s=RetourneOptionOOoTep("couleurdutrait")
s=RetourneOptionOOoTep("tracenpoche")
s=RetourneOptionOOoTep("optionbutton")
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("OOoTep", "Dialog1")
ChangeTitreDialog(oTepForm)
nCommande = RetourneOptionOOoTep("optionbutton")
Select Case nCommande
case "1"
oTepForm.Model.OptionButton1.State = True
OptionButton1_Click()
case "2"
oTepForm.Model.OptionButton2.State = True
OptionButton2_Click()
case "3"
oTepForm.Model.OptionButton3.State = True
OptionButton3_Click()
End Select
oTepForm.Model.Step = 1
oTepForm.Execute()
RemplaceTexte(clipBoardTexte, chr(10), chr(10) & chr(13))
RemplaceTexte(clipBoardTexte, chr(13) & 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),"@oootep") = 0 then
MsgBox1 "Le script dans la zone texte ne semble pas être correct !"
RetourTepForm = 0
else
oTepForm.Model.Label2.Label = "Analyse du script..."
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 = ""
oTepForm.Model.Label2.Label = "Analyse du script..."
oTepForm.Model.Step = 2
oTepForm.SetPosSize(0, 0, 0, 125, 8)
RetourTepForm = 1
ExtraitLigneTep(ligne, options)
TraceFigure()
End if
oTepForm.Model.Label2.Label = "Sauvegarde Option..."
If oTepForm.Model.OptionButton1.State then nCommande = "1"
If oTepForm.Model.OptionButton2.State then nCommande = "2"
If oTepForm.Model.OptionButton3.State then nCommande = "3"
EcritOptionOOoTep("optionbutton", nCommande)
oTepForm.Model.Label2.Label = "Fin execution Tep..."
oTepForm.EndExecute()
End Sub
Sub OptionButton1_Click()
oTepForm.Model.TextField2.Enabled = True
oTepForm.Model.CommandButton1.Enabled = True
' oTepForm.SetPosSize(0, 0, 0, 100, 8)
if oTepForm.Model.Height>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 = ""
if oTepForm.Model.Height<100 Then oTepForm.Model.Height = oTepForm.Model.Height + oTepForm.Model.TextField1.Height + 15
' 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), ""
RemplaceTexte leTexte, chr(0), ""
oTepForm.Model.TextField2.Enabled = False
oTepForm.Model.CommandButton1.Enabled = False
oTepForm.Model.TextField1.Text = leTexte
if oTepForm.Model.Height<100 Then oTepForm.Model.Height = oTepForm.Model.Height + oTepForm.Model.TextField1.Height + 15
' 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
' on error resume next
oTepForm.Model.Label2.Label = "Le graphisme se prépare..."
oTepForm.GetControl("ProgressBar1").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 <> 0 Then
largeur_cadre = hauteur_cadre * (xmax-xmin) / (ymax-ymin)
xunit = hauteur_cadre / (ymax - ymin)
yunit = xunit
' xmin = gauche_cadre
' ymin = haut_cadre
End if
if ubound(ligne) > 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("ProgressBar1").Value = 100 * i / UBound(ligne())
if ChargeParametre(ligne(i), param(), ";") > 0 then
select case Lcase(param(0))
case "repere"
RemplaceTexte ligne(i), ";", ","
ChargeParametre(param(1), param(), ",")
pasx = val(param(4))
pasy = val(param(5))
AjouteRepere(0, 0, xunit, yunit, pasx, pasy, options(i))
case "repereortho"
RemplaceTexte ligne(i), ";", ","
ChargeParametre(param(1), param(), ",")
' xunit = val(param(2))*1000 / 30
' yunit = xunit
' xorig = 0
' yorig = 0
pasx = val(param(3))
pasy = val(param(4))
AjouteRepere(0, 0, xunit, yunit, pasx, pasy, options(i))
case "var"
AjouteVariable(param(1), "", options(i))
case else
if lcase(left(param(0), 1)) = "@" and lcase(left(param(0), 7)) <> "@figure" and lcase(left(param(0), 7)) <> "@option" then
if lcase(left(param(0), 7)) = "@oootep" then
i = i + 1
oTepForm.GetControl("ProgressBar1").Value = 100 * i / UBound(ligne())
while((left(ligne(i), 1) <> "@") and (i < ubound(ligne)))
' if ChargeParametre(ligne(i), param(), ";") > 0 then
' if Sorte(ChercheObjet(param(0))) = TEP_FONCTION then
' AjouteFonction(param(0), ligne(i), "")
' end if
' end if
i = i + 1
oTepForm.GetControl("ProgressBar1").Value = 100 * i / UBound(ligne())
wend
if left(ligne(i), 1) = "@" then i = i - 1
else
i = i + 1
oTepForm.GetControl("ProgressBar1").Value = 100 * i / UBound(ligne())
while((left(ligne(i), 1) <> "@") and (i < ubound(ligne)))
i = i + 1
oTepForm.GetControl("ProgressBar1").Value = 100 * i / UBound(ligne())
wend
if left(ligne(i), 1) = "@" then i = i - 1
end if
else
if UBound(param) > 0 then
select case LCase(param(1))
case "tangente"
AjouteTangente(param(0), coords(i), options(i))
case "fonction"
AjouteFonction(param(0), ChargeFonction(param(0)), options(i))
case "point"
AjoutePoint(param(0), param(2), options(i))
case "segmentlong"
AjouteSegmentLong(param(0), param(2), options(i), TEP_SEGMENT)
case "segment"
AjouteSegment(param(0), param(2), options(i), TEP_SEGMENT)
case "droite"
AjouteSegment(param(0), param(2), options(i), TEP_DROITE)
case "droiteeqr"
AjouteSegment(param(0), param(2), options(i), TEP_DROITEEQR)
case "droiteeq"
AjouteSegment(param(0), param(2), options(i), TEP_DROITEEQ)
case "droitev"
AjouteSegment(param(0), param(2), options(i), TEP_DROITEV)
case "droiteangle"
AjouteSegment(param(0), param(2), options(i), TEP_DROITEANGLE)
case "demidroite"
AjouteSegment(param(0), param(2), options(i), TEP_DEMIDROITE)
case "polygone"
AjoutePolygone(param(0), param(2), options(i))
case "vecteur"
AjouteSegment(param(0), param(2), options(i), TEP_VECTEUR)
case "vecteurcoord"
AjouteVecteur(param(0), param(2))
case "cercle"
AjouteCercle(param(0), param(2), options(i), TEP_CERCLE)
case "cercledia"
AjouteCercle(param(0), param(2), options(i), TEP_CERCLEDIA)
case "cerclerayon"
AjouteCercle(param(0), param(2), options(i), TEP_CERCLERAYON)
case "pointsur"
AjoutePointSur(param(0), param(2) , options(i), coords(i))
case "parallele"
AjouteDroite(param(0), param(2), options(i), TEP_DROITEPARALLELE)
case "perpendiculaire"
AjouteDroite(param(0), param(2), options(i), TEP_DROITEPERPENDICULAIRE)
case "homothetie"
AjouteHomothetie(param(0), param(2))
case "similitude"
AjouteSimilitude(param(0), param(2))
case "rotation"
AjouteRotation(param(0), param(2))
case "translation"
AjouteTranslation(param(0), param(2))
case "symetrie", "reflexion"
AjouteSymetrie(param(0), param(2))
case "image"
AjouteImage(param(0), param(2), options(i))
case "symetrique"
AjouteSymetrique(param(0), param(2), options(i))
case "angle"
AjouteArc(param(0), param(2), options(i), TEP_ANGLE)
case "arc"
AjouteArc(param(0), param(2), options(i), TEP_ARC)
case "barycentre"
AjouteBarycentre(param(0), param(2), options(i))
case "bissectrice"
AjouteBissectrice(param(0), param(2), options(i))
case "entier", "reel"
AjouteReel(param(0), param(2), coords(i), options(i))
case "distance"
AjouteDistance(param(0), param(2), options(i))
case "aire"
AjouteAire(param(0), param(2), options(i))
case "perimetre"
AjoutePerimetre(param(0), param(2), options(i))
case "milieu"
AjouteMilieu(param(0), param(2), options(i))
case "mediatrice"
AjouteMediatrice(param(0), param(2), options(i))
case "groupe"
AjouteGroupe(param(0), param(2), options(i))
case "projete"
AjouteProjete(param(0), param(2), options(i))
case "intersection"
AjouteIntersection(param(0), param(2), options(i), coords(i))
case "texte"
AjouteTexte(param(0), param(2), options(i), coords(i))
case "mesurearc"
AjouteMesureArc(param(0), param(2), options(i))
end select
else
select case LCase(param(0))
case "radians"
angle_en_radian = True
end Select
end If
end if
end select
end if
next i
oTepForm.Model.Label2.Label = "Finalisation des tracés..."
TermineDessin()
end if
End Sub
</script:module>
|