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>73)And(X<130)And(Y>=117)And(Y<181) Then 12*cdf0e10cSrcweir CalChoosenLand = CalBLBayern 13*cdf0e10cSrcweir 14*cdf0e10cSrcweir ElseIf (X>41)And(X<89)And(Y>=136)And(Y<183) Then 15*cdf0e10cSrcweir CalChoosenLand = CalBLBadenWuert 16*cdf0e10cSrcweir 17*cdf0e10cSrcweir ElseIf (X>18)And(X<35)And(Y>136)And(Y<147) Then 18*cdf0e10cSrcweir CalChoosenLand = CalBLSaarland 19*cdf0e10cSrcweir 20*cdf0e10cSrcweir ElseIf (X>13)And(X<42)And(Y>111)And(Y<146) Then 21*cdf0e10cSrcweir CalChoosenLand = CalBLRheinlandPfalz 22*cdf0e10cSrcweir 23*cdf0e10cSrcweir ElseIf (X>15)And(X<=60)And(Y>=69)And(Y<112) Then 24*cdf0e10cSrcweir CalChoosenLand = CalBLNordrheinWest 25*cdf0e10cSrcweir 26*cdf0e10cSrcweir ElseIf (X>=42)And(X<78)And(Y>=95)And(Y<136) Then 27*cdf0e10cSrcweir CalChoosenLand = CalBLHessen 28*cdf0e10cSrcweir 29*cdf0e10cSrcweir ElseIf (X>=78)And(X<112)And(Y>=95)And(Y<117) Then 30*cdf0e10cSrcweir CalChoosenLand = CalBLThueringen 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir ElseIf (X>=112)And(X<158)And(Y>=88)And(Y<114) Then 33*cdf0e10cSrcweir CalChoosenLand = CalBLSachsen 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir ElseIf (X>77)And(X<84)And(Y>35)And(Y<42) Then 36*cdf0e10cSrcweir CalChoosenLand = CalBLHamburg 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir ElseIf (X>56)And(X<60)And(Y>36)And(Y<41) Then 39*cdf0e10cSrcweir CalChoosenLand = CalBLBremen 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir ElseIf (X>58)And(X<63)And(Y>44)And(Y<52) Then 42*cdf0e10cSrcweir CalChoosenLand = CalBLBremen 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir ElseIf (X>52)And(X<95)And(Y>8)And(Y<40) Then 45*cdf0e10cSrcweir CalChoosenLand = CalBLSchlHolstein 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir ElseIf (X>90)And(X<149)And(Y>23)And(Y<48) Then 48*cdf0e10cSrcweir CalChoosenLand = CalBLMeckPomm 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir ElseIf (X>28)And(X<90)And(Y>35)And(Y<69) Then 51*cdf0e10cSrcweir CalChoosenLand = CalBLNiedersachsen 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir ElseIf (X>60)And(X<90)And(Y>=69)And(Y<95) Then 54*cdf0e10cSrcweir CalChoosenLand = CalBLNiedersachsen 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir ElseIf (X>=90)And(X<=115)And(Y>47)And(Y<95) Then 57*cdf0e10cSrcweir CalChoosenLand = CalBLSachsenAnhalt 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir ElseIf (X>129)And(X<139)And(Y>60)And(Y<66) Then 60*cdf0e10cSrcweir CalChoosenLand = CalBLBerlin 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir ElseIf (X>115)And(X<151)And(Y>=48)And(Y<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&, VierterAdvent& 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir If (iCountry < 1) Or (iCountry > 16) Then 75*cdf0e10cSrcweir iCountry = CalBLHamburg 76*cdf0e10cSrcweir End If 77*cdf0e10cSrcweir OsternDate& = CalEasterTable&(iSelYear) 78*cdf0e10cSrcweir So = 1 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 1, 1), "Neujahr", cHolidayType_Full) 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir If (iCountry = CalBLBayern) Or (iCountry = CalBLBadenWuert) Or (iCountry = CalBLSachsenAnhalt) Then 83*cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 1, 6), "Hl. 3 Könige", cHolidayType_Full) 84*cdf0e10cSrcweir End If 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir CalInsertBankholiday(OsternDate&-2, "Karfreitag", cHolidayType_Full) 87*cdf0e10cSrcweir CalInsertBankholiday(OsternDate&, "Ostersonntag", cHolidayType_Full) 88*cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+1, "Ostermontag", cHolidayType_Full) 89*cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 5, 1), "Maifeiertag", cHolidayType_Full) 90*cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+39, "Christi Himmelfahrt", cHolidayType_Full) 91*cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+49, "Pfingstsonntag", cHolidayType_Full) 92*cdf0e10cSrcweir CalInsertBankholiday(OsternDate&+50, "Pfingstmontag", 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&+60, "Fronleichnam", cHolidayType_Full) 96*cdf0e10cSrcweir End If 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir If (iCountry = CalBLBayern) Or (iCountry = CalBLSaarland) Then 99*cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 8, 15), "Mariä Himmelfahrt", cHolidayType_Full) 100*cdf0e10cSrcweir End If 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir CalInsertBankholiday(DateSerial(iSelYear, 10, 3), "Tag der dt. Einheit", 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), "Reformationstag", 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), "Allerheiligen", cHolidayType_Full) 110*cdf0e10cSrcweir End If 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir vierterAdvent = DateSerial(iSelYear, 12, 24) 113*cdf0e10cSrcweir While WeekDay(vierterAdvent) <> So 114*cdf0e10cSrcweir vierterAdvent = vierterAdvent - 1 115*cdf0e10cSrcweir Wend 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir If iCountry = CalBLSachsen Then 118*cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-32, "Buß- und Bettag", cHolidayType_Full) 119*cdf0e10cSrcweir Else 120*cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-32, "Buß- und Bettag", cHolidayType_Half) 121*cdf0e10cSrcweir End If 122*cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-21, "1. Advent", cHolidayType_Full) 123*cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-14, "2. Advent", cHolidayType_Full) 124*cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent-7, "3. Advent", cHolidayType_Full) 125*cdf0e10cSrcweir CalInsertBankholiday(vierterAdvent, "4. Advent", cHolidayType_Full) 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 24), "Heiligabend", cHolidayType_Half) 128*cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 25), "1. Weihnachtstag", cHolidayType_Full) 129*cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 26), "2. Weihnachtstag", cHolidayType_Full) 130*cdf0e10cSrcweir CalInsertBankholiday(Dateserial(iSelYear, 12, 31), "Sylvester", cHolidayType_Half) 131*cdf0e10cSrcweirEnd Sub 132*cdf0e10cSrcweir</script:module>