Kaydet (Commit) 94c92063 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst 77debb67
......@@ -351,6 +351,7 @@ certain functionality.
@li @c ucb.ucp
@li @c ucb.ucp.cmis
@li @c ucb.ucp.ext
@li @c ucb.ucp.file
@li @c ucb.ucp.ftp
@li @c ucb.ucp.gio
@li @c ucb.ucp.gvfs
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment