Skip to content

External XML Styles overritten by default styles #3422

@jordanwarner

Description

@jordanwarner

In #3345 the default styles are added in even when you have external xml styles. If you have styled any of those default items (Title, Heading1, Heading2, etc.) in your external xml styles they are overwritten by the default style.

A (truncated) version of the the generated xml is below, with the default 'Title' style at the top overwritting the custom 'Title' style at the bottom.

<?xml version="1.0" encoding="UTF-8"?>
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16="http://schemas.microsoft.com/office/word/2018/wordml" xmlns:w16cex="http://schemas.microsoft.com/office/word/2018/wordml/cex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16du="http://schemas.microsoft.com/office/word/2023/wordml/word16du" xmlns:w16sdtdh="http://schemas.microsoft.com/office/word/2020/wordml/sdtdatahash" xmlns:w16sdtfl="http://schemas.microsoft.com/office/word/2024/wordml/sdtformatlock" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" mc:Ignorable="w14 w15 w16se w16cid w16 w16cex w16sdtdh w16sdtfl w16du">
   <w:docDefaults>
      <w:rPrDefault />
      <w:pPrDefault />
   </w:docDefaults>
   <w:style w:type="paragraph" w:styleId="Title">
      <w:name w:val="Title" />
      <w:basedOn w:val="Normal" />
      <w:next w:val="Normal" />
      <w:qFormat />
      <w:rPr>
         <w:sz w:val="56" />
         <w:szCs w:val="56" />
      </w:rPr>
   </w:style>
......
   <w:docDefaults>
      <w:rPrDefault>
         <w:rPr>
            <w:rFonts w:asciiTheme="minorHAnsi" w:eastAsiaTheme="minorHAnsi" w:hAnsiTheme="minorHAnsi" w:cstheme="minorBidi" />
            <w:sz w:val="24" />
            <w:szCs w:val="24" />
            <w:lang w:val="en-US" w:eastAsia="en-US" w:bidi="ar-SA" />
         </w:rPr>
      </w:rPrDefault>
      <w:pPrDefault />
   </w:docDefaults>
   <w:style w:type="paragraph" w:styleId="Title">
      <w:name w:val="Title" />
      <w:basedOn w:val="Heading1" />
      <w:next w:val="AuthorList" />
      <w:link w:val="TitleChar" />
      <w:qFormat />
      <w:rsid w:val="000C6FA5" />
      <w:rPr>
         <w:sz w:val="32" />
      </w:rPr>
   </w:style>
   <w:style w:type="character" w:customStyle="1" w:styleId="TitleChar">
      <w:name w:val="Title Char" />
      <w:basedOn w:val="DefaultParagraphFont" />
      <w:link w:val="Title" />
      <w:rsid w:val="00583311" />
      <w:rPr>
         <w:rFonts w:ascii="Arial" w:eastAsia="Times New Roman" w:hAnsi="Arial" w:cs="Arial" />
         <w:b />
         <w:bCs />
         <w:color w:val="0021A5" />
         <w:kern w:val="36" />
         <w:sz w:val="32" />
         <w:szCs w:val="27" />
         <w:shd w:val="clear" w:color="auto" w:fill="FFFFFF" />
      </w:rPr>
   </w:style>
......
</w:styles>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions