Bug 43767 - Writer FORMATTING: Impossible numbering with small Roman numbers of list with capital letters
Summary: Writer FORMATTING: Impossible numbering with small Roman numbers of list with...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: lowest enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0
Keywords:
: 60331 (view as bug list)
Depends on:
Blocks: Bullet-Number-Outline-Lists
  Show dependency treegraph
 
Reported: 2011-12-12 15:57 UTC by kaesezeh
Modified: 2024-07-24 15:16 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test case (9.74 KB, application/vnd.oasis.opendocument.text)
2012-02-14 00:46 UTC, sasha.libreoffice
Details
43767_caseMapNumbering.odt: testing lowercase, Titlecase, UPPERCASE, SmallCaps (19.38 KB, application/vnd.oasis.opendocument.text)
2024-06-19 13:49 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kaesezeh 2011-12-12 15:57:10 UTC
When you have a numbered list in Writer that starts with a word in small caps then that small caps formatting also applies to the numbering. This means, for instance, you can't have a small Roman numbering with, say, small caps words like this,

(i)   GRAMMATICALITY
(ii)  ASPECT

which is just plain illogical and annoying.
Comment 1 sasha.libreoffice 2012-02-14 00:46:26 UTC
Created attachment 57015 [details]
test case

But my be so should be? Please, see in another offices, how there is this situation.
Meanwhile start list items with space and leave this space unformatted.
Comment 2 kaesezeh 2012-02-18 09:18:49 UTC
what kind of a stupid comment is that?? So, I leave a space and then once the bullet point text goes into the next line this destroys the hanging indent!? This is nonsense. In Word, you can double-click on the paragraph mark and format the paragraph separately from the text and don't have to leave a space there that kills the alignment of the indent, and that's how this SHOULD work.
Comment 3 sasha.libreoffice 2012-03-07 03:15:23 UTC
Sorry for stupid comment. Meanwhile try this:

To force list to be with specific format in Writer do following:
1. Place mouse cursor on any item and left click it. All items becomes in grey
squares
2. Change format of character to desired (for example:font size, bold, italic,
red color)
3. If format appears already desired, then change to wrong format and then back
to desired (we want font size 12 and it is already 12, then change to 14 and
than back to 12)

In Impress all list items are independent form each other, so to change format
of all list, select explicitly ALL list.
Comment 4 kaesezeh 2012-03-10 09:02:28 UTC
Thanks for the tip. However, it doesn't work on my machine even in your file. For instance,

1 I loaded your test case document;
2 I triple-click into the first line and press CTRL-B to make it all bold;
3 I click once onto the "i." and the grey highlighting appears;
4a What DOES work is then right-click and "Clear direct formatting";
4b What does NOT work is then changing the format to anything. For instance, when I change the color to green, nothing happens, neither to the numbering nor to the "Asdfz".

Strange ...
Comment 5 sasha.libreoffice 2012-03-12 07:23:53 UTC
Thanks for additional testing. It is because used Roman numbers. With Arabic numbers it works. But with Roman numbers not works and even if change to Arabic, it still not works.
IMHO it is a bug. When I select list with Roman numbers, change attributes and see on "undo" button, I see that attributes changed. But nothing changed.
In msWord 2003 formatting of list works as described in comment 3.
Comment 6 ign_christian 2014-06-24 03:57:26 UTC
*** Bug 60331 has been marked as a duplicate of this bug. ***
Comment 7 QA Administrators 2015-07-18 17:44:46 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2015-10-23 17:32:52 UTC
Still repro.

Format>>Character>>Tab: Font Effects and under Effects select. Small Capitals 

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: fcc2415ade6ae93710bbbda9f7e163045e323105
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-10-21_16:55:13
Locale: fi-FI (fi_FI)
Comment 9 QA Administrators 2017-03-06 16:13:32 UTC Comment hidden (obsolete, obstolete)
Comment 10 Thomas Lendo 2018-10-09 09:50:31 UTC
Still reproducible.

Version: 6.2.0.0.alpha0+ (x64)
Build ID: e46f8a9a4e3c5b0542c0813b476b449f3af8d607
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-10-07_23:36:50
Locale: de-AT (de_AT); Calc: CL

The bad thing with this issue is, that you even can't correct the capitalization with a character style that has a font effect 'Without' or 'Lowercase'.
Comment 11 QA Administrators 2019-10-10 02:39:53 UTC Comment hidden (obsolete, spam)
Comment 12 Justin L 2021-05-01 12:17:44 UTC
Seems to be a different rendition of bug 97005, bug 136718, bug 136536, and bug 131785
Comment 13 Justin L 2021-05-19 13:38:51 UTC
Note: footnotes have the same problem...

I think https://cgit.freedesktop.org/libreoffice/core/commit/?id=478f9ad06412c910d0264f76962a6d5e1a01aaa2 is probably a good code pointer. It added overlines as a similar exception to underlines. But it is a BIG commit, and I don't know for sure if it handled ignoring overlines on numbering right away or if that was added later...


If you add this line to txtfld.cxx
     // i18463:
     // Underline style of paragraph font should not be considered
     pNumFnt->SetUnderline( LINESTYLE_NONE );
     // Overline style of paragraph font should not be considered
     pNumFnt->SetOverline( LINESTYLE_NONE );
+    pNumFnt->SetCaseMap(SvxCaseMap::NotMapped);

then any line with an underline or overline also fixes the case mapping. But what triggers the font to be used (or repainted)???
Comment 14 Justin L 2021-05-19 18:53:23 UTC
Sometimes Writer delays loading the document, and then it doesn't convert to smallCaps. But normally you can see it load OK, then within seconds shift to smallCaps.

I tried adding SvxCaseMap::NotMapped != GetCaseMap() everywhere I saw a similar comparison to GetOverline() and GetStrikeout(), but that didn't work. I'm lost.
Comment 15 Justin L 2023-05-05 19:07:19 UTC
(In reply to kaesezeh from comment #2)
> This is nonsense. In Word, you can double-click on the paragraph
> mark and format the paragraph 
Yes - this kind of nonsense in MS Word is exactly why we have this problem in LO. LO thankfully doesn't allow formatting the CR, and so this hacky nonsense needed to be added for interoperability reasons.

Unfortunately, MS seems to have made an exception for "small caps". Although the red from the paragraph marker affects the numbering, the small caps property does not. (Tested in MS Word 2010.)
Comment 16 Justin L 2024-06-18 00:17:57 UTC
Interesting thing.
In SwTextFormatter::NewNumberPortion, if I force changing the color also
    if (pNumFnt->GetCaseMap() != SvxCaseMap::NotMapped)
    {
        pNumFnt->SetCaseMap(SvxCaseMap::NotMapped);
        pNumFnt->SetColor(COL_GREEN); 
    }
then it works, but if I don't set the color, the casemap still displays.
Comment 17 Justin L 2024-06-19 13:49:55 UTC
Created attachment 194822 [details]
43767_caseMapNumbering.odt: testing lowercase, Titlecase, UPPERCASE, SmallCaps

DOCX round-trip: the MS UI only has checkboxes for "All caps" and "Small caps", so when saving to DOCX the attempt to "lowercase" and "titlecase" are dropped.

Interestingly, while MS doesn't mirror "small caps" onto the list number, it does mirror "uppercase".
Comment 18 Justin L 2024-06-20 15:06:10 UTC
(In reply to Justin L from comment #16)
> if I don't set the color, the casemap still displays.
That is because inftxt.cxx SwFontSave doesn't switch fonts because they have the same cacheId when only CaseMap or SuperScript are changed.

Sadly, there is no comment saying why SwFontSave should NOT switch to a requested font. The existing comment just states the obvious, and was added when creating yet another exception...
commit 221c5dc5269cd480c4d4771e3de13339c47c7ab4
Author: Frank Meies on Tue Jul 17 08:11:33 2001 +0000
    Fix #89771#: Attributes for special portions (number, footnote, drop caps) at beginning of paragraph

Also sadly there is no SwFont.operator==, or SvxFont.operator==. One would expect those to exist, but no comments saying why they don't. Do we really never compare fonts in writer?
Comment 19 Commit Notification 2024-06-27 23:25:11 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5c6c6a73e9c58ad934a4f89505d5b3e2b781e0b9

tdf#43767 mso-format layout: no smallcaps applied to numbering

It will be available in 25.2.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 20 Justin L 2024-06-27 23:33:26 UTC
Comment 19's patch fixes the Microsoft formats.

I don't like these adhoc exceptions, so I didn't
attempt to apply them to ODF formats.
Let's keep it simple for ODF - any char format that applies
to the entire paragraph should apply to numbering as well
(except for the existing underline/overline exceptions).

I'll leave this bug report open to for anyone who disagrees with me and wants their name attached to complicating ODF.