In Calc, when you set the a cell format to "text", the cell value alignment does not change to left accordingly. However, when you type in new values in cells pre-formatted as "text", the values are align left as expected. Steps to Reproduce: 1.1. Type "123" in A1, without quotes. 1.2. Set cell format of A1 to "Text". (Observe that the value is right-aligned. The expected behaviour is left-aligned as the cell value is text). 2.1. Set cell format of A2 to "Text". 2.2. Type "123" in A2, without quotes. (Oberve that the value is left-aligned. This is expected.) Version: 5.0.4.2 Build ID: 2b9802c1994aa0b7dc6079e128979269cf95bc78 Locale: zh-CN (zh_CN) Win10 x64.
Reproducible with LO 5.1.0.1, Win 8.1
(In reply to Kevin Suo from comment #0) > 1.1. Type "123" in A1, without quotes. > 1.2. Set cell format of A1 to "Text". > (Observe that the value is right-aligned. The expected behaviour is > left-aligned as the cell value is text). 1. You type 123 in A1 : This is a numeric value. 2. You are formatting the cell as "Text". Changing format of a cell with data do not affect data, the cell content is still a numeric value. > 2.1. Set cell format of A2 to "Text". > 2.2. Type "123" in A2, without quotes. > (Oberve that the value is left-aligned. This is expected.) 2.3 Change format A2 to "Standard" or any numeric format. A2 is still left aligned and "123" is still text. No bug here. Changing cell format never affect cell content.
(In reply to GerardF from comment #2) > (In reply to Kevin Suo from comment #0) > > > 1.1. Type "123" in A1, without quotes. > > 1.2. Set cell format of A1 to "Text". > > (Observe that the value is right-aligned. The expected behaviour is > > left-aligned as the cell value is text). > > 1. You type 123 in A1 : This is a numeric value. > 2. You are formatting the cell as "Text". > > Changing format of a cell with data do not affect data, the cell content is > still a numeric value. > > > 2.1. Set cell format of A2 to "Text". > > 2.2. Type "123" in A2, without quotes. > > (Oberve that the value is left-aligned. This is expected.) > > 2.3 Change format A2 to "Standard" or any numeric format. > A2 is still left aligned and "123" is still text. > > No bug here. Changing cell format never affect cell content. Why should the cell format never affect the cell content? If I decide after typing some characters to mark them as text then I would expect that it is text and that I don't have to type it again to get the same behaviour as it would be if I would have marked the cell as text before typing?
(In reply to GerardF from comment #2) Well, please let some other excel/Calc expert or daily spreadsheet users comment before close this bug as NOTABUG. I Microsoft Excel this works perfect, but does not work in Calc. I will do some investigation to see if this is a regression - It should have worked in old LibreOffice versions. Mark as ENHANCEMENT UNCONFIRMED for now
(In reply to Kevin Suo from comment #4) > In Microsoft Excel this works perfect. Changing format have never convert numeric to text (or reverse), neither in Excel nor in other spreadsheet software. But I let open as asked.
Created attachment 121654 [details] test file: values in column A should align left as they are formatted as "TEXT" (In reply to GerardF from comment #5) I am not saying that format a cell as "text" should change the value of the cell. I am saying "Cell With Numeric Values Formatted As "TEXT" Should Align Left". Yes, the values are numeric, but they are formatted as TEXT, so they should align left by default. Excel is doing the correct behaviour.
Created attachment 121655 [details] Excel and Calc compare
Well 'text' formatted cells should take the input as-is, no matter what. So calc shouldn't filter them for 'numbers'.
Created attachment 121738 [details] I have submitted the patch which solves this issue. I have submitted the patch which solves this issue.
Created attachment 121739 [details] Type the numbers in cell & then change format as Text 1. Type 123 in A1 while format is General. 2. Type 123 in B1 and then make format as Text (Check side Bar which shows the same for B1) I have submitted the patch which accomplish expected behaviour of Left-alignment for "Text" Format.
Just FYI, the patch submitted by Yogesh Desai is: https://gerrit.libreoffice.org/#/c/21134/ It is currently under code review.
Yogesh Desai committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=812ebe795219966a05baca5719b528c186a0baf6 tdf#96822 : Make cell contents left align when number formatting is text It will be available in 5.2.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.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e172d2e300e600d53975a39161ceed0c7158e1e0 nitpicks, tdf#96822 follow-up It will be available in 5.2.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.
Any plan to apply this to 5.1 branch?