1*cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2*cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3*cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="GermanHolidays" script:language="StarBasic">Option Explicit
4*cdf0e10cSrcweir
5*cdf0e10cSrcweirSub Main()
6*cdf0e10cSrcweir	Call CalAutopilotTable()
7*cdf0e10cSrcweirEnd Sub
8*cdf0e10cSrcweir
9*cdf0e10cSrcweirFunction CalGetGermanLandAtMousePos(byval X as single, byval Y as single) as Integer
10*cdf0e10cSrcweir	CalChoosenLand = 0
11*cdf0e10cSrcweir	If (X&gt;73)And(X&lt;130)And(Y&gt;=117)And(Y&lt;181) Then
12*cdf0e10cSrcweir		CalChoosenLand = CalBLBayern
13*cdf0e10cSrcweir
14*cdf0e10cSrcweir	ElseIf (X&gt;41)And(X&lt;89)And(Y&gt;=136)And(Y&lt;183) Then
15*cdf0e10cSrcweir		CalChoosenLand = CalBLBadenWuert
16*cdf0e10cSrcweir
17*cdf0e10cSrcweir	ElseIf (X&gt;18)And(X&lt;35)And(Y&gt;136)And(Y&lt;147) Then
18*cdf0e10cSrcweir		CalChoosenLand = CalBLSaarland
19*cdf0e10cSrcweir
20*cdf0e10cSrcweir	ElseIf (X&gt;13)And(X&lt;42)And(Y&gt;111)And(Y&lt;146) Then
21*cdf0e10cSrcweir		CalChoosenLand = CalBLRheinlandPfalz
22*cdf0e10cSrcweir
23*cdf0e10cSrcweir	ElseIf (X&gt;15)And(X&lt;=60)And(Y&gt;=69)And(Y&lt;112) Then
24*cdf0e10cSrcweir		CalChoosenLand = CalBLNordrheinWest
25*cdf0e10cSrcweir
26*cdf0e10cSrcweir	ElseIf (X&gt;=42)And(X&lt;78)And(Y&gt;=95)And(Y&lt;136) Then
27*cdf0e10cSrcweir		CalChoosenLand = CalBLHessen
28*cdf0e10cSrcweir
29*cdf0e10cSrcweir	ElseIf (X&gt;=78)And(X&lt;112)And(Y&gt;=95)And(Y&lt;117) Then
30*cdf0e10cSrcweir		CalChoosenLand = CalBLThueringen
31*cdf0e10cSrcweir
32*cdf0e10cSrcweir	ElseIf (X&gt;=112)And(X&lt;158)And(Y&gt;=88)And(Y&lt;114) Then
33*cdf0e10cSrcweir		CalChoosenLand = CalBLSachsen
34*cdf0e10cSrcweir
35*cdf0e10cSrcweir	ElseIf (X&gt;77)And(X&lt;84)And(Y&gt;35)And(Y&lt;42) Then
36*cdf0e10cSrcweir		CalChoosenLand = CalBLHamburg
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir	ElseIf (X&gt;56)And(X&lt;60)And(Y&gt;36)And(Y&lt;41) Then
39*cdf0e10cSrcweir		CalChoosenLand = CalBLBremen
40*cdf0e10cSrcweir
41*cdf0e10cSrcweir	ElseIf (X&gt;58)And(X&lt;63)And(Y&gt;44)And(Y&lt;52) Then
42*cdf0e10cSrcweir		CalChoosenLand = CalBLBremen
43*cdf0e10cSrcweir
44*cdf0e10cSrcweir	ElseIf (X&gt;52)And(X&lt;95)And(Y&gt;8)And(Y&lt;40) Then
45*cdf0e10cSrcweir		CalChoosenLand = CalBLSchlHolstein
46*cdf0e10cSrcweir
47*cdf0e10cSrcweir	ElseIf (X&gt;90)And(X&lt;149)And(Y&gt;23)And(Y&lt;48) Then
48*cdf0e10cSrcweir		CalChoosenLand = CalBLMeckPomm
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir	ElseIf (X&gt;28)And(X&lt;90)And(Y&gt;35)And(Y&lt;69) Then
51*cdf0e10cSrcweir		CalChoosenLand = CalBLNiedersachsen
52*cdf0e10cSrcweir
53*cdf0e10cSrcweir	ElseIf (X&gt;60)And(X&lt;90)And(Y&gt;=69)And(Y&lt;95) Then
54*cdf0e10cSrcweir		CalChoosenLand = CalBLNiedersachsen
55*cdf0e10cSrcweir
56*cdf0e10cSrcweir	ElseIf (X&gt;=90)And(X&lt;=115)And(Y&gt;47)And(Y&lt;95) Then
57*cdf0e10cSrcweir		CalChoosenLand = CalBLSachsenAnhalt
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir	ElseIf (X&gt;129)And(X&lt;139)And(Y&gt;60)And(Y&lt;66) Then
60*cdf0e10cSrcweir		CalChoosenLand = CalBLBerlin
61*cdf0e10cSrcweir
62*cdf0e10cSrcweir	ElseIf (X&gt;115)And(X&lt;151)And(Y&gt;=48)And(Y&lt;88) Then
63*cdf0e10cSrcweir		CalChoosenLand = CalBLBrandenburg
64*cdf0e10cSrcweir	End If
65*cdf0e10cSrcweir	CalGetGermanLandAtMousePos = CalChoosenLand
66*cdf0e10cSrcweirEnd Function
67*cdf0e10cSrcweir
68*cdf0e10cSrcweir
69*cdf0e10cSrcweir
70*cdf0e10cSrcweirSub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry as Integer)
71*cdf0e10cSrcweir	Dim So as Integer
72*cdf0e10cSrcweir	Dim OsternDate&amp;, VierterAdvent&amp;
73*cdf0e10cSrcweir
74*cdf0e10cSrcweir	If (iCountry &lt; 1) Or (iCountry &gt; 16) Then
75*cdf0e10cSrcweir		iCountry = CalBLHamburg
76*cdf0e10cSrcweir	End If
77*cdf0e10cSrcweir	OsternDate&amp; = CalEasterTable&amp;(iSelYear)
78*cdf0e10cSrcweir	So = 1
79*cdf0e10cSrcweir
80*cdf0e10cSrcweir	CalInsertBankholiday(DateSerial(iSelYear, 1, 1), &quot;Neujahr&quot;, cHolidayType_Full)
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir	If (iCountry = CalBLBayern) Or (iCountry = CalBLBadenWuert) Or (iCountry = CalBLSachsenAnhalt) Then
83*cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 1, 6), &quot;Hl. 3 Könige&quot;, cHolidayType_Full)
84*cdf0e10cSrcweir	End If
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;-2, &quot;Karfreitag&quot;, cHolidayType_Full)
87*cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;, &quot;Ostersonntag&quot;, cHolidayType_Full)
88*cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+1, &quot;Ostermontag&quot;, cHolidayType_Full)
89*cdf0e10cSrcweir	CalInsertBankholiday(DateSerial(iSelYear, 5, 1), &quot;Maifeiertag&quot;, cHolidayType_Full)
90*cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+39, &quot;Christi Himmelfahrt&quot;, cHolidayType_Full)
91*cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+49, &quot;Pfingstsonntag&quot;, cHolidayType_Full)
92*cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+50, &quot;Pfingstmontag&quot;, cHolidayType_Full)
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir	If (iCountry = CalBLBadenWuert) Or (iCountry = CalBLBayern) Or (iCountry = CalBLHessen) Or (iCountry = CalBLNordRheinWest) Or (iCountry = CalBLRheinlandPfalz) Or (iCountry = CalBLSaarland) Or (iCountry = CalBLSachsen) Or (iCountry = CalBLThueringen) Then
95*cdf0e10cSrcweir		CalInsertBankholiday(OsternDate&amp;+60, &quot;Fronleichnam&quot;, cHolidayType_Full)
96*cdf0e10cSrcweir	End If
97*cdf0e10cSrcweir
98*cdf0e10cSrcweir	If (iCountry = CalBLBayern) Or (iCountry = CalBLSaarland) Then
99*cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 8, 15), &quot;Mariä Himmelfahrt&quot;, cHolidayType_Full)
100*cdf0e10cSrcweir	End If
101*cdf0e10cSrcweir
102*cdf0e10cSrcweir	CalInsertBankholiday(DateSerial(iSelYear, 10, 3), &quot;Tag der dt. Einheit&quot;, cHolidayType_Full)
103*cdf0e10cSrcweir
104*cdf0e10cSrcweir	If (iCountry=CalBLBrandenburg) Or (iCountry=CalBLMeckPomm) Or (iCountry=CalBLSachsenAnhalt) Or (iCountry=CalBLSachsen) Or (iCountry=CalBLThueringen) Then
105*cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 10, 31), &quot;Reformationstag&quot;, cHolidayType_Full)
106*cdf0e10cSrcweir	End If
107*cdf0e10cSrcweir
108*cdf0e10cSrcweir	If (iCountry = CalBLBadenWuert) Or (iCountry = CalBLBayern) Or (iCountry = CalBLNordRheinWest) Or (iCountry = CalBLRheinlandPfalz) Or (iCountry = CalBLSaarland) Or (iCountry = CalBLSachsen) Or (iCountry = CalBLThueringen) Then
109*cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 11, 1), &quot;Allerheiligen&quot;, cHolidayType_Full)
110*cdf0e10cSrcweir	End If
111*cdf0e10cSrcweir
112*cdf0e10cSrcweir	vierterAdvent = DateSerial(iSelYear, 12, 24)
113*cdf0e10cSrcweir	While WeekDay(vierterAdvent) &lt;&gt; So
114*cdf0e10cSrcweir		vierterAdvent = vierterAdvent - 1
115*cdf0e10cSrcweir	Wend
116*cdf0e10cSrcweir
117*cdf0e10cSrcweir	If iCountry = CalBLSachsen Then
118*cdf0e10cSrcweir		CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Full)
119*cdf0e10cSrcweir	Else
120*cdf0e10cSrcweir		CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Half)
121*cdf0e10cSrcweir	End If
122*cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent-21, &quot;1. Advent&quot;, cHolidayType_Full)
123*cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent-14, &quot;2. Advent&quot;, cHolidayType_Full)
124*cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent-7, &quot;3. Advent&quot;, cHolidayType_Full)
125*cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent, &quot;4. Advent&quot;, cHolidayType_Full)
126*cdf0e10cSrcweir
127*cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 24), &quot;Heiligabend&quot;, cHolidayType_Half)
128*cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 25), &quot;1. Weihnachtstag&quot;, cHolidayType_Full)
129*cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 26), &quot;2. Weihnachtstag&quot;, cHolidayType_Full)
130*cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 31), &quot;Sylvester&quot;, cHolidayType_Half)
131*cdf0e10cSrcweirEnd Sub
132*cdf0e10cSrcweir</script:module>