Bug Hunting Session
Bug 102357 - FILESAVE: Language set for portions of text lost after saving
Summary: FILESAVE: Language set for portions of text lost after saving
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2 all versions
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.3.0 target:5.2.4
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-09-22 09:52 UTC by pierre-yves samyn
Modified: 2016-10-21 08:37 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pierre-yves samyn 2016-09-22 09:52:24 UTC
Hi

Steps to reproduce

1. File> New> Spreadsheet
2. In A1, type A B C
2. Double click A1, select B
3. Format> Character> Font tab> Language: select a language other than the default
4. File> Save then File> Reload
5. Double click A1, select B
6. Format> Character> Font tab> Language is lost

Of course, same problem if you directly assign a new language to the selected characters during typing (step 1). 

Language set to the cell (e.g. right click the cell> Format Cells is *not* lost.

Platform: windows 7/64 & Version: 5.2.1.2
Build ID: 31dd62db80d4e60af04904455ec9c9219178d620
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
Locale: fr-FR (fr_FR); Calc: group

Regards
Pierre-Yves
Comment 1 Eike Rathke 2016-10-06 20:15:46 UTC
Confirmed, but removing regression keyword (or compared to which version this is a regression? Did it ever work?).
Comment 2 pierre-yves samyn 2016-10-08 05:12:54 UTC
Hi

(In reply to Eike Rathke from comment #1)
> Confirmed, 

Thank you

>but removing regression keyword (or compared to which version
> this is a regression? Did it ever work?).

As this action seems strange to me! 

1. Why would I added this keyword (which is not selected by default) without knowing that it is a regression?
2. Why remove without knowing?

NEED INFO would have been enough. I feel bad considered. Whatever...

I did not have means to specify the regression when I submitted this report. I can now specify a little:

- was ok since OOo to 4.1.0.2 (windows)
- was not ok with Version: 4.2.0.1 Build ID: 7bf567613a536ded11709b952950c9e8f7181a4a

HTH
Best Regards
Comment 3 Markus Mohrhard 2016-10-16 07:17:35 UTC
@Eike: So this is an import problem. The problem is in LanguageTag::convertToLanguageType where we check that rLocale.Language.isEmpty() and return the system locale in that case. However it seems that we only have:

aLocale
$10 = {Language = "", Country = "DE", Variant = ""}

Does it make sense if only Country is set?
Comment 4 Eike Rathke 2016-10-17 09:57:07 UTC
No, that doesn't make sense at all.
Comment 5 Eike Rathke 2016-10-17 12:59:00 UTC
Actually it's not an import problem, <style:style style:name="T1" style:family="text"> is written with <style:text-properties fo:country="DE"> but no fo:language.
Comment 6 Eike Rathke 2016-10-17 13:44:19 UTC
I'm trying to wade my way through export to find the culprit that's not using SvXMLExport::AddLanguageTagAttributes() to write..
Comment 7 Eike Rathke 2016-10-17 18:44:01 UTC
Respectively not all XMLPropertyHandler derived XMLCharLanguageHdl, XMLCharScriptHdl, XMLCharCountryHdl and XMLCharRfcLanguageTagHdl.
Comment 8 Commit Notification 2016-10-17 19:11:46 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c3f096c7630994450625307091a0e6009fb02bc4

Resolves: tdf#102357 export correct locale attribution, not just country

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2016-10-17 19:29:14 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=27466acb4eda3ec6432d575091effe6c3a780950

pamper over-pessimistic whining compilers, tdf#102357 follow-up

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Eike Rathke 2016-10-17 19:53:45 UTC
Pending review
https://gerrit.libreoffice.org/29986 for 5-2
Comment 11 Commit Notification 2016-10-18 07:57:24 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=46ecb53fe18acef193314306355252363fe76ff9&h=libreoffice-5-2

Resolves: tdf#102357 export correct locale attribution, not just country

It will be available in 5.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 pierre-yves samyn 2016-10-21 08:37:36 UTC
Hi

Verified on windows 7/64 & Version: 5.3.0.0.alpha1+
Build ID: 8a796410ec8f440b4163b15b928347c499da7a8f
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-10-20_23:07:21
Locale: fr-FR (fr_FR); Calc: group

Fast and efficient, thank you!

Regards
Pierre-Yves