diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-11-14 17:29:33 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-11-14 17:29:33 +0000 |
commit | dd8b809ba857c67efdef98990aa250f4f649ab40 (patch) | |
tree | 485148572fb5018ee5e11588fde0814c49401e0a /wizards/source/schedule/GermanHolidays.xba | |
parent | e8924b18041adfab2919bd79c2e67706bfae6c2d (diff) |
#94767# macro restructured due to new asian holidays
Diffstat (limited to 'wizards/source/schedule/GermanHolidays.xba')
-rw-r--r-- | wizards/source/schedule/GermanHolidays.xba | 146 |
1 files changed, 146 insertions, 0 deletions
diff --git a/wizards/source/schedule/GermanHolidays.xba b/wizards/source/schedule/GermanHolidays.xba new file mode 100644 index 000000000..f619144d1 --- /dev/null +++ b/wizards/source/schedule/GermanHolidays.xba @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="HolidayGerman" script:language="StarBasic">Option Explicit + +Sub Main() + Call CalAutopilotTable() +End Sub + +Function CalGetGermanLandAtMousePos(byval X as single, byval Y as single) as Integer + CalChoosenLand = 0 + If (X>68)And(X<125)And(Y>116)And(Y<176) Then + CalChoosenLand = CalBLBayern + + ElseIf (X>36)And(X<84)And(Y>131)And(Y<178) Then + CalChoosenLand = CalBLBadenWuert + + ElseIf (X>9)And(X<26)And(Y>128)And(Y<139) Then + CalChoosenLand = CalBLSaarland + + ElseIf (X>8)And(X<37)And(Y>107)And(Y<141) Then + CalChoosenLand = CalBLRheinlandPfalz + + ElseIf (X>5)And(X<53)And(Y>65)And(Y<107) Then + CalChoosenLand = CalBLNordrheinWest + + ElseIf (X>39)And(X<70)And(Y>87)And(Y<131) Then + CalChoosenLand = CalBLHessen + + ElseIf (X>70)And(X<105)And(Y>83)And(Y<116) Then + CalChoosenLand = CalBLThueringen + + ElseIf (X>105)And(X<150)And(Y>82)And(Y<107) Then + CalChoosenLand = CalBLSachsen + + ElseIf (X>47)And(X<85)And(Y>6)And(Y<37) Then + CalChoosenLand = CalBLSchlHolstein + + ElseIf (X>74)And(X<85)And(Y>37)And(Y<43) Then + CalChoosenLand = CalBLHamburg + + ElseIf (X>85)And(X<138)And(Y>18)And(Y<45) Then + CalChoosenLand = CalBLMeckPomm + + ElseIf (X>49)And(X<55)And(Y>41)And(Y<47) Then + CalChoosenLand = CalBLBremen + + ElseIf (X>51)And(X<65)And(Y>53)And(Y<60) Then + CalChoosenLand = CalBLBremen + + ElseIf (X>23)And(X<85)And(Y>38)And(Y<67) Then + CalChoosenLand = CalBLNiedersachsen + + ElseIf (X>53)And(X<85)And(Y>67)And(Y<83) Then + CalChoosenLand = CalBLNiedersachsen + + ElseIf (X>85)And(X<105)And(Y>45)And(Y<83) Then + CalChoosenLand = CalBLSachsenAnhalt + + ElseIf (X>116)And(X<130)And(Y>58)And(Y<68) Then + CalChoosenLand = CalBLBerlin + + ElseIf (X>105)And(X<144)And(Y>45)And(Y<82) Then + CalChoosenLand = CalBLBrandenburg + End If +' If (CalChoosenLand >= Lbound(BLNameList)) AND ((CalChoosenLand <= Ubound(BLNameList))) Then +' Land$ = BLNameList(CalChoosenLand) +' End If + CalGetGermanLandAtMousePos = CalChoosenLand +End Function + + + +Sub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry as Integer) + + ' Ermittelt die Feiertage eines gesamten Jahres (Parameter iSelYear), + ' bezogen auf ein bestimmtes Bundesland (Parameter iCountry). Kein + ' bestimmtes Bundesland bedeutet, dass der Parameter gleich der + ' Konstante calBLHamburg ist, da Hamburg nur Standardfeiertage kennt. + ' Die Feiertage werden in das Array CalBankHolidayName$ geschrieben. + ' Der Index dieses Arrays geht bis vierhundert. Der 1. Januar hat den + ' Indexwert 1, der 2. Januar den Indexwert 2 usw. Das bedeutet, daß + ' wenn am 2. Januar kein Feiertag existiert, liefert + ' CalBankHolidayName$(DateSerial(0, 1, 2) eine leere Zeichenkette (""). + + Dim So as Integer + Dim OsternDate&, VierterAdvent& + + If (iCountry < 1) Or (iCountry > 16) Then + iCountry = CalBLHamburg + End If + OsternDate& = CalEasterTable&(iSelYear) + So = 1 + + CalInsertBankholiday(DateSerial(iSelYear, 1, 1), "Neujahr", cHolidayType_Full) + + If (iCountry = CalBLBayern) Or (iCountry = CalBLBadenWuert) Or (iCountry = CalBLSachsenAnhalt) Then + CalInsertBankholiday(DateSerial(iSelYear, 1, 6), "Hl. 3 Könige", cHolidayType_Full) + End If + + CalInsertBankholiday(OsternDate&-2, "Karfreitag", cHolidayType_Full) + CalInsertBankholiday(OsternDate&, "Ostersonntag", cHolidayType_Full) + CalInsertBankholiday(OsternDate&+1, "Ostermontag", cHolidayType_Full) + CalInsertBankholiday(DateSerial(iSelYear, 5, 1), "Maifeiertag", cHolidayType_Full) + CalInsertBankholiday(OsternDate&+39, "Christi Himmelfahrt", cHolidayType_Full) + CalInsertBankholiday(OsternDate&+49, "Pfingstsonntag", cHolidayType_Full) + CalInsertBankholiday(OsternDate&+50, "Pfingstmontag", cHolidayType_Full) + + 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 + CalInsertBankholiday(OsternDate&+60, "Fronleichnam", cHolidayType_Full) + End If + + If (iCountry = CalBLBayern) Or (iCountry = CalBLSaarland) Then + CalInsertBankholiday(DateSerial(iSelYear, 8, 15), "Mariä Himmelfahrt", cHolidayType_Full) + End If + + CalInsertBankholiday(DateSerial(iSelYear, 10, 3), "Tag der dt. Einheit", cHolidayType_Full) + + If (iCountry=CalBLBrandenburg) Or (iCountry=CalBLMeckPomm) Or (iCountry=CalBLSachsenAnhalt) Or (iCountry=CalBLSachsen) Or (iCountry=CalBLThueringen) Then + CalInsertBankholiday(DateSerial(iSelYear, 10, 31), "Reformationstag", cHolidayType_Full) + End If + + If (iCountry = CalBLBadenWuert) Or (iCountry = CalBLBayern) Or (iCountry = CalBLNordRheinWest) Or (iCountry = CalBLRheinlandPfalz) Or (iCountry = CalBLSaarland) Or (iCountry = CalBLSachsen) Or (iCountry = CalBLThueringen) Then + CalInsertBankholiday(DateSerial(iSelYear, 11, 1), "Allerheiligen", cHolidayType_Full) + End If + + vierterAdvent = DateSerial(iSelYear, 12, 24) + While WeekDay(vierterAdvent) <> So + vierterAdvent = vierterAdvent - 1 + Wend + + If iCountry = CalBLSachsen Then + CalInsertBankholiday(vierterAdvent-32, "Buß- und Bettag", cHolidayType_Full) + Else + CalInsertBankholiday(vierterAdvent-32, "Buß- und Bettag", cHolidayType_Half) + End If ' Dank an die EKD für die Berechnungsvorschrift des Buß- und Bettags! + CalInsertBankholiday(vierterAdvent-21, "1. Advent", cHolidayType_Full) + CalInsertBankholiday(vierterAdvent-14, "2. Advent", cHolidayType_Full) + CalInsertBankholiday(vierterAdvent-7, "3. Advent", cHolidayType_Full) + CalInsertBankholiday(vierterAdvent, "4. Advent", cHolidayType_Full) + + CalInsertBankholiday(Dateserial(iSelYear, 12, 24), "Heiligabend", cHolidayType_Half) + CalInsertBankholiday(Dateserial(iSelYear, 12, 25), "1. Weihnachtstag", cHolidayType_Full) + CalInsertBankholiday(Dateserial(iSelYear, 12, 26), "2. Weihnachtstag", cHolidayType_Full) + CalInsertBankholiday(Dateserial(iSelYear, 12, 31), "Sylvester", cHolidayType_Half) +End Sub +</script:module>
\ No newline at end of file |