Forum > LCL

[CLOSED] Code cleanup at nested procedures SaveState

(1/1)

lagprogramming:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  procedure SaveState;  begin    if DCIndex <> 0 then exit;    DCIndex := SaveDC(DC);  end;  The above procedure can be found nested inside procedure TWin32ThemeServices.DrawText, function TCanvas.TextExtent and procedure TCanvas.TextRect. Before calling SaveState each time DCIndex is set to 0 which makes the line "if DCIndex <> 0 then exit;" useless.
The following patch removes the line from all three nested procedures.

AlexTP:
Posted to https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40649

Navigation

[0] Message Index

Go to full version