Bug 115588 - Calc refers to non-existing N2 data style
Summary: Calc refers to non-existing N2 data style
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Linux (All)
: medium normal
Assignee: Tomaz Vajngerl
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks: Calc-Styles
  Show dependency treegraph
 
Reported: 2018-02-09 16:18 UTC by kangaba
Modified: 2021-06-04 12:02 UTC (History)
2 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 kangaba 2018-02-09 16:18:46 UTC
Description:
When creating a new spreadsheet the file styles.xml contains references to the data style "N2" which doesn't seem to be defined anywhere.
Here's the relevant xml code from styles.xml:

<text:date style:data-style-name="N2" text:date-value="2018-02-09">00/00/0000</text:date>, <text:time style:data-style-name="N2" text:time-value="17:59:19.206942154">

Steps to Reproduce:
1.Create a new spreadsheet and look into styles.xml for N2


Actual Results:  
N2 is referenced but not defined.

Expected Results:
N2 should be defined somewhere in styles.xml


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Comment 1 Xisco Faulí 2018-04-04 09:32:48 UTC
I can reproduce it in

Version: 6.1.0.0.alpha0+
Build ID: 2d5ce0e1b233c83f91481cd6b9306ac8de7f5ff8
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

and 

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

However, the reason why it's happening is unknown to me.
Comment 2 Xisco Faulí 2018-05-08 09:59:49 UTC
@Eike, do you know why this style reference is created?
Comment 3 Eike Rathke 2018-05-08 11:47:36 UTC
It seems to stem from the "Report" page style.

    <style:master-page style:name="Report" style:page-layout-name="Mpm2">
      <style:header>
        <style:region-left>
          <text:p><text:sheet-name>???</text:sheet-name><text:s/>(<text:title>???</text:title>)</text:p>
        </style:region-left>
        <style:region-right>
          <text:p><text:date style:data-style-name="N2" text:date-value="2018-05-08">00/00/0000</text:date>, <text:time>00:00:00</text:time></text:p>
        </style:region-right>
      </style:header>
      <style:header-left style:display="false"/>
      <style:footer>
        <text:p>Page <text:page-number>1</text:page-number><text:s/>/ <text:page-count>99</text:page-count></text:p>
      </style:footer>
      <style:footer-left style:display="false"/>
    </style:master-page>


It's unclear to me at the moment how the data-style ends up there (somehow via EditEngine), however, it is related to sc/source/core/data/stlpool.cxx ScStyleSheetPool::CreateStandardStyles() line 361 that does

    pEdEngine->QuickInsertField( SvxFieldItem(SvxDateField(Date( Date::SYSTEM ),SvxDateType::Var), EE_FEATURE_FIELD),
                                    ESelection() );
Comment 4 QA Administrators 2019-07-30 03:12:33 UTC Comment hidden (obsolete)
Comment 5 Roman Kuznetsov 2020-10-24 23:10:16 UTC
https://gerrit.libreoffice.org/c/core/+/104760
Comment 6 Commit Notification 2020-10-25 06:28:04 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e69b57d7f55eeab6253b9fab7edce06da50121f9

tdf#115588 write autoDataStyles for master-slides

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Eike Rathke 2021-06-04 12:02:42 UTC
I guess we can call this fixed..