1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3*3e02b54dSAndrew Rist<!--***********************************************************
4*3e02b54dSAndrew Rist *
5*3e02b54dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
6*3e02b54dSAndrew Rist * or more contributor license agreements.  See the NOTICE file
7*3e02b54dSAndrew Rist * distributed with this work for additional information
8*3e02b54dSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
9*3e02b54dSAndrew Rist * to you under the Apache License, Version 2.0 (the
10*3e02b54dSAndrew Rist * "License"); you may not use this file except in compliance
11*3e02b54dSAndrew Rist * with the License.  You may obtain a copy of the License at
12*3e02b54dSAndrew Rist *
13*3e02b54dSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
14*3e02b54dSAndrew Rist *
15*3e02b54dSAndrew Rist * Unless required by applicable law or agreed to in writing,
16*3e02b54dSAndrew Rist * software distributed under the License is distributed on an
17*3e02b54dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18*3e02b54dSAndrew Rist * KIND, either express or implied.  See the License for the
19*3e02b54dSAndrew Rist * specific language governing permissions and limitations
20*3e02b54dSAndrew Rist * under the License.
21*3e02b54dSAndrew Rist *
22*3e02b54dSAndrew Rist ***********************************************************-->
23cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="GermanHolidays" script:language="StarBasic">Option Explicit
24cdf0e10cSrcweir
25cdf0e10cSrcweirSub Main()
26cdf0e10cSrcweir	Call CalAutopilotTable()
27cdf0e10cSrcweirEnd Sub
28cdf0e10cSrcweir
29cdf0e10cSrcweirFunction CalGetGermanLandAtMousePos(byval X as single, byval Y as single) as Integer
30cdf0e10cSrcweir	CalChoosenLand = 0
31cdf0e10cSrcweir	If (X&gt;73)And(X&lt;130)And(Y&gt;=117)And(Y&lt;181) Then
32cdf0e10cSrcweir		CalChoosenLand = CalBLBayern
33cdf0e10cSrcweir
34cdf0e10cSrcweir	ElseIf (X&gt;41)And(X&lt;89)And(Y&gt;=136)And(Y&lt;183) Then
35cdf0e10cSrcweir		CalChoosenLand = CalBLBadenWuert
36cdf0e10cSrcweir
37cdf0e10cSrcweir	ElseIf (X&gt;18)And(X&lt;35)And(Y&gt;136)And(Y&lt;147) Then
38cdf0e10cSrcweir		CalChoosenLand = CalBLSaarland
39cdf0e10cSrcweir
40cdf0e10cSrcweir	ElseIf (X&gt;13)And(X&lt;42)And(Y&gt;111)And(Y&lt;146) Then
41cdf0e10cSrcweir		CalChoosenLand = CalBLRheinlandPfalz
42cdf0e10cSrcweir
43cdf0e10cSrcweir	ElseIf (X&gt;15)And(X&lt;=60)And(Y&gt;=69)And(Y&lt;112) Then
44cdf0e10cSrcweir		CalChoosenLand = CalBLNordrheinWest
45cdf0e10cSrcweir
46cdf0e10cSrcweir	ElseIf (X&gt;=42)And(X&lt;78)And(Y&gt;=95)And(Y&lt;136) Then
47cdf0e10cSrcweir		CalChoosenLand = CalBLHessen
48cdf0e10cSrcweir
49cdf0e10cSrcweir	ElseIf (X&gt;=78)And(X&lt;112)And(Y&gt;=95)And(Y&lt;117) Then
50cdf0e10cSrcweir		CalChoosenLand = CalBLThueringen
51cdf0e10cSrcweir
52cdf0e10cSrcweir	ElseIf (X&gt;=112)And(X&lt;158)And(Y&gt;=88)And(Y&lt;114) Then
53cdf0e10cSrcweir		CalChoosenLand = CalBLSachsen
54cdf0e10cSrcweir
55cdf0e10cSrcweir	ElseIf (X&gt;77)And(X&lt;84)And(Y&gt;35)And(Y&lt;42) Then
56cdf0e10cSrcweir		CalChoosenLand = CalBLHamburg
57cdf0e10cSrcweir
58cdf0e10cSrcweir	ElseIf (X&gt;56)And(X&lt;60)And(Y&gt;36)And(Y&lt;41) Then
59cdf0e10cSrcweir		CalChoosenLand = CalBLBremen
60cdf0e10cSrcweir
61cdf0e10cSrcweir	ElseIf (X&gt;58)And(X&lt;63)And(Y&gt;44)And(Y&lt;52) Then
62cdf0e10cSrcweir		CalChoosenLand = CalBLBremen
63cdf0e10cSrcweir
64cdf0e10cSrcweir	ElseIf (X&gt;52)And(X&lt;95)And(Y&gt;8)And(Y&lt;40) Then
65cdf0e10cSrcweir		CalChoosenLand = CalBLSchlHolstein
66cdf0e10cSrcweir
67cdf0e10cSrcweir	ElseIf (X&gt;90)And(X&lt;149)And(Y&gt;23)And(Y&lt;48) Then
68cdf0e10cSrcweir		CalChoosenLand = CalBLMeckPomm
69cdf0e10cSrcweir
70cdf0e10cSrcweir	ElseIf (X&gt;28)And(X&lt;90)And(Y&gt;35)And(Y&lt;69) Then
71cdf0e10cSrcweir		CalChoosenLand = CalBLNiedersachsen
72cdf0e10cSrcweir
73cdf0e10cSrcweir	ElseIf (X&gt;60)And(X&lt;90)And(Y&gt;=69)And(Y&lt;95) Then
74cdf0e10cSrcweir		CalChoosenLand = CalBLNiedersachsen
75cdf0e10cSrcweir
76cdf0e10cSrcweir	ElseIf (X&gt;=90)And(X&lt;=115)And(Y&gt;47)And(Y&lt;95) Then
77cdf0e10cSrcweir		CalChoosenLand = CalBLSachsenAnhalt
78cdf0e10cSrcweir
79cdf0e10cSrcweir	ElseIf (X&gt;129)And(X&lt;139)And(Y&gt;60)And(Y&lt;66) Then
80cdf0e10cSrcweir		CalChoosenLand = CalBLBerlin
81cdf0e10cSrcweir
82cdf0e10cSrcweir	ElseIf (X&gt;115)And(X&lt;151)And(Y&gt;=48)And(Y&lt;88) Then
83cdf0e10cSrcweir		CalChoosenLand = CalBLBrandenburg
84cdf0e10cSrcweir	End If
85cdf0e10cSrcweir	CalGetGermanLandAtMousePos = CalChoosenLand
86cdf0e10cSrcweirEnd Function
87cdf0e10cSrcweir
88cdf0e10cSrcweir
89cdf0e10cSrcweir
90cdf0e10cSrcweirSub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry as Integer)
91cdf0e10cSrcweir	Dim So as Integer
92cdf0e10cSrcweir	Dim OsternDate&amp;, VierterAdvent&amp;
93cdf0e10cSrcweir
94cdf0e10cSrcweir	If (iCountry &lt; 1) Or (iCountry &gt; 16) Then
95cdf0e10cSrcweir		iCountry = CalBLHamburg
96cdf0e10cSrcweir	End If
97cdf0e10cSrcweir	OsternDate&amp; = CalEasterTable&amp;(iSelYear)
98cdf0e10cSrcweir	So = 1
99cdf0e10cSrcweir
100cdf0e10cSrcweir	CalInsertBankholiday(DateSerial(iSelYear, 1, 1), &quot;Neujahr&quot;, cHolidayType_Full)
101cdf0e10cSrcweir
102cdf0e10cSrcweir	If (iCountry = CalBLBayern) Or (iCountry = CalBLBadenWuert) Or (iCountry = CalBLSachsenAnhalt) Then
103cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 1, 6), &quot;Hl. 3 Könige&quot;, cHolidayType_Full)
104cdf0e10cSrcweir	End If
105cdf0e10cSrcweir
106cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;-2, &quot;Karfreitag&quot;, cHolidayType_Full)
107cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;, &quot;Ostersonntag&quot;, cHolidayType_Full)
108cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+1, &quot;Ostermontag&quot;, cHolidayType_Full)
109cdf0e10cSrcweir	CalInsertBankholiday(DateSerial(iSelYear, 5, 1), &quot;Maifeiertag&quot;, cHolidayType_Full)
110cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+39, &quot;Christi Himmelfahrt&quot;, cHolidayType_Full)
111cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+49, &quot;Pfingstsonntag&quot;, cHolidayType_Full)
112cdf0e10cSrcweir	CalInsertBankholiday(OsternDate&amp;+50, &quot;Pfingstmontag&quot;, cHolidayType_Full)
113cdf0e10cSrcweir
114cdf0e10cSrcweir	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
115cdf0e10cSrcweir		CalInsertBankholiday(OsternDate&amp;+60, &quot;Fronleichnam&quot;, cHolidayType_Full)
116cdf0e10cSrcweir	End If
117cdf0e10cSrcweir
118cdf0e10cSrcweir	If (iCountry = CalBLBayern) Or (iCountry = CalBLSaarland) Then
119cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 8, 15), &quot;Mariä Himmelfahrt&quot;, cHolidayType_Full)
120cdf0e10cSrcweir	End If
121cdf0e10cSrcweir
122cdf0e10cSrcweir	CalInsertBankholiday(DateSerial(iSelYear, 10, 3), &quot;Tag der dt. Einheit&quot;, cHolidayType_Full)
123cdf0e10cSrcweir
124cdf0e10cSrcweir	If (iCountry=CalBLBrandenburg) Or (iCountry=CalBLMeckPomm) Or (iCountry=CalBLSachsenAnhalt) Or (iCountry=CalBLSachsen) Or (iCountry=CalBLThueringen) Then
125cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 10, 31), &quot;Reformationstag&quot;, cHolidayType_Full)
126cdf0e10cSrcweir	End If
127cdf0e10cSrcweir
128cdf0e10cSrcweir	If (iCountry = CalBLBadenWuert) Or (iCountry = CalBLBayern) Or (iCountry = CalBLNordRheinWest) Or (iCountry = CalBLRheinlandPfalz) Or (iCountry = CalBLSaarland) Or (iCountry = CalBLSachsen) Or (iCountry = CalBLThueringen) Then
129cdf0e10cSrcweir		CalInsertBankholiday(DateSerial(iSelYear, 11, 1), &quot;Allerheiligen&quot;, cHolidayType_Full)
130cdf0e10cSrcweir	End If
131cdf0e10cSrcweir
132cdf0e10cSrcweir	vierterAdvent = DateSerial(iSelYear, 12, 24)
133cdf0e10cSrcweir	While WeekDay(vierterAdvent) &lt;&gt; So
134cdf0e10cSrcweir		vierterAdvent = vierterAdvent - 1
135cdf0e10cSrcweir	Wend
136cdf0e10cSrcweir
137cdf0e10cSrcweir	If iCountry = CalBLSachsen Then
138cdf0e10cSrcweir		CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Full)
139cdf0e10cSrcweir	Else
140cdf0e10cSrcweir		CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Half)
141cdf0e10cSrcweir	End If
142cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent-21, &quot;1. Advent&quot;, cHolidayType_Full)
143cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent-14, &quot;2. Advent&quot;, cHolidayType_Full)
144cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent-7, &quot;3. Advent&quot;, cHolidayType_Full)
145cdf0e10cSrcweir	CalInsertBankholiday(vierterAdvent, &quot;4. Advent&quot;, cHolidayType_Full)
146cdf0e10cSrcweir
147cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 24), &quot;Heiligabend&quot;, cHolidayType_Half)
148cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 25), &quot;1. Weihnachtstag&quot;, cHolidayType_Full)
149cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 26), &quot;2. Weihnachtstag&quot;, cHolidayType_Full)
150cdf0e10cSrcweir	CalInsertBankholiday(Dateserial(iSelYear, 12, 31), &quot;Sylvester&quot;, cHolidayType_Half)
151cdf0e10cSrcweirEnd Sub
152*3e02b54dSAndrew Rist</script:module>
153