[Upstream] Regular expression "\n" in replace field inputs "\n" instead of paragraph break

Bug #892476 reported by Shahar Or on 2011-11-19
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
LibreOffice
Confirmed
Medium
libreoffice (Ubuntu)
Medium
Unassigned

Bug Description

1) lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

2) apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.4.4-0ubuntu1~ppa1
  Candidate: 1:3.4.4-0ubuntu1~ppa1
  Version table:
 *** 1:3.4.4-0ubuntu1~ppa1 0
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ oneiric/main i386
Packages
        100 /var/lib/dpkg/status
     1:3.4.3-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages

3) What is expected to happen in LibreOffice Calc is when one of the cells
contains a line break -> Edit -> Find and Replace... -> in the "Search for"
drop down \n -> in the "Replace with" drop down \n -> Regular expression button
checked is the line break is replaced with a paragraph break as noted in
http://help.libreoffice.org/Common/List_of_Regular_Expressions

4) What happens instead is the line break is replaced with the characters \n

ProblemType: BugDistroRelease: Ubuntu 11.10
Package: libreoffice-calc 1:3.4.3-3ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Sat Nov 19 13:02:28 2011
EcryptfsInUse: YesInstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)SourcePackage: libreoffice
UpgradeStatus: Upgraded to oneiric on 2011-10-16 (34 days ago)

Shahar Or (mightyiam) wrote :

Shahar Or, thank you for reporting this and helping make Ubuntu better. In order to have \n treated as a new line, one must click the "More Options" button -> check "Regular expressions". Thank you for reporting this and feel free to report any future bugs you may find.

Changed in libreoffice (Ubuntu):
status: New → Invalid
Shahar Or (mightyiam) on 2011-11-19
summary: - "\n" in replace field of Calc's search and replace is treated as text
+ "\n" in Calc's search and replace is treated as text
description: updated
Changed in libreoffice (Ubuntu):
status: Invalid → New

Shahar Or, please do not undo the status of this bug without commenting on why this should occur. For more on Status please see: https://wiki.ubuntu.com/Bugs/Status

Changed in libreoffice (Ubuntu):
status: New → Invalid
Shahar Or (mightyiam) wrote :

I thought that my change of description was making it clear enough. Thanks.

In 3.4.4 ffrom oneiric proposed the searching for "\n" works and the replacing by "\n" is still treated as text.

summary: - "\n" in Calc's search and replace is treated as text
+ "\n" in replace field of Calc's search and replace is treated as text
description: updated
Changed in libreoffice (Ubuntu):
status: Invalid → New
description: updated

Shahar Or, regarding "\n" in the replace field with the regular expressions box checked, this will replace whatever is found with a paragraph break, not a line break. For more on this please see http://help.libreoffice.org/Common/List_of_Regular_Expressions . Marking to Invalid. Thank you for reporting this. Please feel free to report any future bugs you may find.

Changed in libreoffice (Ubuntu):
status: New → Invalid
Shahar Or (mightyiam) wrote :

As I've mentioned upstream I've found that in Calc, the "\n" in the replace field is produced as just text "\n" and not paragraph break, either.

Changed in libreoffice (Ubuntu):
status: Invalid → New

Downstream bug may be found at:
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/892476

1) lsb_release -rd
Description: Ubuntu 11.10
Release: 11.10

2) apt-cache policy libreoffice-calc
libreoffice-calc:
  Installed: 1:3.4.4-0ubuntu1~ppa1
  Candidate: 1:3.4.4-0ubuntu1~ppa1
  Version table:
 *** 1:3.4.4-0ubuntu1~ppa1 0
        500 http://ppa.launchpad.net/libreoffice/ppa/ubuntu/ oneiric/main i386 Packages
        100 /var/lib/dpkg/status
     1:3.4.3-3ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ oneiric/main i386 Packages

3) What is expected to happen in LibreOffice Calc is when one of the cells contains a line break -> Edit -> Find and Replace... -> in the "Search for" drop down \n -> in the "Replace with" drop down \n -> Regular expression button checked is the line break is replaced with a paragraph break as noted in http://help.libreoffice.org/Common/List_of_Regular_Expressions

4) What happens instead is the line break is replaced with the characters \n

*** Bug 43086 has been marked as a duplicate of this bug. ***

summary: - "\n" in replace field of Calc's search and replace is treated as text
+ [Upstream] Regular expression "\n" in replace field inputs "\n" instead
+ of paragraph break
description: updated
Changed in libreoffice (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
tags: added: xubuntu
Changed in df-libreoffice:
importance: Unknown → Medium
status: Unknown → Confirmed

I think this is a duplicate of bug44398, i.e. isn't this a more general problem than just \n?

(behaviour confirmed with version 3.5.3release, details entered in comment with bug 44398)

*** This bug has been marked as a duplicate of bug 44398 ***

Winfried Donkers, I do not agree with this being a duplicate of bug 44398, nor do I agree with bug 44398 being accepted as a valid report for that matter based on the title.

Many, purposefully or ignorantly, make wide-scoped "fix everything about a feature set" reports, as 44398's title is, and your subsequent comment https://bugs.freedesktop.org/show_bug.cgi?id=44398#c2 . This makes a report less likely to be resolved quickly.

However, this (43107) report is targeted, specific, and detailed.

Please do not toggle this report further unless you are submitting a patch. Thank you.

In 3.5.7 rc1 or 3.6.2.2 use "\n\n" in the replace field.
That works for me.
Can you pls check that?
(I remeber in the late OOo times there was a change in this, but can't find the details now).

I intend to close this one soon

(In reply to comment #4)
> In 3.5.7 rc1 or 3.6.2.2 use "\n\n" in the replace field.
> That works for me.
> Can you pls check that?

In Calc 3.6.2.2 (Build ID: da8c1e6) on Windows 7 64-bit, if I
 - use "\n\n" (excluding quotes) in the replace field
 - Click Replace all

Calc inserts those literal characters into the cell(s), not newline characters. Based on that I don't think this bug is fixed.

Using Version 3.6.3.2 on Mac OSX, \n is inserted as literal text (i.e., not as a newline) as well.

Version 3.6.5.2 (Build ID: 5b93205) on Linux. Same problem - neither \n nor \n\n work.

*** Bug 64144 has been marked as a duplicate of this bug. ***

Confirmed in 4.2.6.3 on Fedora (Build ID: 4.2.6.3-8.fc20).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.