This file is indexed.

/usr/lib/libreoffice/share/extensions/canzeley-client/Kanzleiprogramm/DiaMod2.xba is in libreoffice-canzeley-client 0.5.0-2.

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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<?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="DiaMod2" script:language="StarBasic">REM                        *****  BASIC  *****
REM        	              ***** Canzeley *****
REM              Copyright (C) 2010, 2011, 2012 Dr. Michael Stehmann
REM                  info@rechtsanwalt-stehmann.de
REM This program is free software: you can redistribute it and/or modify it
REM under the terms of the GNU General Public License as published by the
REM Free Software Foundation, either version 3 of the License, or any later version.
REM This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
REM without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
REM See the GNU General Public License for more details.
REM You should have received a copy of the GNU General Public License along with this program.
REM If not, see &lt;http://www.gnu.org/licenses/&gt;.
REM                      *** Version 0.5.0 ***

REM **** Kanzleiprogramm - DiaMod2****

REM **** Dieses Modul enthaelt Makros zur Generation von Laufzeitdialogen ****

Option explicit

Private oMod As Object REM * Objekt enthaelt die Eigenschaften von Steuerelementen *
Private oDlgM As Object REM * Objekt enthaelt das Modell eines Dialoges *

REM **** Die folgenden Makros enthalten ein Beispiel, mit welchem ****
REM **** ein Dialog zur Abfrage des Geschlechts erzeugt werden kann **** 
Sub DialogGendern

Dim iOk As Integer

CDialogErzeugen (&quot;Gendern&quot;, &quot;Gendern-Dialog&quot;)
CDialogGeo (100, 100, 300, 100)
CDiaStandardHintergrundfarbe

SEMaennlich REM * Optionsfeld &quot;männlich&quot;
SEWeiblich  REM * Optionsfeld &quot;weiblich&quot;
SEOk        REM * OK-Schaltfläche
SEAbbrechen REM * Abbrechen-Schaltfläche
CDialogAnzeigen1
CDialogAnzeigen2

 	iOk = CDiaRueckgabe

	If iOk = 1 Then
	GendernAusgabe
	Else
		MsgBox (&quot;Na gut, wenn sie nicht wollen ... &quot;, 48, &quot;Abbruch&quot;)
	End If
	
End Sub


Sub SEMaennlich

CSteuerelement (&quot;Optionsfeld&quot;)
CControlLabel (&quot;männlich&quot;, 10, 200)
CControlGeo (15, 50, 5, 10)
CControlAlign (0, 2)
CCStandardBGColor
CSteuerelementEinfuegen (&quot;ME&quot;, &quot;Männlich - Einzahl&quot;)

End Sub


Sub SEWeiblich

CSteuerelement (&quot;Optionsfeld&quot;)
CControlLabel (&quot;weiblich&quot;, 10, 200)
CControlGeo (15, 50, 5, 25)
CControlAlign (0, 2)
CCStandardBGColor
CSteuerelementEinfuegen (&quot;WE&quot;, &quot;Weiblich - Einzahl&quot;)

End Sub


Sub SEOk

CSteuerelement (&quot;OK&quot;)
CControlLabel (&quot;Einfügen&quot;, 10, 100)
CControlGeo (15, 40, 5, 60)
CControlAlign (1, 2)
CControlTabStop (1)
CSteuerelementEinfuegen (&quot;OKButton&quot;, &quot;Bitte Anklicken&quot;)

End Sub


Sub SEAbbrechen

CSteuerelement (&quot;Cancel&quot;)
CControlLabel (&quot;Abbrechen&quot;, 10, 100)
CControlGeo (15, 40, 50, 60)
CControlAlign (1, 2)
CControlTabStop (2)
CSteuerelementEinfuegen (&quot;AbbruchButton&quot;, &quot;Bitte Anklicken&quot;)

End Sub


Sub GendernAusgabe

Dim sGender As String

	sGender = GendernErgebnis
	
	If sGender =&quot;&quot; Then
		MsgBox (&quot;Sie haben keine Auswahl getroffen!&quot;, 48, &quot;Nochmal versuchen!&quot;)
	DialogGendern
	Else
		MsgBox (&quot;Ihre Auswahl betraf eine &quot; &amp; sGender &amp; &quot; Person&quot;, 64, &quot;Ergebnis:&quot;)	
	End If
	
End Sub


