Issue 92074

Summary: Unlocalized date format in Share Document dialog
Product: Calc Reporter: redflagzhulihua <ooo.redflag>
Component: uiAssignee: oc
Status: CLOSED FIXED QA Contact: issues@sc <issues>
Severity: Trivial    
Priority: P3 CC: issues, mikhail.voytenko, ooo, peter.junge
Version: DEV300m23   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 84405    
Attachments:
Description Flags
unlocalized date none

Description redflagzhulihua 2008-07-24 09:54:52 UTC
TCM testcase: 110044

The result of step 3 is correct.

Step 6 will show the incorrect date format.
Comment 1 redflagzhulihua 2008-07-24 09:56:33 UTC
1. Choose [File] > [New] > [Spreadsheet] and enter any strings 

2. Choose [Tools] > [Share Document] 

3. Check UI messages 

4. Select [Share this spreadsheet with other users] checkbox and click [OK] 
button 

5. Enter a filename in [Save As] dialog and click [Save] button 

6. Choose [Tools] > [Share Document] 
Comment 2 redflagzhulihua 2008-07-24 09:58:15 UTC
Created attachment 55341 [details]
unlocalized date
Comment 3 ooo 2008-07-24 10:39:08 UTC
Just because I'm the owner of i18n locale data and number formatter does not
mean I would be responsible for every dialog that should use localized formats..

@redflagzhulihua: please ensure that your system's respectively OOo locale
settings are set to Chinese.

@tbe: reassigning to you. It occurs to me that the dialog does use some
localized date format, just not the expected one. What means/method does it use?
Comment 4 thomas.benisch 2008-07-24 15:54:25 UTC
ER: 
The Share Document dialog displays the date string directly from
the shared control file. When writing the date to the shared
control file the method ShareControlFile::GetCurrentLocalTime()
(svtools/source/misc/sharecontrolfile.cxx) is used, which uses
osl_getSystemTime(), osl_getLocalTimeFromSystemTime() and
osl_getDateTimeFromTimeValue() in order to get aDate of type
oslDateTime. The date is then written in a self-defined(?)
format:

  sprintf( pDateTime, "%02d.%02d.%4d %02d:%02d", aDateTime.Day,
    aDateTime.Month, aDateTime.Year, aDateTime.Hours, aDateTime.Minutes );

MAV:
I think writing a localized date format in the shared control
file is the wrong approach (Let's consider the case of two
offices with different locales working on the same file.).
Therefore this issue must be fixed in the Share Document dialog
when displaying the date. What do you think?
Comment 5 ooo 2008-07-24 18:33:57 UTC
> The Share Document dialog displays the date string directly from
> the shared control file. [...]
> The date is then written in a self-defined(?)
> format:
> 
>   sprintf( pDateTime, "%02d.%02d.%4d %02d:%02d", aDateTime.Day,
>       aDateTime.Month, aDateTime.Year, aDateTime.Hours, aDateTime.Minutes );

Now that makes me wonder even more, because with DEV300m26 in an en-US
locale for the "Accessed" column I see the value formatted as
mm/dd/yyyy HH:MM
There must be something different displaying it in the dialog. In the
lock file the value is indeed present as dd.mm.yyyy HH:MM

For what is written to the file I would had suggested the ISO 8601
format yyyy-mm-dd HH:MM instead, which is unambiguous and reliable to
parse, for humans and machines ;-)
Comment 6 redflagzhulihua 2008-07-25 02:49:27 UTC
Hi er,
I'm sure my OOo locale setting is Chinese.
And step3 of the testcase show the localized date.
Comment 7 thomas.benisch 2008-07-25 09:43:55 UTC
I'm sorry for the confusion, but I didn't tell the whole story.

There are two different cases. In the first case we have an
unshared document (step 3) and no shared control file is
existing. In this case the modification date from the document
properties is taken. A localized string is generated by using
the methods ScGlobal::pLocaleData->getDate() and 
ScGlobal::pLocaleData->getTime().

In the second case we have a shared document (step 6) and an
existing shared control file. In this case the date displayed
in the Share Document dialog is taken from the shared control
file as written in my previous comment.
Comment 8 thomas.benisch 2008-07-25 09:45:31 UTC
As discussed with OC set to target OOo 3.0.1
Comment 9 thomas.benisch 2008-10-15 11:10:52 UTC
accepted
Comment 10 thomas.benisch 2008-10-15 12:24:28 UTC
fixed in CWS calc46

The following files are affected:

sc/source/ui/miscdlgs/sharedocdlg.cxx  1.6.134.1
Comment 11 thomas.benisch 2008-10-28 12:46:17 UTC
TBE->OC: Please verify in CWS calc46.
Comment 12 oc 2008-11-05 14:13:50 UTC
verified in internal build cws_calc46
Comment 13 amy2008 2009-01-14 05:26:42 UTC
Fixed.
Verified with OOo300m15 on Fedora. Works very well. Thank you for your work
Closing