Bug 31271 - Automatic line break inserted between text and closing parenthesis
Summary: Automatic line break inserted between text and closing parenthesis
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All Linux (All)
: medium minor
Assignee: Caolán McNamara
Depends on:
Reported: 2010-10-31 16:39 UTC by Rene Engelhard
Modified: 2011-06-08 05:02 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:

screencast (784.14 KB, audio/ogg)
2010-11-12 12:29 UTC, Rene Engelhard
ODT (9.51 KB, application/vnd.oasis.opendocument.text)
2010-11-12 12:31 UTC, Rene Engelhard
well, most basic route to regain original layout (648 bytes, patch)
2011-01-24 13:08 UTC, Caolán McNamara
slightly more involved, seems to work (3.22 KB, patch)
2011-01-25 07:18 UTC, Caolán McNamara

Note You need to log in before you can comment on or make changes to this bug.
Description Rene Engelhard 2010-10-31 16:39:48 UTC
From http://bugs.debian.org/601078:

--- snip ---
If I write text that contains parenthesis, such as "(Some text)" Writer may     
the line before the closing parenthesis if it reaches the end of line:          
  ... text (some text                                                           
The closing parenthesis should always be on the same line with the preceding    
so that line is broken like this:                                               
  ... text (some                                                                
Switching the text language does not seem to help.                              
This bug appears to be specific to Debian OOo. I cannot reproduce it with       
upstream OOo or LibreOffice and a person on Finnish OOo mailing list reported   
it does not occur in OOo packages provided by Ubuntu or OpenSUSE either.
--- snip ---

I can reproduce this, but as he says I can't in OOo. But I don't understand why other people (especially Ubuntu) doesn't have it? Maybe it's becuase of ICU 4.4?
Comment 1 Charles Plessy 2010-11-11 00:35:37 UTC

this problem also seems to affect Arch linux and Mandriva:



Charles Plessy
Tsurumi, Kanagawa, Japan
Comment 2 Petr Mladek 2010-11-12 11:19:57 UTC
I am not able to reproduce it. Could you please attach a sample document that shows the problem with your build?
Comment 3 Rene Engelhard 2010-11-12 12:28:20 UTC
well, open a document, type. type random crap until the end of  the line, then ). You get a "lonely" ) at the next line.
Comment 4 Rene Engelhard 2010-11-12 12:29:53 UTC
Created attachment 40244 [details]
Comment 5 Rene Engelhard 2010-11-12 12:31:03 UTC
Created attachment 40245 [details]
Comment 6 Petr Mladek 2010-11-16 06:32:48 UTC
I am not able to reproduce it.

Cedric, do you have any  idea what to do with it?
Comment 7 Gabriela 2010-11-30 18:27:25 UTC
(In reply to comment #6)
> I am not able to reproduce it.
> Cedric, do you have any  idea what to do with it?

Hello, I'm no expert, just an ordinary Arch user, so please be patient with me, I'm still learning, ok?
I have experienced this problem, and it is no minor problem for me, I'm writing my phd thesis, it's a long document full of parentheses (citations etc.), and they break all the time. The whole text is full of broken lines due to this parentheses-bug!!!
Please, can you help me solve it?
I'll be most grateful to you all.

ps: if you need I can attach a part of my document (it's in Brazilian Portuguese, but you'll be able to check how the bug works)

Thanks agains,

Gabriela - Brasil
ArchLinux - OO Writer 3.2.1
Comment 8 Charles Plessy 2010-12-05 16:39:16 UTC
It looks like the bug affects distributions that build OpenOffice against libicu version 4.4 instead of 4.2. Indeed, between these two versions the handling of the right parenthesis and right square bracket, but not the right curly bracket have been moved from a ‘Close_Punctuation’ (CL) to a ‘Close_Parenthesis’ (CP) category. This completely fits with the symptoms that were also reported to the openoffice bug tracker (112240) and my experience as well, where right curly bracket still behave correctly. See for instance the following diff in icu's trac, where 0029 and 005D are the right closing parenthesis and square bracket respectively.

Comment 9 Cesare Leonardi 2011-01-07 08:35:50 UTC
Are there any progress with libicu? An upstream bug that can be tracked?

I confirm that on 3.3.0rc2 this bug happens on Debian but not under Windows2000.
I've used non-breaking as a temporary unelegant workaround: annoying.

Comment 10 Rene Engelhard 2011-01-07 09:32:29 UTC
Judging from the comment from Charles, it's not a libicu bug but a bug that OOo/LibO need to be updated (#ifdef's) for the new stuff there, so..
Comment 11 Caolán McNamara 2011-01-24 13:08:10 UTC
Created attachment 42406 [details]
well, most basic route to regain original layout
Comment 12 Caolán McNamara 2011-01-25 07:18:49 UTC
Created attachment 42460 [details]
slightly more involved, seems to work

So I've now added a cppunit test for the line breaking into i18npool so we won't get caught again like this. Its currently disabled but I'll enable it in a bit.

So what do we think of this patch to detect the icu version at build time and fix things up.
Comment 13 Rene Engelhard 2011-01-25 08:05:49 UTC
caolan: nice :)
Comment 14 Rainer Bielefeld Retired 2011-01-29 00:27:19 UTC
NOT Reproducible with "LibreOffice 3.3.0 RC4 - WIN7  Home Premium (64bit) German UI  [OOO330m19 (build 6 / tag]".
I created some "Lorem Ipsum" text, added ")" to a last word of the line so that auto linebreak will move it to next line, and never only ")" has been moved to next line.

Also sample document looks fine for me.

It seems only Linux is affected?
Seems detected first in beta2 or earlyer?

Current state of this problem?
Comment 15 Caolán McNamara 2011-01-29 02:37:06 UTC
The problem is triggered by the version of libicu used with it. We took the conservative version, which is unaffected, for the "stock" builds we make available for Windows and Linux. So it only affects "distro" builds which use a different libicu version.

I'll take this one as I've a fix for it.
Comment 16 Caolán McNamara 2011-01-29 04:59:21 UTC
done for master, and as-per rene's ack for 3-3 as well