diff options
Diffstat (limited to 'lotuswordpro/source/filter/localtime.cxx')
-rw-r--r-- | lotuswordpro/source/filter/localtime.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lotuswordpro/source/filter/localtime.cxx b/lotuswordpro/source/filter/localtime.cxx index 39b6e0212058..9532cbbdcba8 100644 --- a/lotuswordpro/source/filter/localtime.cxx +++ b/lotuswordpro/source/filter/localtime.cxx @@ -56,6 +56,7 @@ #include <localtime.hxx> #include <limits.h> #include <unicode/timezone.h> +#include <memory> const long DAY_SEC =24 * 60 * 60; const long YEAR_SEC = 365 * DAY_SEC; @@ -174,9 +175,9 @@ bool LtgLocalTime(long rtime,LtTm& rtm) if ((rtime > 3 * DAY_SEC)&&(rtime < LONG_MAX - 3 * DAY_SEC)) { - icu::TimeZone* pLocalZone = icu::TimeZone::createDefault(); + std::unique_ptr<icu::TimeZone> pLocalZone(icu::TimeZone::createDefault()); long offset = (pLocalZone->getRawOffset())/1000; - delete pLocalZone; + pLocalZone.reset(); long ltime = rtime + offset; return LtgGmTime(ltime,rtm); } |