Function GendernErgebnis

	If oDlgEF.GetControl(&quot;WE&quot;).state Then
		GendernErgebnis	= &quot;weibliche&quot;
	ElseIF oDlgEF.GetControl(&quot;ME&quot;).state Then
		GendernErgebnis	= &quot;männliche&quot;
	End IF

End Function


REM **** Ab hier enthaelt dieses Modul Makros zur Generation von Laufzeitdialogen ****

Sub CDialogErzeugen (sDiaTitle As String, sDiaName As String)

	oDlgM = CreateUnoService (&quot;com.sun.star.awt.UnoControlDialogModel&quot;)
	oDlgM.setPropertyValue(&quot;Name&quot;, sDiaName)
	oDlgM.setPropertyValue(&quot;Title&quot;, sDiaTitle)
	
End Sub

	
Sub CDialogGeo(iDiaHoehe As Integer, iDiaWeite As Integer, iDiaPosX As Integer, iDiaPosY As Integer)

	oDlgM.setPropertyValue(&quot;Height&quot;, iDiaHoehe)
	oDlgM.setPropertyValue(&quot;Width&quot;, iDiaWeite)
	oDlgM.setPropertyValue(&quot;PositionX&quot;, iDiaPosX)
	oDlgM.setPropertyValue(&quot;PositionY&quot;, iDiaPosY)
		
End Sub


Sub CDiaStandardHintergrundfarbe

CDiaHintergrund (165,186,214)

End Sub


Sub CDiaHintergrund (iDRot As Integer, iDGruen As Integer, iDBlau As Integer)

	oDlgM.setPropertyValue(&quot;BackgroundColor&quot;, RGB (iDRot, iDGruen, iDBlau))

End Sub


Sub CDialogSeite (iStep As Integer)
	
	oDlgM.setPropertyValue(&quot;Step&quot;, iStep)
	
End Sub


Sub CSteuerelement (sArt As String)

	Select Case sArt
	
		Case &quot;Schaltflaeche&quot;
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
			
		Case &quot;OK&quot;
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
			oMod.setPropertyValue(&quot;PushButtonType&quot;, com.sun.star.awt.PushButtonType.OK)
			
		Case &quot;Cancel&quot;
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlButtonModel&quot;)
			oMod.setPropertyValue(&quot;PushButtonType&quot;, com.sun.star.awt.PushButtonType.CANCEL)
			
		Case &quot;Beschriftungsfeld&quot;	
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlFixedTextModel&quot;)
			
		Case &quot;Textfeld&quot;
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlEditModel&quot;)
			oMod.setPropertyValue(&quot;HScroll&quot;, True)
			
		Case &quot;Listenfeld&quot;	
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlListBoxModel&quot;)
			
		Case &quot;Zahlenfeld&quot;	
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlNumericFieldModel&quot;)
			
		Case &quot;Waehrungsfeld&quot;
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlCurrencyFieldModel&quot;)
			oMod.setPropertyValue(&quot;DecimalAccuracy&quot;, 2)
			oMod.setPropertyValue(&quot;ShowThousandsSeparator&quot;, True)
			oMod.setpropertyValue(&quot;CurrencySymbol&quot;, &quot;&quot;)

		Case &quot;Datumsfeld&quot;
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlDateFieldModel&quot;)
			oMod.setPropertyValue(&quot;DateFormat&quot;, 7)	
			oMod.setPropertyValue(&quot;StrictFormat&quot;, True)
			oMod.setPropertyValue(&quot;Dropdown&quot;, True)
			
		Case &quot;Optionsfeld&quot;		
			oMod = oDlgM.CreateInstance (&quot;com.sun.star.awt.UnoControlRadioButtonModel&quot;)
		
	End Select

End Sub


Sub CControlLabel (sCLabel As String, iFontHeight As Integer, iFontWeight As Integer)

Dim oFont As New com.sun.star.awt.FontDescriptor

REM * FontDescriptor mit Werten fuellen *

	oFont.Name = &quot;Liberation Sans&quot;
	oFont.Height = iFontHeight
	oFont.Weight = iFontWeight

	oMod.setPropertyValue(&quot;Label&quot;, sCLabel)
	oMod.setPropertyValue(&quot;FontDescriptor&quot;, oFont)

End Sub


Sub CControlText (sCText As String, iFontHeight As Integer, iFontWeight As Integer)

Dim oFont As New com.sun.star.awt.FontDescriptor

