Bug 79027 - Hyphenation does not work in Calc cells
Summary: Hyphenation does not work in Calc cells
Status: RESOLVED INVALID
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 86704
  Show dependency treegraph
 
Reported: 2014-05-21 17:21 UTC by Albrecht Müller
Modified: 2017-07-01 06:56 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot with hyphenation. (103.50 KB, image/png)
2014-05-23 23:50 UTC, m_a_riosv
Details
Example file with working hyphenation (13.02 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-05-30 10:33 UTC, Albrecht Müller
Details
Example file with broken hyphenation (13.69 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-05-30 10:45 UTC, Albrecht Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albrecht Müller 2014-05-21 17:21:12 UTC
Steps to reproduce:

Enter some text into some cell in a calc document. This text should be so long that it does not fit into the cell and therefore needs word wrap and hyphenation.  In the dialog box "format cells"(?) (German: "Zellen formatieren"), tab "justification" (German: "Ausrichtung") check "wordwrap"(?) (German: "Automatischer Zeilenumbruch") and "hyphenation"(?) (German: "Silbentrennung aktiv").


Current behavior:

The hyphenation checkbox seem to have no effect. Words that do not fit into the cell are split at the border of the cell and continued in the next line. No hyphen appears and the word is split at arbitrary locations.


Expected behavior:

If the hypenation checkbox is on then calc should split the word a correct hyphenation positions and add a hyphen. If for some reason hyphenation is not possible (e.g. no hyphenation tool is available) it should not be possible to activate the checkbox. Trying to activate hyphenation should result in some message that explains why hyphenation is not possible.


Platform: 
LibreOffice 4.2.4.2 german, Windows 7
Comment 1 m_a_riosv 2014-05-23 23:50:55 UTC
Created attachment 99681 [details]
Screenshot with hyphenation.

Hi Albrecht, thanks for reporting.

I can't reproduce the issue, with my locale in Spanish, selecting the font language German(Germany) for the cell, and the properties Wrap text, Hyphenation active.
Comment 2 Albrecht Müller 2014-05-27 08:31:17 UTC
Thank you for showing me an example of working hyphenation. Your example works for me too, including the wrong hyphenation: it should be "Zeilen-umbruch" instead of "Zeile-numbruch".

After some analysis of the problem I think that working hyphenation is an immutable property of a particular spreadsheet: If you copy a cell range between a spreadsheet with working hyphenation into another where hyphenation does not work you will observe that hypenated cells are no longer hyphenated and vice versa. Cloning spreadsheets either by using some operating system copy command or the "save as" command in Calc preserves this property.

It matters how you create the spreadsheet. If you start Calc without parameters Calc will show some empty spreadsheet. You can work with this and save it and you will get a document with working hyphenation.

Another way to create a new spreadsheet is to use the Windows Explorer and use file -> new -> OpenDocument table document. If you do this you will get a document that does not support hyphenation.

Can you confirm this observation? Note: I tried this with the German version of Windows 7 and using the German user interface of LibreOffice, so I am not sure if my translation of the commands is correct.

During my experiments I observed another strange effect: I tried to compare the settings of the file where hypenation worked with those where it did not work. Therefore I opened both documents, selected corresponding cells and opened the dialog box you show in the attachment. With the dialog box open in both documents I could not switch between the documents any more. When I had opened the second dialog box and tried to switch to the other document by clicking in the caption bar of the first document the focus immediately switched back to the second document. If I did not release the mouse button the focus remained for about one second on the first document before switching back again to the second document. Using ALT+TAB shows a similar effect: If the focus is set to the first document it immediately switches to the second one. If I close one of the dialog boxes switching between the documents is possible again.  I have got the impression that this problem is related to bug 79025 or bug 48300.
Comment 3 Albrecht Müller 2014-05-29 15:50:39 UTC
The file containing the hypenation problem shows another one that I consider much worse: It does not reliably update the contents of the cells. When I use a calculation program the last thing I expect is that I have to double check the numbers by hand, and that is exactly the consequence of this problem.

I report it here as it seems to be related to the original problem. It occurs in the same file, and some operations on cells are not performed correctly. One is hyphenation, the other is updating (recalculating) the cell content. While the hyphenation problem is easily to reproduce (see previous comment), I did not find a way to create an example file that shows the other one.  Therefore I can give only a few observations here. They are based on experiments with a file I happened to save in a state which allows to reproduce the problem reliably.

(1) The main symptom is that there are cells that do not display the correct results of the formula they contain. The numbers displayed seem to come from some previous calculations despite the fact that automatic recalculation is on and works for other cells. Pressing F9 to force a recalculation does not change anything. The formula reference chain seems to be broken.

(2) Maybe the problem has common roots with bug 43003, which I could reproduce using  LibreOffice calc Version: 4.2.4.2 Build-ID: 63150712c6d317d27ce2db16eb94c2f3d7b699f8. It is not the same problem as I do not use array functions, only built in functions like sum ("Summe" in German) and names for cells and cell ranges. Bug 44143 seems to be fixed in this version of Calc.

(3) The problem seems to require a speadsheed of some minimum complexity. I was not able to build an example from scratch.

(4) This problem is difficult to observe, as it occurs only rarely and it seems to disappear in many (but not all) cases when a cell is changed on which the content of the cell in question depends.  Seems as if the broken reference chain gets repaired somehow. On the other hand a single table can contain quite a few cells containing wrong results.

(5) A cell that refers to other cells only by names should show the same value as the original when it is copied to some other place.  The copy of a cell with a wrong value shows the correct value at the target location. The net effect is that you can have two cells containing exactly the same formulas referring to exactly the same cells but showing different values. This behavior differs from the example in bug 43003. When I copied the cells F1 (after having changed A1 to $A$1) to some other places all the copies showed the same wrong value.

(6) Undo does not work in the sense that it does not restore exactly the previous state: Adding a blank character at the end of formula in some cell which shows a wrong result usually does not change the semantics of the formula but forces the cell to show the correct result. The undo operation does not restore the wrong result.  I tried this trick with the example given in bug 43003. It did work there on cell F1 (containing "=INC(A1)"), but not on matrix B1:C1 (containing '=INCDINC(A1)"). The formula reference chain seems to remain broken in this case.
Comment 4 Albrecht Müller 2014-05-29 16:40:28 UTC
Additional information to the previous comment: The example file in bug 43003 has automatic recalculation turned off, during some experiments I forgot to turn it on. Therefore point (5) and (6) in the previous comment refer to the behavior when automatic recalculation is off. When it is on, cell F1 updates correctly, but not the matrix B1:C1. Editing the matrix formula without doing semantic changes did not trigger an update to the correct values. In this case it does not matter if automatic recalculation is on or off.

Hyphentation works in this example file. Therefore I assume it has been created by saving a spreadsheet from Calc and not by using the Windows Explorer.
Comment 5 m_a_riosv 2014-05-29 19:27:46 UTC
Automatic calculation or calculate [F9] does the recalculation of the cells with modifications in their precedents.

There is the hard recalc [Ctrl+Shift+F9] to recalculate all cells and functions.
https://help.libreoffice.org/Calc/Recalculate.

Please attach a file where to reproduce the issue.
Comment 6 Albrecht Müller 2014-05-30 09:34:57 UTC
Thank you for the hint at the hard recalc functionality. After pressing [Ctrl+Shift+F9] my spreadsheet seems to show correct values which solves my current problem. I think it would be very useful to have a menu entry that lets you trigger a hard recalc as it can help in situations where something is wrong with the recalculation of modified cells. It should be next to the position where the other recalc options are (automatic recalculation on/off, recalc modified cells [F9]).

Unfortunately I cannot provide a file to reproduce the issue.  My spreadsheet contains data I do not want to share, and changing the data destroys the effect. As I do not know what triggers the problem I was not yet able to create an example file from scratch.
 
You may have a look at bug 43003. This one is easy to reproduce, and for this example even a hard recalc is not hard enough. In order to see correct data you have to save and reload the changed spreadsheet. This behavior differs from my case, however, as saving and reloading does not change the numbers.
Comment 7 Albrecht Müller 2014-05-30 10:33:47 UTC
Created attachment 100156 [details]
Example file with working hyphenation

This file was created by opening Calc, editing the empty spreadsheet and then saving the file. It contains one cell B2 which should display some German text which contains automatically generated hyphens.
Comment 8 Albrecht Müller 2014-05-30 10:45:40 UTC
Created attachment 100157 [details]
Example file with broken hyphenation

This file was created by creating a new LibreOffice speadsheet using the Windows Explorer, and then opening it in Calc and editing it. It contains one cell B2 which should display some German text which should contain automatically generated hyphens.  Words are split without hyphens at wrong positions.
Comment 9 m_a_riosv 2014-06-01 13:11:06 UTC
Neither copying I have a crash:

To reset user profile follow the instructions in:

https://wiki.documentfoundation.org/UserProfile
Comment 10 m_a_riosv 2014-06-01 13:14:21 UTC
Sorry Albrecht, last comment was for other thread.
Comment 11 m_a_riosv 2014-06-03 22:42:02 UTC
Seems there is not language selected for the font options in the cell style, neither in default style.

Selecting the language in default style works fine.

I have not set up to create new files from windows explorer to verify.
Comment 12 Albrecht Müller 2014-06-06 11:10:46 UTC
Your remark gave me a hint where to look for the language settings. Set the language to German ==> hyphenation worked.

Therefore I think the issue is not in the functionality itself but in the user interface. To illustrate this here comes a short story describing my user experience:

I dont use Calc on a regular basis, had some numbers to calculate and thought, the best way to this is to create a litte spreadsheet. I needed some documentation which did not fit in a cell, so I found the word wrap and hyphenation features. Word wrap worked, but hyphenation did not. Hyphenation depends on the language, therefore something may be wrong with the language settings. So I looked into the extras -> language menu. It is roughly the same as the corresponding menu of the Writer component.  The main difference: the essential part, that allows you to choose a language, is missing. So I cannot set the language, all language dependent features are useless. I gave up and did a manual hyphenation.

After having entered the necessary calculations I had to enter a few of the results by hand into a program running on another machine.  To make sure I copied the data correctly I did some calculation by hand using the numbers I had just entered.  The results did not match. After some double checking of calculations and numbers I was sure: The numbers I got from Calc were incorrect.  Toggling autocalc or pressing F9 did not help. Eventually I found a way to correct the wrong values by doing irrelevant changes to the formulas. While doing so I tried the undo function. Result: Undoing the changes did not restore the previous values.

Summary: Hyphenation does not work, they forgot the essential part in the language settings menu, calculations are wrong and the undo function does not work. I detected all this in a single simple spreadsheet - what a broken program!

Thanks to your help I know now how to deal with these issues. I also have an easy explanation why the two spreadsheeds behave differently: If you create a spreadsheet using the Windows Explorer you get one where the language of all cells is set to "None". Therefore hyphenation does not work. If Calc creates a new spreadsheet it it seems to use the language of the current location, in my case, German. Therefore hyphenation works.
 
It took me hours to reach this point.  Proper feedback from the user interface could render this to a matter of seconds:

1) When I turn hyphenation on I expect to see hyphenation. There may be sound reasons why this cannot work as expected, e.g. because the language setting does not support hyphenation. In this case the user interface should give some feedback that explains the cause of the problem ("Your language setting 'None' does not support hyphenation.") and provides some hints what to do about ("You can change the language setting ... there ...").

2) If possible, the user interfaces of the different components of LibreOffice (Writer, Calc etc.) should work the same way. If you use Writer you can set the language in  the extra -> language menu. This should work in Calc too. I never expected to find the language settings at the place where you choose fonts. Writer keeps font and language settings separate.

3) The menu controlling the calculation modes needs more entries and some easily reachable description (tooltip?):
3.1) Autocalc - The standard mode. Equivalent to pressing F9 after every  change of cell content. Is already in the menu.
3.2) F9 - recalculation of all cells that depend of values that have been changed. This is useful for spreadsheets that contain time consuming calculations. If you do not want to wait for the the calculations to complete after you changed some cell values you can turn off autocalc and press F9 whenever you want to see new results. This is also already in the menu. Unfortunately it does not help if something is wrong with the spreadsheet.
3.3) Hard recalc [Ctrl+Shift+F9]. This is for situations where there are cells that get not updated by the previous mechanism. Should rebuild  from scratch the information that tracks changes and recalculate all values. I think this function is implemented but the menu does not offer it. Therefore it is hard to find. 
3.4) Very hard recalc. Hard recalc does not always work (see  bug 43003). Therefore you need a functionality equivalent to saving a spreadsheet, reloading it and pressing [Ctrl+Shift+F9] (Reloding alone seems not to solve the problem of cells containing obsolete values). Could be integrated into the  [Ctrl+Shift+F9] functionality. I see no need to have this as a separate function if it does not actually overwrite the original file.
Comment 13 Yousuf Philips (jay) (retired) 2014-11-14 09:43:20 UTC
CCing Cor, Joel and Luke for them to give their opinions.
Comment 14 Albrecht Müller 2014-11-17 19:30:42 UTC
In comment 3 I mentioned a problem but could not provide an example to reproduce it. In the meantime I found out that it is possible to use attachment 102929 [details] to reproduce this (or at least a similar) problem. For details see the last two paragraphs of the comment number ten of bug 81453#10.

