diff --git a/headers/os/locale/TimeZone.h b/headers/os/locale/TimeZone.h index 5e609d875f..0f4a26e45e 100644 --- a/headers/os/locale/TimeZone.h +++ b/headers/os/locale/TimeZone.h @@ -42,9 +42,10 @@ public: static const char* kNameOfGmtZone; - struct Accessor; - friend struct BTimeZone::Accessor; + class Private; private: + friend class Private; + icu_44::TimeZone* fIcuTimeZone; icu_44::Locale* fIcuLocale; status_t fInitStatus; diff --git a/headers/private/locale/TimeZoneAccessor.h b/headers/private/locale/TimeZoneAccessor.h deleted file mode 100644 index f968f5eb5c..0000000000 --- a/headers/private/locale/TimeZoneAccessor.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010, Oliver Tappe - * Distributed under the terms of the MIT License. - */ -#ifndef _TIME_ZONE_ACCESSOR_H -#define _TIME_ZONE_ACCESSOR_H - - -#include - - -struct BTimeZone::Accessor { - Accessor(const BTimeZone* timeZone = NULL) - : fTimeZone(timeZone) - {} - - void SetTo(const BTimeZone* timeZone) - { - fTimeZone = timeZone; - } - - icu_44::TimeZone* IcuTimeZone() - { - return fTimeZone->fIcuTimeZone; - } - - const BTimeZone* fTimeZone; -}; - - -#endif // _TIME_ZONE_ACCESSOR_H diff --git a/headers/private/locale/TimeZonePrivate.h b/headers/private/locale/TimeZonePrivate.h new file mode 100644 index 0000000000..490a97ba90 --- /dev/null +++ b/headers/private/locale/TimeZonePrivate.h @@ -0,0 +1,37 @@ +/* + * Copyright 2010, Oliver Tappe + * Distributed under the terms of the MIT License. + */ +#ifndef _TIME_ZONE_PRIVATE_H +#define _TIME_ZONE_PRIVATE_H + + +#include + + +class BTimeZone::Private { +public: + Private(const BTimeZone* timeZone = NULL) + : + fTimeZone(timeZone) + { + } + + void + SetTo(const BTimeZone* timeZone) + { + fTimeZone = timeZone; + } + + icu_44::TimeZone* + IcuTimeZone() + { + return fTimeZone->fIcuTimeZone; + } + +private: + const BTimeZone* fTimeZone; +}; + + +#endif // _TIME_ZONE_PRIVATE_H diff --git a/src/kits/locale/DurationFormat.cpp b/src/kits/locale/DurationFormat.cpp index 8945ed9432..e887b1eac9 100644 --- a/src/kits/locale/DurationFormat.cpp +++ b/src/kits/locale/DurationFormat.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include // maps our unit element to the corresponding ICU unit @@ -112,18 +112,18 @@ BDurationFormat::SetTimeZone(const BTimeZone* timeZone) if (fCalendar == NULL) return B_NO_INIT; - BTimeZone::Accessor zoneAccessor; + BTimeZone::Private zonePrivate; if (timeZone == NULL) { BTimeZone defaultTimeZone; status_t result = be_locale_roster->GetDefaultTimeZone(&defaultTimeZone); if (result != B_OK) return result; - zoneAccessor.SetTo(&defaultTimeZone); + zonePrivate.SetTo(&defaultTimeZone); } else - zoneAccessor.SetTo(timeZone); + zonePrivate.SetTo(timeZone); - TimeZone* icuTimeZone = zoneAccessor.IcuTimeZone(); + TimeZone* icuTimeZone = zonePrivate.IcuTimeZone(); if (icuTimeZone != NULL) fCalendar->setTimeZone(*icuTimeZone);