REM * FontDescriptor mit Werten fuellen *

	oFont.Name = &quot;Liberation Sans&quot;
	oFont.Height = iFontHeight
	oFont.Weight = iFontWeight

	oMod.setPropertyValue(&quot;Text&quot;, sCText)
	oMod.setPropertyValue(&quot;FontDescriptor&quot;, oFont)

End Sub


Sub CControldatum (lCDatum As Long)

	If bDateStruct = false Then
		oMod.setPropertyValue(&quot;Date&quot;, lCDatum)
	Else
		Dim sCDatum As String
		sCDatum = CDateFromIso(lCDatum)
		oMod.setPropertyValue(&quot;Date&quot;, LibOMod.LibOStruct(sCDatum))
	End If
		
End Sub


Sub CControlGeo (iControlHoehe As Integer, iControlWeite As Integer, iControlPosX As Integer, iControlPosY As Integer)

	oMod.setPropertyValue(&quot;Height&quot;, iControlHoehe)
	oMod.setPropertyValue(&quot;Width&quot;, iControlWeite)
	oMod.setPropertyValue(&quot;PositionX&quot;, iControlPosX)
	oMod.setPropertyValue(&quot;PositionY&quot;, iControlPosY)
	
End Sub


Sub CControlAlign (iAlign As Integer, iVAlign As Integer)

	oMod.setPropertyValue(&quot;Align&quot;, iAlign) REM 0 = left, 1 = center, 2 = right
	
REM * Funktioniert erst ab OpenOffice.org Version 3.3 *
	Select Case iVAlign
	
		Case 0
			REM * Macht Nichts *
		Case 1
			oMod.setPropertyValue(&quot;VerticalAlign&quot;, com.sun.star.style.VerticalAlignment.TOP)
		Case 2
			oMod.setPropertyValue(&quot;VerticalAlign&quot;, com.sun.star.style.VerticalAlignment.MIDDLE)
		Case 3
			oMod.setPropertyValue(&quot;VerticalAlign&quot;, com.sun.star.style.VerticalAlignment.BOTTOM)
		Case Else
			oMod.setPropertyValue(&quot;VerticalAlign&quot;, com.sun.star.style.VerticalAlignment.TOP)
	End Select	

End Sub


Sub CControlTabStop (iTab As Integer)

	If iTab = 0 Then
		oMod.setPropertyValue(&quot;Tabstop&quot;, False)
	Else
		oMod.setPropertyValue(&quot;Tabstop&quot;, True)
		oMod.setPropertyValue(&quot;TabIndex&quot;, iTab)
	End If

End Sub


Sub CCStandardBGColor

CControlBGColor(255,255,204)

End Sub


Sub CControlBGColor (iCRot As Integer, iCGruen As Integer, iCBlau As Integer)

	oMod.setPropertyValue(&quot;BackgroundColor&quot;, RGB (iCRot, iCGruen, iCBlau))

End Sub

Sub CControlTextColor (iCRot As Integer, iCGruen As Integer, iCBlau As Integer)

	oMod.setPropertyValue(&quot;TextColor&quot;, RGB (iCRot, iCGruen, iCBlau))

End Sub



Sub CControlStep(iStepC As Integer)

	oMod.setPropertyValue(&quot;Step&quot;, iStepC)

End Sub


Sub CControlRO

	oMod.setPropertyValue(&quot;ReadOnly&quot;, True)

End Sub


Sub CSteuerelementEinfuegen (sCName As String, sHilfe As String)

REM * Name und Hilfetext *
	oMod.setPropertyValue(&quot;Name&quot;, sCName)
	oMod.setPropertyValue(&quot;HelpText&quot;, sHilfe)
	
REM * Steuerelement einfuegen *  

	oDlgM.insertByName(sCName, oMod)

End Sub


REM ** Anzeige des Dialoges **
Sub CDialogAnzeigen1

	oDlgEF = CreateUnoService(&quot;com.sun.star.awt.UnoControlDialog&quot;)
	oDlgEF.setmodel(oDlgM)

End Sub


Sub CDialogAnzeigen2

Dim oWin As Object

	oWin = CreateUnoService(&quot;com.sun.star.awt.toolkit&quot;)
	oDlgEF.Createpeer(oWin, null)

End Sub


Function CDiaRueckgabe

	 CDiaRueckgabe = oDlgEF.execute()

End Function


</script:module>