From f3543bdda8bc7672238e38999c47f5e8da98d10d Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 26 Jul 2020 21:39:01 +0000 Subject: [PATCH] fpspreadsheet: Fix Excel XML writing of percent numberformat. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7571 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/source/common/xlsxml.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/fpspreadsheet/source/common/xlsxml.pas b/components/fpspreadsheet/source/common/xlsxml.pas index 2b42bb6dc..73c1de8a1 100644 --- a/components/fpspreadsheet/source/common/xlsxml.pas +++ b/components/fpspreadsheet/source/common/xlsxml.pas @@ -3068,6 +3068,7 @@ var deffnt, fnt: TsFont; s, fmtVert, fmtHor, fmtWrap, fmtRot: String; nfp: TsNumFormatParams; + nfs: String; fill: TsFillPattern; cb: TsCellBorder; cbs: TsCellBorderStyle; @@ -3168,8 +3169,9 @@ begin begin nfp := book.GetNumberFormat(fmt^.NumberFormatIndex); nfp.AllowLocalizedAMPM := false; // Replace "AMPM" by "AM/PM" + nfs := nfp.NumFormatStr; AppendToStream(AStream, Format(INDENT3 + - '' + LF, [UTF8TextToXMLText(nfp.NumFormatStr)])); + '' + LF, [nfs])); // Do not UTF8TextToXMLText(nfs) because of '%' end; // Background