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