/usr/lib/libreoffice/share/extensions/DmathsAddon/Dmaths/Tableau.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="Tableau" script:language="StarBasic">'************************************************
'Copyright (C) 2008 Didier Dorange-Pattoret
'38, chemin de l'Abbaye
'74940 Annecy le Vieux
'France
'ddorange@dmaths.com
'
'
'This library is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public Licence (GPL)
'as published by the Free Software Foundation; either
'version 2.1 of the License, or (at your option) any later version.
'This library 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 Licence (GPL)
'along with this library; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'*************************************************
Public oDialogTableau as Object
Sub LanceCreationTableau
Call VerifOperationnel
oDialogTableau = LoadDialog("Dmaths","Tableau")
oDialogTableau.Execute()
End Sub
Sub FinCreationTableau
oDialogTableau.EndExecute()
End Sub
Sub InsereTableau
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
dim inrows, incols,iflag as integer
rem ----------------------------------------------------------------------
rem get access to the document
oDesktop = createUnoService("com.sun.star.frame.Desktop")
document= oDesktop.getCurrentComponent().getCurrentController()
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
inrows = Csng(oDialogTableau.Model.TextField1.Text)
incols = Csng(oDialogTableau.Model.TextField2.Text)
If oDialogTableau.Model.CheckBox1.State = 1 and oDialogTableau.Model.CheckBox2.State = 1 Then iflag = 15
If oDialogTableau.Model.CheckBox1.State = 0 and oDialogTableau.Model.CheckBox2.State = 0 Then iflag = 8
If oDialogTableau.Model.CheckBox1.State = 1 and oDialogTableau.Model.CheckBox2.State = 0 Then iflag = 14
If oDialogTableau.Model.CheckBox1.State = 0 and oDialogTableau.Model.CheckBox2.State = 1 Then iflag = 9
dim args1(3) as new com.sun.star.beans.PropertyValue
args1(0).Name = "TableName"
args1(0).Value = "Tableau1"
args1(1).Name = "Columns"
args1(1).Value = incols
args1(2).Name = "Rows"
args1(2).Value = inrows
args1(3).Name = "Flags"
args1(3).Value = iflag
dispatcher.executeDispatch(document, ".uno:InsertTable", "", 0, args1())
If oDialogTableau.Model.CheckBox3.State = 1 or oDialogTableau.Model.CheckBox4.State = 1 Then
rem ----------------------------------------------------------------------
dim args2(1) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Count"
args2(0).Value = inrows - 1
args2(1).Name = "Select"
args2(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(1) as new com.sun.star.beans.PropertyValue
args3(0).Name = "Count"
args3(0).Value = incols - 1
args3(1).Name = "Select"
args3(1).Value = true
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args3())
If oDialogTableau.Model.CheckBox3.State = 1 Then
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "CenterPara"
args4(0).Value = true
dispatcher.executeDispatch(document, ".uno:CenterPara", "", 0, args4())
Endif
If oDialogTableau.Model.CheckBox4.State = 1 Then
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "CellVertCenter"
args5(0).Value = true
dispatcher.executeDispatch(document, ".uno:CellVertCenter", "", 0, args5())
Endif
dim args6(1) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Count"
args6(0).Value = incols - 1
args6(1).Name = "Select"
args6(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoLeft", "", 0, args6())
dim args7(1) as new com.sun.star.beans.PropertyValue
args7(0).Name = "Count"
args7(0).Value = inrows - 1
args7(1).Name = "Select"
args7(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoUp", "", 0, args7())
Endif
rem -------------------------------------------------------------------------
rem copie les donnees du tableau dans DMoptionstableau
Dim sSource,sNbreLignes,sNbreColonnes,sTitre,sBordure,sCentreH,sCentreV as String
sNbreLignes = oDialogTableau.Model.TextField1.Text
sNbreColonnes = oDialogTableau.Model.TextField2.Text
If oDialogTableau.Model.CheckBox1.State=1 Then sTitre = "TRUE" Else sTitre = "FALSE"
If oDialogTableau.Model.CheckBox2.State=1 Then sBordure = "TRUE" Else sBordure = "FALSE"
If oDialogTableau.Model.CheckBox3.State=1 Then sCentreH = "TRUE" Else sCentreH = "FALSE"
If oDialogTableau.Model.CheckBox4.State=1 Then sCentreV = "TRUE" Else sCentreV = "FALSE"
sSource="Rem (C) Didier Dorange-Pattoret www.dmaths.com"+Chr(13)
sSource=sSource+"Public const iNbreLignes = "+sNbreLignes+Chr(13)
sSource=sSource+"Public const iNbreColonnes = "+sNbreColonnes+Chr(13)
sSource=sSource+"Public const bTitre = "+sTitre+Chr(13)
sSource=sSource+"Public const bBordure = "+sBordure+Chr(13)
sSource=sSource+"Public const bCentreHorizontal = "+sCentreH+Chr(13)
sSource=sSource+"Public const bCentreVertical = "+sCentreV+Chr(13)
sSource=sSource+"Sub MyTest3" & Chr(13) & "Print ""Vive Dmaths !""" & Chr(13) & "End Sub"
Dim oLib as Object
rem Dim sLib as String
Dim sMod as String
sMod = "DmOptionsTableau"
oLib = GlobalScope.BasicLibraries.Standard
If oLib.hasByName(sMod) Then
oLib.removeByName(sMod)
EndIf
oLib.InsertByName(sMod,sSource)
rem ------------------------------------------------------------------------------------------
oDialogTableau.EndExecute()
End Sub
</script:module>
|