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