You've already forked lazarus-ccr
fpspreadsheet: Fix conversion of biff palette colors for fonts in reader.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5860 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -980,9 +980,10 @@ begin
|
|||||||
{ Color index }
|
{ Color index }
|
||||||
// The problem is that the palette is loaded after the font list; therefore
|
// The problem is that the palette is loaded after the font list; therefore
|
||||||
// we do not know the rgb color of the font here. We store the palette index
|
// we do not know the rgb color of the font here. We store the palette index
|
||||||
// ("SetAsPaletteIndex") and replace it by the rgb color at the end of the
|
// ("SetAsPaletteIndex") and replace it by the rgb color after reading of the
|
||||||
// workbook globals records. As an indicator that the font does not yet
|
// palette and after reading the workbook globals records. As an indicator
|
||||||
// contain an rgb color a control bit is set in the high-byte of the TsColor.
|
// that the font does not yet contain an rgb color a control bit is set in
|
||||||
|
// the high-byte of the TsColor.
|
||||||
lColor := WordLEToN(AStream.ReadWord);
|
lColor := WordLEToN(AStream.ReadWord);
|
||||||
if lColor < 8 then
|
if lColor < 8 then
|
||||||
// Use built-in colors directly otherwise the Workbook's FindFont would not find the font in ReadXF
|
// Use built-in colors directly otherwise the Workbook's FindFont would not find the font in ReadXF
|
||||||
|
@@ -1812,9 +1812,10 @@ begin
|
|||||||
{ Color index }
|
{ Color index }
|
||||||
// The problem is that the palette is loaded after the font list; therefore
|
// The problem is that the palette is loaded after the font list; therefore
|
||||||
// we do not know the rgb color of the font here. We store the palette index
|
// we do not know the rgb color of the font here. We store the palette index
|
||||||
// ("SetAsPaletteIndex") and replace it by the rgb color at the end of the
|
// ("SetAsPaletteIndex") and replace it by the rgb color after reading of the
|
||||||
// workbook globals records. As an indicator that the font does not yet
|
// palette and after reading the workbook globals records. As an indicator
|
||||||
// contain an rgb color a control bit is set in the high-byte of the TsColor.
|
// that the font does not yet contain an rgb color a control bit is set in
|
||||||
|
// the high-byte of the TsColor.
|
||||||
lColor := WordLEToN(AStream.ReadWord);
|
lColor := WordLEToN(AStream.ReadWord);
|
||||||
if lColor < 8 then
|
if lColor < 8 then
|
||||||
// Use built-in colors directly otherwise the Workbook's FindFont would not find the font in ReadXF
|
// Use built-in colors directly otherwise the Workbook's FindFont would not find the font in ReadXF
|
||||||
|
@@ -1944,6 +1944,11 @@ begin
|
|||||||
// Read palette colors and add them to the palette
|
// Read palette colors and add them to the palette
|
||||||
while FPalette.Count < n do
|
while FPalette.Count < n do
|
||||||
FPalette.AddColor(DWordLEToN(AStream.ReadDWord));
|
FPalette.AddColor(DWordLEToN(AStream.ReadDWord));
|
||||||
|
|
||||||
|
// The problem is that the palette is loaded after the font list. During
|
||||||
|
// loading of the fonts the font color had stored the palette index. Here
|
||||||
|
// we replace the palette index by the rgb color.
|
||||||
|
FixColors;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@ ----------------------------------------------------------------------------
|
{@@ ----------------------------------------------------------------------------
|
||||||
|
@@ -7,7 +7,11 @@
|
|||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<Title Value="spreadtestgui"/>
|
<Title Value="spreadtestgui"/>
|
||||||
|
<Scaled Value="True"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
</General>
|
</General>
|
||||||
<i18n>
|
<i18n>
|
||||||
<EnableI18N LFM="False"/>
|
<EnableI18N LFM="False"/>
|
||||||
|
@@ -16,6 +16,7 @@ uses
|
|||||||
hyperlinktests, pagelayouttests, protectiontests;
|
hyperlinktests, pagelayouttests, protectiontests;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Application.Scaled := True;
|
||||||
{$IFDEF HEAPTRC}
|
{$IFDEF HEAPTRC}
|
||||||
// Assuming your build mode sets -dDEBUG in Project Options/Other when defining -gh
|
// Assuming your build mode sets -dDEBUG in Project Options/Other when defining -gh
|
||||||
// This avoids interference when running a production/default build without -gh
|
// This avoids interference when running a production/default build without -gh
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user