Bug Hunting Session
Bug 39969 - Applying formatting doesnt work correctly if cell contains multiple direct formatting sequences
Summary: Applying formatting doesnt work correctly if cell contains multiple direct fo...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 108394 (view as bug list)
Depends on: 107965
Blocks: Calc-Cells Cell-Direct-Formatting-Parts
  Show dependency treegraph
 
Reported: 2011-08-09 23:39 UTC by Whistler
Modified: 2019-03-14 03:52 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
test spreadsheet (16.45 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-08-09 23:40 UTC, Whistler
Details
sample ods (12.39 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-06-03 13:53 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Whistler 2011-08-09 23:39:37 UTC
Step to reproduce:

1. Open the attached spreadsheet.
2. Select all the cells by clicking the top-left button, and apply any kind of text formating (font, size, text color, etc.).
3. Some texts (specially cell C26, D26 and A28 in this file) are not formatted as expected.

I'm unable to find out the detailed condition on when this happens.
Comment 1 Whistler 2011-08-09 23:40:22 UTC
Created attachment 50087 [details]
test spreadsheet
Comment 2 Rainer Bielefeld Retired 2011-08-10 05:41:36 UTC
I tried to reproduce with "LibreOffice 3.4.2  - WIN7  Home Premium (64bit) German UI [OOO340m1 (Build:203)]" 

1a) In step 2 I selected "font color = red" from picker, and for example in 'C26' half the text remains black. That might be unexpected, but can be explained with a direct formatting for the characters in the cell. 
1b) When I select 'C26' between step 1 and 2, then do menu 'Format -> Clear direct formatting', my step 2 works as expected for 'C26'. 

So there seems to be nothing unexpected.

But:

For me the interesting that I can not see any character format setting "black" or similar when I select one of the characters remaining Black in 'C26'. I would have expected to see that in the menu 'Format -> Cells -> Font Effects', but I only see Style=Default - Color = Automatic.

I see the same behavior with OOo 3.1.1 and LibO3.3.3 Portable

@Whistler:
Can you confirm my observations?
How has your document been created?
Comment 3 Whistler 2011-08-10 18:06:31 UTC
Thanks for reply.

> 1a) In step 2 I selected "font color = red" from picker, and for example in
> 'C26' half the text remains black. That might be unexpected, but can be
> explained with a direct formatting for the characters in the cell.

If "direct formatting" means the format applied to a part of the text manually then I don't think this is correct behavior... as following these steps:

1) create a new spreadsheet document
2) type "This is a test" in any cell
3) select only the word "test" in the cell, and set font color to black
4) select the cell itself, set font color to red

...then all the texts in the cell are red.

also, the formatting works correctly with attached file in M$ Excel 2007 (SP2) and Lotus Symphony 3.


> How has your document been created?

