summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/classMAnnivDate.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-03 13:18:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-03 13:18:14 +0000
commit4b89d658c16f73387acf84a3e1eb899eb4ea0fcb (patch)
tree98e50f89c10296c5d73be1179d3e1fead7297c33 /plugins/UserInfoEx/src/classMAnnivDate.cpp
parent5269daf337ff67b0a804e7c63909a800b335a8db (diff)
more leaks
git-svn-id: http://svn.miranda-ng.org/main/trunk@5564 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/UserInfoEx/src/classMAnnivDate.cpp')
-rw-r--r--plugins/UserInfoEx/src/classMAnnivDate.cpp50
1 files changed, 26 insertions, 24 deletions
diff --git a/plugins/UserInfoEx/src/classMAnnivDate.cpp b/plugins/UserInfoEx/src/classMAnnivDate.cpp
index 2ba0fc335a..f703013550 100644
--- a/plugins/UserInfoEx/src/classMAnnivDate.cpp
+++ b/plugins/UserInfoEx/src/classMAnnivDate.cpp
@@ -207,36 +207,38 @@ int MAnnivDate::Age(MTime *pNow)
* param: none
* return: structure, holding zodiac information
**/
+
+struct {
+ const WORD startDays;
+ const WORD endDays;
+ LPCTSTR szZodiac;
+ LPCSTR szZodiacIcon;
+}
+static zodiac[] = {
+ { 80, 110, LPGENT("Aries"), ICO_ZOD_ARIES }, // Widder
+ { 111, 140, LPGENT("Taurus"), ICO_ZOD_TAURUS }, // Stier
+ { 141, 172, LPGENT("Gemini"), ICO_ZOD_GEMINI }, // Zwillinge
+ { 173, 203, LPGENT("Cancer"), ICO_ZOD_CANCER }, // Krebs
+ { 204, 235, LPGENT("Leo"), ICO_ZOD_LEO }, // Löwe
+ { 236, 266, LPGENT("Virgo"), ICO_ZOD_VIRGO }, // Jungfrau
+ { 267, 296, LPGENT("Libra"), ICO_ZOD_LIBRA }, // Waage
+ { 297, 326, LPGENT("Scorpio"), ICO_ZOD_SCORPIO }, // Scorpion
+ { 327, 355, LPGENT("Sagittarius"), ICO_ZOD_SAGITTARIUS }, // Schütze
+ { 356, 364, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 1, 19, LPGENT("Capricorn"), ICO_ZOD_CAPRICORN }, // Steinbock
+ { 20, 49, LPGENT("Aquarius"), ICO_ZOD_AQUARIUS }, // Wassermann
+ { 50, 79, LPGENT("Pisces"), ICO_ZOD_PISCES }, // Fische
+ { 0, 0, NULL, "" } // end of array
+};
+
MZodiac MAnnivDate::Zodiac()
{
- static const struct TZodiac {
- const WORD startDays;
- const WORD endDays;
- LPCTSTR szZodiac;
- LPCSTR szZodiacIcon;
- } zodiac[] = {
- { 80, 110, LPGENT("Aries") , ICO_ZOD_ARIES }, // Widder
- { 111, 140, LPGENT("Taurus") , ICO_ZOD_TAURUS }, // Stier
- { 141, 172, LPGENT("Gemini") , ICO_ZOD_GEMINI }, // Zwillinge
- { 173, 203, LPGENT("Cancer") , ICO_ZOD_CANCER }, // Krebs
- { 204, 235, LPGENT("Leo") , ICO_ZOD_LEO }, // Löwe
- { 236, 266, LPGENT("Virgo") , ICO_ZOD_VIRGO }, // Jungfrau
- { 267, 296, LPGENT("Libra") , ICO_ZOD_LIBRA }, // Waage
- { 297, 326, LPGENT("Scorpio") , ICO_ZOD_SCORPIO }, // Scorpion
- { 327, 355, LPGENT("Sagittarius") , ICO_ZOD_SAGITTARIUS }, // Schütze
- { 356, 364, LPGENT("Capricorn") , ICO_ZOD_CAPRICORN }, // Steinbock
- { 1, 19, LPGENT("Capricorn") , ICO_ZOD_CAPRICORN }, // Steinbock
- { 20, 49, LPGENT("Aquarius") , ICO_ZOD_AQUARIUS }, // Wassermann
- { 50, 79, LPGENT("Pisces") , ICO_ZOD_PISCES }, // Fische
- //{ 0, 0, LPGENT("Unknown") , ICO_ZOD_UNKNOWN }, // not found
- { 0, 0, NULL , "" } // end of array
- };
const WORD wDays = DayOfYear();
- BYTE i;
- MZodiac mZodiac;
+ int i;
for (i = 0; i < 13 && (wDays < zodiac[i].startDays || wDays > zodiac[i].endDays); i++);
+ MZodiac mZodiac;
mZodiac.hIcon = IcoLib_GetIcon(zodiac[i].szZodiacIcon);
mZodiac.pszName = zodiac[i].szZodiac;
return mZodiac;