My impression now is that the problem is not caused by a broken reference chain. Maybe somebody should have a closer look at the handling of references in names during cut, copy and paste operations.
Comment 15 Albrecht Müller 2014-11-17 19:33:52 UTC
Sorry, it is comment number 10 of bug 81435.
Comment 16 Robinson Tryon (qubit) 2014-11-21 23:46:43 UTC
(In reply to Albrecht Müller from comment #3)
> The file containing the hypenation problem shows another one that I consider
> much worse: ...
> I report it here as it seems to be related to the original problem...

I'm hesitant to group both problems together into a single bug. Let's focus on just the hyphenation problem for now.

(In reply to Albrecht Müller from comment #12)
> Your remark gave me a hint where to look for the language settings. Set the
> language to German ==> hyphenation worked.
> 
> Therefore I think the issue is not in the functionality itself but in the
> user interface...
> 
> Summary: Hyphenation does not work, they forgot the essential part in the
> language settings menu, calculations are wrong and the undo function does
> not work. I detected all this in a single simple spreadsheet - what a broken
> program!

One bug per issue, please.

> If you create
> a spreadsheet using the Windows Explorer you get one where the language of
> all cells is set to "None". Therefore hyphenation does not work. If Calc
> creates a new spreadsheet it it seems to use the language of the current
> location, in my case, German. Therefore hyphenation works.

Aha! These look like good, short repro steps.

> 1) When I turn hyphenation on I expect to see hyphenation. There may be
> sound reasons why this cannot work as expected, e.g. because the language
> setting does not support hyphenation. In this case the user interface should
> give some feedback that explains the cause of the problem ("Your language
> setting 'None' does not support hyphenation.") and provides some hints what
> to do about ("You can change the language setting ... there ...").

I think that could be a good enhancement. Please file that as a separate (enhancement) bug report.

> 2) If possible, the user interfaces of the different components of
> LibreOffice (Writer, Calc etc.) should work the same way. If you use Writer
> you can set the language in  the extra -> language menu.

Which menu? How does one navigate to the Extra -> Language menu?

> This should work in
> Calc too. I never expected to find the language settings at the place where
> you choose fonts. Writer keeps font and language settings separate.

I agree that Font and Language settings in Format -> Cells should be clearer. Perhaps separate tabs? Please file a separate enhancement request for this feature.
Comment 17 Albrecht Müller 2014-11-25 17:55:39 UTC
(In reply to Robinson Tryon (qubit) from comment #16)

> I'm hesitant to group both problems together into a single bug. Let's focus
> on just the hyphenation problem for now.

There is already a separate bug report concerning the other problem, see comment 14 and comment 15, bug 81435. 

When I use LibreOffice I try to get some work done. In this context I expect that turning hyphenation on is a matter of seconds, or maybe a few minutes if I am not familiar with this functionality and have to locate the necessary controls first. It went wrong and there was no clue why I could not achieve what I wanted: Did I overlook something obvious, does this feature work at all, is something wrong with my machine or the installation, is there one or several bugs, etc. I think a clear bug report describing a single easily reproducible problem is at the end of a time consuming and often crooked process, not at the beginning.

> One bug per issue, please.

It is about a single user experience. As described above we are still in the process of finding out what went wrong. Furthermore I think it is an issue of its own right if you try to achieve something simple like changing the hyphenation property of some spreadsheet cell, and starting with some wrong assumption about how to do this lets you run into multiple issues, in this case:
- Insufficient feedback from the user interface (there was no easily recognizable hint that the language setting might be wrong)
- Inconsistent user interface (see below, "Language" menu)
- Inconsistent language settings in spreadsheets generated using the Windows Explorer (Language = [None]) and those generated as "new" within Calc (Language = Language of the user interface(?))
- Wrong hyphenation ("Zeile-numbruch" instead of "Zeilen-umbruch")
- Strange blocking effects (see comment 2)
- Wrong results of calculations with additional issues (see comment 3, comment 14 and comment 15, bug 81435)

> > If you create
> > a spreadsheet using the Windows Explorer you get one where the language of
> > all cells is set to "None". Therefore hyphenation does not work. If Calc
> > creates a new spreadsheet it it seems to use the language of the current
> > location, in my case, German. Therefore hyphenation works.
> 
> Aha! These look like good, short repro steps.

Being able to write this kind of problem description demonstrates that I have acquired the skills necessary to turn hyphenation on or off. At this stage I don't benefit any more if this bug gets fixed. I think this points to a fundamental flaw in the one bug per issue error reporting scheme. At this level of skills you may loose the ability to understand why the different language settings are a problem. Therefore you would not report a bug. 

> I think that could be a good enhancement. Please file that as a separate
> (enhancement) bug report.

Is now bug 86704.

> > 2) If possible, the user interfaces of the different components of
> > LibreOffice (Writer, Calc etc.) should work the same way. If you use Writer
> > you can set the language in  the extra -> language menu.
> 
> Which menu? How does one navigate to the Extra -> Language menu?

Please replace "Extra" by "Tools". Sorry for this mistake, the "Tools" menu is called "Extras" in the German version of the user interface. The main menus of Writer and Calc both contain a "Tools" entry and the menu behind this entry contains a "Language" entry. In Writer the menu behind this entry allows you to set the language for selection, paragraph or all text. This provides a convenient way to specify the language settings, and I therefore was not aware that it is possible to set the language using the "font" tab in character formatting dialogue. That is why I knew of no way to set the language when I discovered that Calc's "Language" menu did not contain the corresponding entries. As I think that font and language are unrelated things it took me a long time until I discovered the alternative way to control the language settings.

There seem to be subtle differences in the way hyphenation works in Calc and in Writer – please correct me if I am wrong: 

Writer: The "Hyphenation" entry in the "Language" menu seems to start a hyphenation process that affects the whole document. I know of no way to exclude parts of a document from hyphenation in a language independent way. There is no automatic hyphenation. Language settings can be specified with single character precision.

Calc: The "Hyphenation" entry in the "Language" menu allows you to turn automatic hyphenation on or off. Hyphenation occurs only in those parts of the document where automatic hyphenation is on. The settings of the hyphenation are independent of the language settings. The least unit for hyphenation and/or language settings is a single cell.

> I agree that Font and Language settings in Format -> Cells should be
> clearer. Perhaps separate tabs? Please file a separate enhancement request
> for this feature.

I fear that changing the user interface for Font and Language settings in Format -> Cells will not be very helpful. As explained above the main problem was that I was not even aware, and did not expect, that I can use a formatting tool to change the language settings.
Comment 18 Joel Madero 2014-12-31 17:32:11 UTC
Hi Albrecht -

I hate to do this bug I'm closing this as INVALID. There is just too much going on and no developer will look at a bug that has so many issues. As Robinson Tryon said - one issue, one bug. This one has paragraphs and paragraphs of separate issues that is just really difficult to locate what the issue is.

Please report separate bug reports for each issue. It seems like comment 2 has the hyphenation problem but then you have a few other problems listed throughout in different comments.

Again - apologies for closing this but if you want an issue to get resolved the report really has to be succinct, to the point, clear reproducible steps, and attachments if appropriate. Else, there is no hope of ever getting the issue resolved. Thanks for your understanding and patience.