Bug 67094 - Spreadsheet Reads Any Number of Spaces in Cell as a Single Space
Summary: Spreadsheet Reads Any Number of Spaces in Cell as a Single Space
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.0.3 rc
Hardware: All All
: highest blocker
Assignee: Eike Rathke
URL:
Whiteboard: target:4.2.0 target:4.1.1
Keywords: regression
: 67458 (view as bug list)
Depends on:
Blocks: mab4.1
  Show dependency treegraph
 
Reported: 2013-07-19 17:19 UTC by Joel Madero
Modified: 2013-07-29 08:42 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Madero 2013-07-19 17:19:07 UTC
Steps to Reproduce:

1. Open Spreadsheet
2. Type "this          is a test" -- lots of spaces
3. Save as ODS
4. Close
5. Open

Expected:
You see the text as you wrote it

Observed
You see "this is a test" with a single space

Also exists on master
Comment 1 Joel Madero 2013-07-19 17:21:28 UTC
Marking as NEW as it's been confirmed by erAck & Papamatti


Also erAck confirmed that the data is stored - just not reading correctly upon opening
Comment 2 Cor Nouws 2013-07-21 19:17:58 UTC
prolly related (not yet reported as bug)
type " =3+4" in a cell (without double quotes, but with leading space
this shows as " =3+4"
save file and reopen
 > space is removed and cell shows "7"
Comment 3 Eike Rathke 2013-07-22 18:04:28 UTC
When reading

aaa     bbb    (5 spaces)
 =3+4          (text with 1 leading space)

saved with 4.0.4

        <table:table-row table:style-name='ro1'>
          <table:table-cell office:value-type='string'>
            <text:p>aaa
              <text:s text:c='4' />bbb
            </text:p>
          </table:table-cell>
        </table:table-row>
        <table:table-row table:style-name='ro1'>
          <table:table-cell office:value-type='string'>
            <text:p>
              <text:s />=3+4
            </text:p>
          </table:table-cell>
        </table:table-row>

in 4.1.0.2 this results in
aaa bbb    (1 space only)
=          #NAME?    (i.e. interpreted as formula with no content)

Saving again in 4.1.0.2 leads to data loss.
Comment 4 Eike Rathke 2013-07-23 14:40:32 UTC
Found the cause, working on a fix.
Comment 5 Commit Notification 2013-07-23 15:32:27 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

resolved fdo#67094 handle <text:s> in <text:p> and <text:span>



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 Eike Rathke 2013-07-23 15:49:50 UTC
Pending review
for 4-1 as https://gerrit.libreoffice.org/5051
for 4-1-0 as https://gerrit.libreoffice.org/5052
Comment 7 Michael Meeks 2013-07-23 15:54:15 UTC
I can't see this in an RC5 for 4.1.0 personally. Too old a bug, and too big a patch I think; it's obviously the right thing to do for 4.1.1 though [!].

It would be -lovely- to see a unit test for it too IMHO ;-) thanks for the quick fix Eike !
Comment 8 Cor Nouws 2013-07-23 16:27:58 UTC
(In reply to comment #7)
> ....  Too old a bug, and ...

of course I can't step in the other considerations, but this issue is only 3 days old :)
Comment 9 Commit Notification 2013-07-23 19:42:45 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

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

resolved fdo#67094 handle <text:s> in <text:p> and <text:span>


It will be available in LibreOffice 4.1.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 10 Eike Rathke 2013-07-23 19:46:41 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > ....  Too old a bug, and ...
> 
> of course I can't step in the other considerations, but this issue is only 3
> days old :)

Michael was probably referring that the regression was introduced in master beginning of February and wasn't discovered until now.
Comment 11 Commit Notification 2013-07-23 20:20:07 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-1-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3d1ab404feb742c59652b381c54af4ca624dca15&h=libreoffice-4-1-0

resolved fdo#67094 handle <text:s> in <text:p> and <text:span>


It will be available already in LibreOffice 4.1.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.
Comment 12 Cor Nouws 2013-07-23 20:48:34 UTC
(In reply to comment #10)

> Michael was probably referring that the regression was introduced in master
> beginning of February and wasn't discovered until now.

I guess so yes ;)
(Alas no daylies for me. And no extra time either of course)
Comment 13 Commit Notification 2013-07-23 21:08:30 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

unit test for <text:s> in <text:p> and <text:span>, fdo#67094



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 Michael Meeks 2013-07-24 19:56:38 UTC
This all looks beautiful, and thanks Eike for fixing it so nicely & unit testing it too => marking fixed to make MAB's easier to grok :-)
Comment 15 Commit Notification 2013-07-25 12:59:38 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":

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

unit test for <text:s> in <text:p> and <text:span>, fdo#67094


It will be available in LibreOffice 4.1.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 16 Eike Rathke 2013-07-25 15:29:36 UTC
(In reply to comment #11)
> It will be available already in LibreOffice 4.1.0.

Note that the commit happened after RC4 tagging, the fix will actually be in 4.1.1
The commit 3d1ab404feb742c59652b381c54af4ca624dca15 could be applied as a hotfix if someone wanted to roll an own 4.1.0 build.
Comment 17 Cor Nouws 2013-07-29 08:42:16 UTC
*** Bug 67458 has been marked as a duplicate of this bug. ***