修复font属性

This commit is contained in:
csh 2024-02-22 18:47:17 +08:00
parent e917dce1df
commit dbebc2805c
3 changed files with 12 additions and 8 deletions

View File

@ -620,20 +620,24 @@ End;
Function TSDocxFont.WriteSubscript(value);virtual; Function TSDocxFont.WriteSubscript(value);virtual;
Begin Begin
pr_.VertAlign := "subscript"; if value then pr_.VertAlign := "subscript";
else if self.Subscript then pr_.VertAlign := "none";
End; End;
Function TSDocxFont.ReadSubscript();virtual; Function TSDocxFont.ReadSubscript();virtual;
Begin Begin
return pr_.Value("VertAlign"); val := pr_.Value("VertAlign");
return val = "subscript";
End; End;
Function TSDocxFont.WriteSuperscript(value);virtual; Function TSDocxFont.WriteSuperscript(value);virtual;
Begin Begin
pr_.VertAlign := "supercript"; if value then pr_.VertAlign := "supercript";
else if self.Superscript then pr_.VertAlign := "none";
End; End;
Function TSDocxFont.ReadSuperscript();virtual; Function TSDocxFont.ReadSuperscript();virtual;
Begin Begin
return pr_.Value("VertAlign"); val := pr_.Value("VertAlign");
return val = "supercript";
End; End;
Function TSDocxFont.WriteUnderline(value);virtual; Function TSDocxFont.WriteUnderline(value);virtual;
@ -725,6 +729,6 @@ Begin
End; End;
Function TSDocxFont.ReadUnderlineColor();virtual; Function TSDocxFont.ReadUnderlineColor();virtual;
Begin Begin
return color_[pr_.Value("UColor")]; return color_[pr_.Value("UColor", true)];
End; End;

View File

@ -67,7 +67,7 @@ Begin
hash2 := hash; hash2 := hash;
for k, v in hash do for k, v in hash do
hash2[v] := k; hash2[v] := k;
hash2[nil] := TSDocxEnumerations.wdColorAutomatic(); if ifnil(hash2[nil]) then hash2[nil] := TSDocxEnumerations.wdColorAutomatic();
return hash2; return hash2;

View File

@ -26,7 +26,7 @@ Begin
hash2 := hash; hash2 := hash;
for k, v in hash do for k, v in hash do
hash2[v] := k; hash2[v] := k;
hash2[nil] := TSDocxEnumerations.wdAuto(); if ifnil(hash[nil]) then hash2[nil] := TSDocxEnumerations.wdAuto();
return hash2; return hash2;