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>73)And(X<130)And(Y>=117)And(Y<181) Then 32cdf0e10cSrcweir CalChoosenLand = CalBLBayern 33cdf0e10cSrcweir 34cdf0e10cSrcweir ElseIf (X>41)And(X<89)And(Y>=136)And(Y<183) Then 35cdf0e10cSrcweir CalChoosenLand = CalBLBadenWuert 36cdf0e10cSrcweir 37cdf0e10cSrcweir ElseIf (X>18)And(X<35)And(Y>136)And(Y<147) Then 38cdf0e10cSrcweir CalChoosenLand = CalBLSaarland 39cdf0e10cSrcweir 40cdf0e10cSrcweir ElseIf (X>13)And(X<42)And(Y>111)And(Y<146) Then 41cdf0e10cSrcweir CalChoosenLand = CalBLRheinlandPfalz 42cdf0e10cSrcweir 43cdf0e10cSrcweir ElseIf (X>15)And(X<=60)And(Y>=69)And(Y<112) Then 44cdf0e10cSrcweir CalChoosenLand = CalBLNordrheinWest 45cdf0e10cSrcweir 46cdf0e10cSrcweir ElseIf (X>=42)And(X<78)And(Y>=95)And(Y<136) Then 47cdf0e10cSrcweir CalChoosenLand = CalBLHessen 48cdf0e10cSrcweir 49cdf0e10cSrcweir ElseIf (X>=78)And(X<112)And(Y>=95)And(Y<117) Then 50cdf0e10cSrcweir CalChoosenLand = CalBLThueringen 51cdf0e10cSrcweir 52cdf0e10cSrcweir ElseIf (X>=112)And(X<158)And(Y>=88)And(Y<114) Then 53cdf0e10cSrcweir CalChoosenLand = CalBLSachsen 54cdf0e10cSrcweir 55cdf0e10cSrcweir ElseIf (X>77)And(X<84)And(Y>35)And(Y<42) Then 56cdf0e10cSrcweir CalChoosenLand = CalBLHamburg 57cdf0e10cSrcweir 58cdf0e10cSrcweir ElseIf (X>56)And(X<60)And(Y>36)And(Y<41) Then 59cdf0e10cSrcweir CalChoosenLand = CalBLBremen 60cdf0e10cSrcweir 61cdf0e10cSrcweir ElseIf (X>58)And(X<63)And(Y>44)And(Y<52) Then 62cdf0e10cSrcweir CalChoosenLand = CalBLBremen 63cdf0e10cSrcweir 64cdf0e10cSrcweir ElseIf (X>52)And(X<95)And(Y>8)And(Y<40) Then 65cdf0e10cSrcweir CalChoosenLand = CalBLSchlHolstein 66cdf0e10cSrcweir 67cdf0e10cSrcweir ElseIf (X>90)And(X<149)And(Y>23)And(Y<48) Then 68cdf0e10cSrcweir CalChoosenLand = CalBLMeckPomm 69cdf0e10cSrcweir 70cdf0e10cSrcweir ElseIf (X>28)And(X<90)And(Y>35)And(Y<69) Then 71cdf0e10cSrcweir CalChoosenLand = CalBLNiedersachsen 72cdf0e10cSrcweir 73cdf0e10cSrcweir ElseIf (X>60)And(X<90)And(Y>=69)And(Y<95) Then 74cdf0e10cSrcweir CalChoosenLand = CalBLNiedersachsen 75cdf0e10cSrcweir 76cdf0e10cSrcweir ElseIf (X>=90)And(X<=115)And(Y>47)And(Y<95) Then 77cdf0e10cSrcweir CalChoosenLand = CalBLSachsenAnhalt 78cdf0e10cSrcweir 79cdf0e10cSrcweir ElseIf (X>129)And(X<139)And(Y>60)And(Y<66) Then 80cdf0e10cSrcweir CalChoosenLand = CalBLBerlin 81cdf0e10cSrcweir 82cdf0e10cSrcweir ElseIf (X>115)And(X<151)And(Y>=48)And(Y<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&, VierterAdvent& 93cdf0e10cSrcweir 94cdf0e10cSrcweir If (iCountry < 1) Or (iCountry > 16) Then 95cdf0e10cSrcweir iCountry = CalBLHamburg 96cdf0e10cSrcweir End If 97cdf0e10cSrcweir OsternDate& = CalEasterTable&(iSelYear) 98cdf0e10cSrcweir So = 1 99cdf0e10cSrcweir 100cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 1, 1), "Neujahr", cHolidayType_Full) 101cdf0e10cSrcweir 102cdf0e10cSrcweir If (iCountry = CalBLBayern) Or (iCountry = CalBLBadenWuert) Or (iCountry = CalBLSachsenAnhalt) Then 103cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 1, 6), "Hl. 3 Könige", cHolidayType_Full) 104cdf0e10cSrcweir End If 105cdf0e10cSrcweir 106cdf0e10cSrcweir CalInsertBankholiday(OsternDate&-2, "Karfreitag", cHolidayType_Full) 107cdf0e10cSrcweir CalInsertBankholiday(OsternDate&, "Ostersonntag", cHolidayType_Full) 108cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+1, "Ostermontag", cHolidayType_Full) 109cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 5, 1), "Maifeiertag", cHolidayType_Full) 110cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+39, "Christi Himmelfahrt", cHolidayType_Full) 111cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+49, "Pfingstsonntag", cHolidayType_Full) 112cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+50, "Pfingstmontag", 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&+60, "Fronleichnam", cHolidayType_Full) 116cdf0e10cSrcweir End If 117cdf0e10cSrcweir 118cdf0e10cSrcweir If (iCountry = CalBLBayern) Or (iCountry = CalBLSaarland) Then 119cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 8, 15), "Mariä Himmelfahrt", cHolidayType_Full) 120cdf0e10cSrcweir End If 121cdf0e10cSrcweir 122cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 10, 3), "Tag der dt. Einheit", 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), "Reformationstag", 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), "Allerheiligen", cHolidayType_Full) 130cdf0e10cSrcweir End If 131cdf0e10cSrcweir 132cdf0e10cSrcweir vierterAdvent = DateSerial(iSelYear, 12, 24) 133cdf0e10cSrcweir While WeekDay(vierterAdvent) <> So 134cdf0e10cSrcweir vierterAdvent = vierterAdvent - 1 135cdf0e10cSrcweir Wend 136cdf0e10cSrcweir 137cdf0e10cSrcweir If iCountry = CalBLSachsen Then 138cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-32, "Buß- und Bettag", cHolidayType_Full) 139cdf0e10cSrcweir Else 140cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-32, "Buß- und Bettag", cHolidayType_Half) 141cdf0e10cSrcweir End If 142cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-21, "1. Advent", cHolidayType_Full) 143cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-14, "2. Advent", cHolidayType_Full) 144cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-7, "3. Advent", cHolidayType_Full) 145cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent, "4. Advent", cHolidayType_Full) 146cdf0e10cSrcweir 147cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 24), "Heiligabend", cHolidayType_Half) 148cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 25), "1. Weihnachtstag", cHolidayType_Full) 149cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 26), "2. Weihnachtstag", cHolidayType_Full) 150cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 31), "Sylvester", cHolidayType_Half) 151cdf0e10cSrcweirEnd Sub 152*3e02b54dSAndrew Rist</script:module> 153