It was originally an M$ Excel template (unable to upload this as it's not allowed by my employer, sorry). I just typed in all the texts with libreoffice and saved it as opendocument and did not do something special (eg. editing the xmls manually, etc).
Comment 4 Jeffrey 2011-08-13 06:49:12 UTC
Confirmed for LibreOffice 3.4  340m1(Build:103) on OpenSuse Linux. It looks like the formatting problem has to do with bullet points, for in cells C26 and D26 the formatting stops at the bullets.

Also, I followed Rainer's point on clear direct formatting, which is a workaround to the problem.

Thanks for the document and the steps.
Comment 5 Rainer Bielefeld Retired 2011-09-02 01:26:13 UTC
CONFIRMED due to Comment 4

To me this cell internal formatting seems to be totally broken. I have been used to see that  cell internal  formatting with priority to complete cell formatting. That means when I have a Cell contents "One red word" and modify word "red" to red character color, this color should remain red when I selec tell with cell cursor and change character color to blue - only characters of words "One" and "word" should become red. So it works in OOo 3.1.1. In LibO 3.4 also word "red" becomes blue. That is something different to the observations here, but might be related. 

@David
I believe this priority issue needs some more elaborated info in Help and Documentation

@kohei
Please feel free to reassign (or reset Assignee to default) if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 6 David Nelson 2011-09-02 01:34:36 UTC
Rainer, OK, I've bookmarked this bug in my mail for my to-do list, and forwarded info to the docs ML in case someone wants to step in and act.
Comment 7 Whistler 2011-09-03 06:26:50 UTC
just a note:

> That means when I have a Cell contents "One red word" and modify
> word "red" to red character color, this color should remain red when I selec
> tell with cell cursor and change character color to blue - only characters of
> words "One" and "word" should become red. So it works in OOo 3.1.1. In LibO 3.4
> also word "red" becomes blue. That is something different to the observations
> here, but might be related. 

I tried the following ones:

OOo 3.1.0
Gnumeric 1.8.3
M$ Office 2003
M$ Office 2007 SP2
Lotus Symphony 3

...and none except Gnumeric has the mentioned behavior (ie. in all of the above except Gnumeric the word "red" become blue as well).
(I would like to try KSpread and Google Docs as well however I didn't figure out how to apply formats to texts)
Comment 8 Björn Michaelsen 2011-12-23 13:27:03 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2015-02-19 15:50:31 UTC Comment hidden (obsolete)
Comment 10 Whistler 2015-02-22 07:12:55 UTC
This bug still exists (LiberOffice 4.3.5 under GNU/Linux).
Comment 11 Whistler 2015-02-25 13:01:27 UTC
4.4.0.3 under Windows also has the same bug.
Comment 12 tommy27 2016-04-16 07:25:52 UTC Comment hidden (obsolete)
Comment 13 QA Administrators 2017-05-22 13:27:50 UTC Comment hidden (obsolete)
Comment 14 Yousuf Philips (jay) (retired) 2017-06-03 13:04:36 UTC
Confirmed in master

Version: 5.5.0.0.alpha0+
Build ID: b08217989558addbcaded122a4e7211ae24bbcff
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-05-31_06:36:03
Locale: en-US (en_US.UTF-8); Calc: group
Comment 15 Yousuf Philips (jay) (retired) 2017-06-03 13:53:40 UTC
Created attachment 133824 [details]
sample ods

So i created this sample spreadsheet in 5.5 master.

If you select C2 and apply italics and then unapply italics, the text previously having italics retain italics. So if we investigate the xml, we see the C2 originally is like so.

 <style:style style:name="T3" style:family="text">
   <style:text-properties fo:font-style="italic" ... />
 </style:style>
 <style:style style:name="T4" style:family="text">
   <style:text-properties fo:font-style="italic" ... />
 </style:style>

 <table:table-cell ...>
   <text:p>
     <text:span text:style-name="T3">Italic Text</text:span>
   </text:p>
   <text:p>Non-Italic Text</text:p>
   <text:p>
     <text:span text:style-name="T4">Italic Text</text:span>
   </text:p>
 </table:table-cell>

And after apply the italics, it has applied it at the cell level and not at the individual paragraph levels, as the xml looks like this.

 <style:style style:name="ce2" style:family="table-cell" ... >
   <style:text-properties fo:font-style="italic" ... />
 </style:style>

 <table:table-cell table:style-name="ce2" ... >
   <text:p>
     <text:span text:style-name="T3">Italic Text</text:span>
   </text:p>
   <text:p>Non-Italic Text</text:p>
   <text:p>
     <text:span text:style-name="T4">Italic Text</text:span>
   </text:p>
 </table:table-cell>

And when unapplying the italics, it also sets it at the cell level, which the paragraph level attributes will ignore.

 <style:style style:name="ce3" style:family="table-cell" ... >
   <style:text-properties fo:font-style="normal" ... />
 </style:style>

 <table:table-cell table:style-name="ce3" ... >
   <text:p>
     <text:span text:style-name="T3">Italic Text</text:span>
   </text:p>
   <text:p>Non-Italic Text</text:p>
   <text:p>
     <text:span text:style-name="T4">Italic Text</text:span>
   </text:p>
 </table:table-cell>

This problem can also be seen with D2 when applying & unapplying underline and should also be seen in B2 when applying & unapplying bold, but it is broken.
Comment 16 Yousuf Philips (jay) (retired) 2017-06-20 21:46:35 UTC
*** Bug 108394 has been marked as a duplicate of this bug. ***
Comment 17 Thomas Lendo 2018-03-13 23:18:06 UTC
Is this really a bug?

I can't see any mistake in Jay's xml code in comment 15 - the direct formatted cell content (aka span styles) stay in its condition, no matter what attributes the cell as a whole (aka cell style) gets or loses. The first test file works well after doing Ctrl+M on all cells.

The whole situation is the cause why I wish character (span) styles also in Calc (Bug 108220 - Add Character styles in Calc cells).

Version: 6.1.0.0.alpha0+
Build ID: cab04bc39b5164ea74216cd849c3af5f5b298f79
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: de-DE (de_DE.UTF-8); Calc: group

The only bug I see here is the different behaviors similar as described in comment 3.

1. Create a spreadsheet with some text in a cell.
2. Copy the cell content to other cells so that several rows and columns are filled.
3. Select a single character or word in a random cell and assign color red.
4a. Select all cells of the sheet and assign font color blue. -> The red text is still red.
4b. Select a random range of cells including the cell with red text and assign font color green. -> The red text is now green.
4c. Undo the last step and select the column with the cell with red text and assign font color yellow. -> The red text is still red.
4d. Select the row with the cell with red text and assign font color purple. -> The red text is now purple.
4e. Undo the last step and select only the cell with red text and assign font color lime. -> The red text is now lime.
Comment 18 QA Administrators 2019-03-14 03:52:09 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug