How is multi-run text-level formatting interpreted in Excel/SpreadsheetML

Home Forums SpreadsheetML How is multi-run text-level formatting interpreted in Excel/SpreadsheetML

This topic contains 0 replies, has 1 voice, and was last updated by  GabrielS 7 years, 12 months ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #3364

    GabrielS
    Participant

    I’ve been reading about SpreadsheetML and how it represents text-level formatting as opposed to cell-level formatting but there are some missing bits that I’d like to figure out.

    In my first sample file, it is unclear to me why all runs except the first one re-declare in run properties formatting items (such as size and color) which are inherited anyway from the cell-level style. Isn’t this redundant? Why does the first run skip them but the next ones don’t?

    <r>
        <t>a</t>
    </r><r>
        <rPr>
            <b/>
            <sz val="11"/>
            <color rgb="FFFF0000"/>
            <rFont val="Calibri"/>
            <family val="2"/>
            <scheme val="minor"/>
        </rPr><t>b</t>
    </r>

    In the second sample file, I don’t understand why the 2nd run is not marked with the black color in its properties, because it clearly overrides the cell-level green color.

    <r>
        <t>Green phrase.</t>
    </r><r>
        <rPr>
            <sz val="11"/>
            <rFont val="Calibri"/>
            <family val="2"/>
            <scheme val="minor"/>
        </rPr><t xml:space="preserve"> And something new.</t>
    </r>

    I suspect there are some hidden rules in Excel/SpreadsheetML that are neither documented (not even in ECMA-376) nor very intuitive.

    Funny thing, it seems even Microsoft is confused about these rules. If you follow the link and open the 2nd sample in OneDrive Excel, you will see that the entire text is colored green, however if you download it and open it in MS Excel you will notice the 2nd phrase is actually in black. Now which of these is the correct rendering?

    Can someone please help me and explain all these text-level formatting rules, or point me to some documentation?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.