Bug 74512

Summary: Formula error if apostrophe in a sheet name
Product: LibreOffice Reporter: pierre-yves samyn <pierre-yves.samyn>
Component: SpreadsheetAssignee: Kohei Yoshida (inactive) <libreoffice>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: high CC: markus.mohrhard, vulcain
Version: 4.2.0.3 rcKeywords: regression
Hardware: Other   
OS: All   
Whiteboard: target:4.3.0 target:4.2.1
i915 platform: i915 features:
Attachments: BugQuote.ods (sheet name with an apostrophe)

Description pierre-yves samyn 2014-02-04 16:06:55 UTC
Created attachment 93370 [details]
BugQuote.ods (sheet name with an apostrophe)

Hello

Formula error if apostrophe in a sheet name

Reproduced on :
- windows 7/64, XP with 4.2.0.4
- Ubuntu 12.04 (QA-fr) 4.2.0.4 Build ID:
05dceb5d363845f2cf968344d7adab8dcfb2ba71 

Steps to reproduce

1. File> New> Spreadsheet
2. Insert> Sheet> Name: give a name with apostrophe

("test d'apostrophe" in the attached example)

3. In Sheet1.A1 type the formula:
='test d''apostrophe'.A1

Note: need to "double" the apostrophe. In the line above you must type 2 ' and not 1 " between "d" and "a"

Expected result: the 2 ' must be kept
Actual result : one is kept

='test d'apostrophe'.A1

Consequently, the formula no longer work at the next change (replace A1 by B1 for example), or simply when reloading the document

4. Save, close, reopen the spreadsheet: the formula no longer recognizes the sheet name and displays #NAME ?

Note: the bug is the same if you do not type the formula but if you use the mouse to go search the cell.

5. In Sheet1.B1 type =
6. With the mouse click on the "test d'apostrophe" tab, click on A1
in this sheet and then press Enter.

Return on Sheet1 the formula is:
='test d'apostrophe'.A1 

Expected result ( as in previous versions ):
='test d''apostrophe'.A1 

I set the status to "new" because the bug has been reproduced

Also reproduce with Version: 4.2.0.3
Build ID: c63c03decdf780d8fb80823950665b782ec9ecd0

Was OK with 4.1.4.2 Build ID: 0a0440ccc0227ad9829de5f46be37cfb6edcf72

Markus, I add you to CC list because it could be related to bug 71549 ?

Regards
Pierre-Yves
Comment 1 Kohei Yoshida (inactive) 2014-02-08 22:33:51 UTC
I'll take this.
Comment 2 Commit Notification 2014-02-08 23:16:51 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74512: Add test for this.



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 3 Commit Notification 2014-02-08 23:17:05 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74512: Generate escaped sheet names after the grammer is set.



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 4 Kohei Yoshida (inactive) 2014-02-08 23:18:07 UTC
4.2 backport request: https://gerrit.libreoffice.org/7947
Comment 5 Commit Notification 2014-02-09 17:20:46 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0b3342e214d2f9edffbdc595de3410cfc96322d4&h=libreoffice-4-2

fdo#74512: Generate escaped sheet names after the grammer is set.


It will be available in LibreOffice 4.2.1.

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 6 Kohei Yoshida (inactive) 2014-02-09 17:47:46 UTC
Fixed.
Comment 7 pierre-yves samyn 2014-02-15 07:15:54 UTC
Hello

Thank you Kohei to work on this...

Sorry to reopen but the patch does not fix the problem completely

It is only ok from step 1 to 3 but the bug still occurs when you save and reopen the spreadsheet.

I still reproduce from step 4 on windows 7/64 with:

Version: 4.3.0.0.alpha0+
Build ID: e076b5290e706b8a69abd397a9f255eba6a0cd1a
TinderBox: Win-x86@39, Branch:master, Time: 2014-02-13_23:23:34

and Version: 4.2.1.1
Build ID: d7dbbd7842e6a58b0f521599204e827654e1fb8b

Regards
Pierre-Yves
Comment 8 Kohei Yoshida (inactive) 2014-02-15 13:20:10 UTC
(In reply to comment #7)

> It is only ok from step 1 to 3 but the bug still occurs when you save and
> reopen the spreadsheet.

Exact steps please.
Comment 9 pierre-yves samyn 2014-02-15 13:28:51 UTC
(In reply to comment #8) 
> Exact steps please.

Steps to reproduce

1. File> New> Spreadsheet
2. Insert> Sheet> Name: give a name with apostrophe

("test d'apostrophe" for example)

3. In Sheet1.A1 type the formula:
='test d''apostrophe'.A1

Expected result & Actual result: Ok, the 2 ' are kept

='test d''apostrophe'.A1

4. Save, close, reopen the spreadsheet: the formula no longer recognizes the sheet name and displays #NAME ?

the formula was changed:

='test d'apostrophe'.A1

Regards
Pierre-Yves
Comment 10 Commit Notification 2014-02-15 15:09:50 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74512: Add export test for this.



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 11 Commit Notification 2014-02-15 15:10:03 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74512: Fix the ODS export as well.



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 Kohei Yoshida (inactive) 2014-02-15 15:21:25 UTC
4.2: https://gerrit.libreoffice.org/8074
4.2.1: https://gerrit.libreoffice.org/8075
Comment 13 Commit Notification 2014-02-17 15:15:19 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fc7d5cfe5611a90beb16c15cc0a2304ef2c15acc&h=libreoffice-4-2

fdo#74512: Fix the ODS export as well.


It will be available in LibreOffice 4.2.2.

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 14 Commit Notification 2014-02-18 00:21:36 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8deefff6659fda0e38734c2b3176826276debb5d&h=libreoffice-4-2-1

fdo#74512: Fix the ODS export as well.


It will be available already in LibreOffice 4.2.1.

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 15 Kohei Yoshida (inactive) 2014-02-18 00:25:20 UTC
Fixed again.
Comment 16 Michael Stahl 2014-02-21 11:12:11 UTC
since 4.2.1.1 is 4.2.1 release, only the first patch made it in, it will be fully fixed in 4.2.2
Comment 17 pierre-yves samyn 2014-02-22 07:32:36 UTC
Hello

WORKSFORME on windows 7/64 with Version: 4.2.3.0.0+
Build ID: 5fd90cdd1fdb20ab7f6a2b67c384f0994f09a86b
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-02-21_22:38:15

Thank you :)

Regards
Pierre-Yves

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.