嗨user352078(上口即名稱)(通過「SS:父=」)的SpreadsheetML中風格
實際上繼承不工作(至少它確實對我來說),但你可能會遇到一個 - 無處記錄,據我所見 - 問題: 如果你重新定義一個樣式元素(在下面的例子),你不會繼承已經定義的樣式。所以sty_ProjektzeileStatus必須定義邊框風格的每個方面,儘管我有相同的底部風格(即LineStyle:「Dash」等)。
因此,如果國界繼承樣式被重新定義,爲邊框所有現有styledefinitions被拋出,並已被定義(究竟是不是太糟糕,因爲這樣你就不必明確地刪除現有樣式繼承樣式中的父類型)。
<Style ss:ID="sty_ProjektzeileTexte" ss:Name="Texte">
<Font ss:Bold="1" />
<NumberFormat ss:Format="Standard" />
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Dash" ss:Weight="1" />
</Borders>
</Style>
<Style ss:ID="sty_ProjektzeileStatus" ss:Parent="sty_ProjektzeileTexte">
<!-- Overwrites original definition -->
<NumberFormat ss:Format="0" />
<!-- Although only Right line is added to the original definition from the parent style,
all 'sides' of the border element need to be defined,
even style for Bottom that is unchanged -->
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Dash" ss:Weight="1" />
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="2" />
</Borders>
<!-- Only fontstyle Bold is actually inherited -->
</Style>
我希望能回答你的問題。我只記得曾經遇到過設置父類和子類風格名稱(ss:Name =)時出現一些意想不到的後果的問題,但我不記得是否也導致了被遺棄的繼承)。
HTH
安德烈亞斯
此錯誤依然存在在Excel中:@風格的繼承在Excel XML根本打破。 – trojanfoe 2014-11-28 08:37:44
感謝您確認我的分析。我不確定,如果這真的被破壞或應該這樣工作(無論出於何種原因)。 – 2015-07-16 19:08:42