diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-02-23 10:31:21 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-02-23 10:48:18 +0100 |
commit | 94c9206399954d018aae8a1bd4e4b33354b9cdaf (patch) | |
tree | b1c984cbaaab87fc66f39a89cd7e9a8766ab0b39 /ucb | |
parent | 77debb673e61340dfc3ddc63b6d72731c091c210 (diff) |
file UCP: Ensure myLocalTime is initialized
When a file's time is epoch (1970-01-01 00:00:00, i.e., TimeValue temp is all
zero) and the TZ is UTC or westward, osl_getLocalTimeFromSystemTime returns
false and leaves myLocalTime uninitialized. That e.g. confuses getModuleByUrl
(scripting/source/pyprov/pythonscript.py), potentially re-loading a Python
script with epoch time (as happens e.g. for the share/Scripts/python/ files in
an xdg-app installation of LO) every time it is accessed, falsely assuming it
has changed on disk since last load.
Change-Id: I8d4228feb28e2697a7021e3488ae2c09e8439ed8
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/file/shell.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index c07e97d49be8..36eb82d9dae0 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -2440,7 +2440,14 @@ shell::commit( const shell::ContentMap::iterator& it, // Convert system time to local time (for EA) TimeValue myLocalTime; - osl_getLocalTimeFromSystemTime( &temp, &myLocalTime ); + if (!osl_getLocalTimeFromSystemTime( &temp, &myLocalTime )) + { + SAL_WARN( + "ucb.ucp.file", + "cannot convert (" << temp.Seconds << ", " << temp.Nanosec + << ") to local time"); + myLocalTime = temp; + } oslDateTime myDateTime; osl_getDateTimeFromTimeValue( &myLocalTime, &myDateTime ); |