Bug 89330 - Cell formula converted to lowercase, including cross-references to other files when having a syntax error
Summary: Cell formula converted to lowercase, including cross-references to other file...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.6.1 rc
Hardware: Other All
: medium normal
Assignee: Jan
URL:
Whiteboard: target:4.5.0 target:4.4.2 target:4.3.7
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-12 09:26 UTC by Jerome Fenal
Modified: 2015-02-20 04:57 UTC (History)
4 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 Jerome Fenal 2015-02-12 09:26:48 UTC
On version 4.3.6.2 as found in F21.
Build ID: 4.3.6.2-1.fc21

When entering in a cell a formula including a reference to cells in another file, if the formula has a syntax error, the complete content of the formula is converted to lowercase, including the path to the file containing the referenced cells.

That is a problem on case sensitive operating systems, such as Linux, and should not happen, at least not on file path components of a formula.

To reproduce:
- open two sheets, from two different files FileA and FileB,
- from sheet FileA, enter a valid reference to a cell in FileB,
- the path is shown in the formula with the valid case,
- modify the formula to introduce an error, such as an invalid cell reference (='file:///Path/To/FileA.ods'#$Sheet1.A1A instead of ='file:///Path/To/FileA.ods'#$Sheet1.A1),
- the complete content of the formula is converted to lower case:
   ='file:///path/to/filea.ods'#$sheet1.a1a

Which makes it even more difficult to fix the formula, as usually you to rebuild it completely if the path is long...
Comment 1 raal 2015-02-12 16:45:24 UTC
I can confirm with Version: 4.5.0.0.alpha0+
Build ID: 40432ac6caa478474d73786f95b808c14e106ff2
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-02-03_01:24:42
Comment 2 m_a_riosv 2015-02-12 21:48:10 UTC
There is a bug reporting the same problem but it was resolved (I think improperly) for the reported as fixed, because she/he found a workaround.

https://bugs.documentfoundation.org/show_bug.cgi?id=75617
Comment 3 Jan 2015-02-13 10:46:02 UTC
I wrote a small unittest to reproduce the problem:

void Test::testErrorOnExternalReferences()
{
    m_pDoc->InsertTab(0, "Sheet1");
    m_pDoc->SetString(ScAddress(0,0,0), "='file:///Path/To/FileA.ods'#$Sheet1.A1A");
    
    ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(0,0,0));
    CPPUNIT_ASSERT(pFC);
    CPPUNIT_ASSERT_MESSAGE("This formula cell should be an error.", pFC->GetErrCode() != 0);

    if (!checkFormula(*m_pDoc, ScAddress(0,0,0), "'file:///Path/To/FileA.ods'#$Sheet1.A1A"))
	CPPUNIT_FAIL("Formula changed");
    
    m_pDoc->DeleteTab(0);
}


Problems seems to be somewhere in compiler.cxx
Comment 4 Commit Notification 2015-02-13 16:30:15 UTC
Jan Kantert committed a patch related to this issue.
It has been pushed to "master":

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

tdf#89330 preserve file name case in an unresolvable external named range

It will be available in 4.5.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 5 Commit Notification 2015-02-13 16:31:33 UTC
Jan Kantert committed a patch related to this issue.
It has been pushed to "master":

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

add unittest for tdf#89330

It will be available in 4.5.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 6 Commit Notification 2015-02-13 16:56:25 UTC
Jan Kantert committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

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

tdf#89330 preserve file name case in an unresolvable external named range

It will be available in 4.4.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 7 Commit Notification 2015-02-13 17:23:26 UTC
Jan Kantert committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

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

tdf#89330 preserve file name case in an unresolvable external named range

It will be available in 4.3.7.

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 8 Commit Notification 2015-02-20 04:57:00 UTC
Jan Kantert committed a patch related to this issue.
It has been pushed to "master":

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

move unit test for tdf#89330 to subsequent_filters-test and enable it

It will be available in 4.5.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.