circular17 4 gadi atpakaļ
vecāks
revīzija
f61c014a2a

+ 2 - 0
.gitignore

@@ -34,3 +34,5 @@ lazpaint/units/
 *.deb
 lazpaint/release/debian/lazpaint*_no_install.tar.gz
 /web/public/*
+
+lazpaint/tablet/backup/

+ 4 - 0
lazpaint/dialog/color/uadjustcurves.pas

@@ -202,7 +202,9 @@ begin
   begin
     pointList := curve.GetVariable('Points');
     pointCount := curve.GetListCount(pointList);
+    symbols := nil;
     setlength(symbols, pointCount);
+    symbolsColor := nil;
     setlength(symbolsColor, pointCount);
     for i := 0 to pointCount-1 do
     begin
@@ -212,6 +214,7 @@ begin
     end;
     if curve.Booleans['Posterize'] then
     begin
+      pts := nil;
       setlength(pts, pointCount*2);
       for i := 0 to pointCount-2 do
       begin
@@ -525,6 +528,7 @@ begin
   FSelectedPoint:= -1;
   if HueTabSelected then
   begin
+    labels := nil;
     setlength(labels, 7);
     labels[0] := '0';
     labels[1] := '60';

+ 3 - 0
lazpaint/dialog/ubrowseimages.pas

@@ -617,7 +617,9 @@ begin
     end;
 
     setlength(FCacheComputeIconIndexes, cacheComputeCount);
+    newFilenames := nil;
     setlength(newFilenames, cacheComputeCount);
+    newLastModifications := nil;
     setlength(newLastModifications, cacheComputeCount);
     for i := 0 to cacheComputeCount-1 do
     begin
@@ -1217,6 +1219,7 @@ begin
       end;
     end;
 
+  filesToDelete := nil;
   setlength(filesToDelete, deleteCount);
   deleteCount := 0;
   for i := 0 to ShellListView1.ItemCount-1 do

+ 1 - 1
lazpaint/image/uimage.pas

@@ -108,7 +108,7 @@ type
       AOriginal: TBGRALayerCustomOriginal; var ADiff: TBGRAOriginalDiff);
     procedure OriginalEditingChange({%H-}ASender: TObject;
       {%H-}AOriginal: TBGRALayerCustomOriginal);
-    procedure OriginalLoadError(ASender: TObject; AError: string;
+    procedure OriginalLoadError({%H-}ASender: TObject; {%H-}AError: string;
       var ARaise: boolean);
     procedure SetBlendOperation(AIndex: integer; AValue: TBlendOperation);
     procedure SetCurrentFilenameUTF8(AValue: string);

+ 1 - 0
lazpaint/image/uimageaction.pas

@@ -639,6 +639,7 @@ begin
     img := Image.SelectionLayerReadonly;
   end;
   try
+    str := '';
     setlength(str, img.width*img.height*8);
     strPos := 1;
     for yb := 0 to img.Height-1 do

+ 1 - 1
lazpaint/image/uimagestate.pas

@@ -55,7 +55,7 @@ type
       AOriginal: TBGRALayerCustomOriginal; var ADiff: TBGRAOriginalDiff);
     procedure OriginalEditingChange({%H-}ASender: TObject;
       AOriginal: TBGRALayerCustomOriginal);
-    procedure OriginalLoadError(ASender: TObject; AError: string;
+    procedure OriginalLoadError({%H-}ASender: TObject; AError: string;
       var ARaise: boolean);
     procedure SelectImageLayer(AValue: TBGRABitmap);
     procedure SelectImageLayerByIndex(AValue: integer);

+ 1 - 1
lazpaint/image/ustatetype.pas

@@ -197,7 +197,7 @@ type
 
 implementation
 
-uses Math, BGRALzpCommon, UFileSystem;
+uses Math, UFileSystem;
 
 { TComposedImageDifference }
 

+ 5 - 2
lazpaint/lazpaint.lpi

@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="11"/>
+    <Version Value="12"/>
     <PathDelim Value="\"/>
     <General>
+      <Flags>
+        <CompatibilityMode Value="True"/>
+      </Flags>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="LazPaint"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
@@ -1066,6 +1068,7 @@
     </CodeGeneration>
     <Linking>
       <Debugging>
+        <DebugInfoType Value="dsDwarf2Set"/>
         <UseHeaptrc Value="True"/>
       </Debugging>
       <Options>

+ 2 - 2
lazpaint/lazpaintinstance.pas

@@ -75,7 +75,7 @@ type
     procedure PythonBusy({%H-}Sender: TObject);
     function ScriptShowMessage(AVars: TVariableSet): TScriptResult;
     function ScriptInputBox(AVars: TVariableSet): TScriptResult;
-    procedure ToolQueryColorTarget(sender: TToolManager; ATarget: TVectorialFill);
+    procedure ToolQueryColorTarget({%H-}sender: TToolManager; ATarget: TVectorialFill);
 
   protected
     InColorFromFChooseColor: boolean;
@@ -287,7 +287,7 @@ uses LCLType, Types, Dialogs, FileUtil, StdCtrls, LCLIntf, BGRAUTF8, UTranslatio
      USharpen, uposterize, UPhongFilter, UFilterFunction,
      uprint, USaveOption, UFormRain,
 
-     ugraph, LCScaleDPI, ucommandline, uabout, UPython, BGRAGraphics;
+     ugraph, LCScaleDPI, ucommandline, uabout, UPython;
 
 { TLazPaintInstance }
 

+ 3 - 0
lazpaint/lazpaintmainform.pas

@@ -1310,6 +1310,7 @@ begin
           if mr = mrOK then
           begin
             OpenPictureDialog1.FilterIndex := FBrowseImages.FilterIndex;
+            chosenFiles := nil;
             setlength(chosenFiles, FBrowseImages.SelectedFileCount);
             for i := 0 to high(chosenFiles) do
               chosenFiles[i] := FBrowseImages.SelectedFile[i];
@@ -2140,6 +2141,7 @@ begin
               end; //case
               //When files are open this way, they get the name of the first of them.
               //They shall have no name, in order to prevent saving with Save (it then gets redirected to Save As)
+              loadedLayers := nil;
               setlength(loadedLayers,length(FileNames));
               tx := 0;
               ty := 0;
@@ -3201,6 +3203,7 @@ begin
     needUpdate := false;
     p := @txt[1];
     pEnd := @txt[length(txt)];
+    utf8char := '';
     while p <= pEnd do
     begin
       utf8len := min(UTF8CharacterLength(p), (pEnd-p)+1);

+ 2 - 0
lazpaint/tools/utooldeformationgrid.pas

@@ -294,6 +294,7 @@ begin
       if FHighQuality then
       begin
         dest := TBGRABitmap.Create(FCurrentBounds.Width*OversampleQuality,FCurrentBounds.Height*OversampleQuality);
+        quadHQ := nil;
         setlength(quadHQ, length(quad));
         for i := 0 to high(quad) do quadHQ[i] := (quad[i]+PointF(0.5,0.5))*OversampleQuality - PointF(0.5,0.5) - PointF(FCurrentBounds.TopLeft)*OversampleQuality;
       end
@@ -1065,6 +1066,7 @@ begin
     gridMaxY := NbY-1;
 
     //progressive drawing of deformation zones
+    gridDone := nil;
     setlength(gridDone,NbY-1,NbX-1);
     for yb := gridMinY to gridMaxY-1 do
       for xb := gridMinX to gridMaxX-1 do

+ 2 - 0
lazpaint/tools/utoollayer.pas

@@ -434,6 +434,7 @@ begin
             BitmapToVirtualScreen(m*PointF(FLayerBounds.Right-0.001,FLayerBounds.Top+0.001)),
             BitmapToVirtualScreen(m*PointF(FLayerBounds.Left+0.001,FLayerBounds.Bottom-0.001)));
   ptsF := ab.AsPolygon;
+  pts := nil;
   setlength(pts, length(ptsF));
   for i := 0 to high(pts) do
     pts[i] := ptsF[i].Round;
@@ -758,6 +759,7 @@ begin
             BitmapToVirtualScreen(m*PointF(FOriginalBounds.Right-0.001,FOriginalBounds.Top+0.001)),
             BitmapToVirtualScreen(m*PointF(FOriginalBounds.Left+0.001,FOriginalBounds.Bottom-0.001)));
   ptsF := ab.AsPolygon;
+  pts := nil;
   setlength(pts, length(ptsF));
   for i := 0 to high(pts) do
     pts[i] := ptsF[i].Round;

+ 2 - 0
lazpaint/tools/utoolselect.pas

@@ -295,6 +295,7 @@ begin
     if Assigned(VirtualScreen) then
     begin
       ptsF := ab.AsPolygon;
+      pts := nil;
       setlength(pts, length(ptsF));
       for i := 0 to high(ptsF) do
         pts[i] := (ptsF[i]+PointF(0.5,0.5)).Round;
@@ -346,6 +347,7 @@ begin
       with TCustomRectShape(FShape) do
         ptsF := BGRAPath.ComputeEllipse(FEditor.Matrix*Origin,
                     FEditor.Matrix*XAxis,FEditor.Matrix*YAxis);
+      pts := nil;
       setlength(pts, length(ptsF));
       for i := 0 to high(ptsF) do
         pts[i] := ptsF[i].Round;

+ 1 - 0
lazpaint/ubrushtype.pas

@@ -129,6 +129,7 @@ begin
         result.FillEllipseAntialias((result.Width-1)/2,(result.Height-1)/2,ASize/2,ASize/2,BGRABlack);
       end else
       begin
+        pts := nil;
         setlength(pts, brushSides);
         for i := 0 to high(pts) do
           pts[i] := PointF((result.Width-1)/2+sin(i*2*Pi/brushSides)*ASize/2,

+ 3 - 0
lazpaint/uclipboard.pas

@@ -101,6 +101,7 @@ begin
                  poly := deserial.GetObjectField(segment,j) as TSerializedArray;
                  if poly <> nil then
                  begin
+                   polyPts := nil;
                    setlength(polyPts, poly.FieldCount);
                    for k := 0 to high(polyPts) do
                    begin
@@ -162,6 +163,7 @@ begin
   end;
   if isWidestring then
   begin
+    w := '';
     setlength(w, length(data) div 2);
     move(data[1],w[1],length(data));
     result := UTF8Encode(w);
@@ -499,6 +501,7 @@ begin
     begin
        Stream := TMemoryStream.Create;
        Clipboard.GetFormat(Clipboard.Formats[i],Stream);
+       data := '';
        if stream.Size > 65536 then
         setlength(data,65536) else
           setlength(data,stream.size);

+ 2 - 2
lazpaint/udarktheme.pas

@@ -26,7 +26,7 @@ type
     procedure ToolBarPaint(Sender: TObject; ADarkTheme: boolean);
     procedure ToolBarPaintLight(Sender: TObject);
     procedure ToolBarPaintDark(Sender: TObject);
-    procedure ToolBarPaintButton(Sender: TToolButton; State: integer; ADarkTheme: boolean);
+    procedure ToolBarPaintButton(Sender: TToolButton; State: integer; {%H-}ADarkTheme: boolean);
     procedure ToolBarPaintButtonLight(Sender: TToolButton; State: integer);
     procedure ToolBarPaintButtonDark(Sender: TToolButton; State: integer);
     procedure Apply(AForm: TForm; AThemeEnabled: boolean; ARecursive: boolean = true); overload;
@@ -61,7 +61,7 @@ implementation
 uses
   BCTypes, BGRABitmap, BGRABitmapTypes, GraphType, BGRACustomDrawn, LCScaleDPI
   {$IFDEF DARWIN_DARK_THEME}, CocoaAll, CocoaUtils{$ENDIF}
-  {$IFDEF WINDOWS}, Windows, Win32Proc, Registry{$ENDIF};
+  {$IFDEF WINDOWS}, Win32Proc, Registry{$ENDIF};
 
 const
   clDarkBtnHighlight = $e0e0e0;

+ 2 - 0
lazpaint/ufilesystem.pas

@@ -634,8 +634,10 @@ begin
     exit;
   end;
   nbRealFiles:= 0;
+  realFiles := nil;
   setlength(realFiles, length(AFilenamesUTF8));
   nbContainedFiles:= 0;
+  containedFiles := nil;
   setlength(containedFiles, length(AFilenamesUTF8));
   for i := 0 to high(AFilenamesUTF8) do
     if ParseExtendedFilename(AFilenamesUTF8[i]).SubFilename = '' then

+ 1 - 0
lazpaint/uimagebackup.pas

@@ -439,6 +439,7 @@ begin
   ASource.ReadBuffer({%H-}newBounds, sizeof(newBounds));
   ASource.ReadBuffer({%H-}newGrayscale, sizeof(newGrayscale));
   ASource.ReadBuffer({%H-}lenRows, sizeof(lenRows));
+  newRows := nil;
   setlength(newRows, lenRows);
   if lenRows > 0 then ASource.ReadBuffer(newRows[0], sizeof(newRows[0])*length(newRows));
   ASource.ReadBuffer({%H-}dataSize, sizeof(dataSize));

+ 3 - 0
lazpaint/uimagelist.pas

@@ -532,6 +532,7 @@ var
   i: Integer;
 begin
   files := AVars.GetVariable('FileNames');
+  fileArray := nil;
   setLength(fileArray, AVars.GetListCount(files));
   for i := 0 to high(fileArray) do
     fileArray[i] := AVars.GetStringAt(files, i);
@@ -1119,6 +1120,7 @@ var
    i: integer;
    TempVar: array of String;
 begin
+  TempVar := nil;
   SetLength(TempVar, aStrings.Count);
   For i := 0 To aStrings.Count-1 Do
     TempVar[i] := aStrings[i];
@@ -1143,6 +1145,7 @@ begin
 
     if FBrowseImages.ShowModal = mrOK then
     begin
+      fileNames := nil;
       setlength(fileNames,FBrowseImages.SelectedFileCount);
       for i := 0 to high(fileNames) do
         fileNames[i] := FBrowseImages.SelectedFile[i];

+ 1 - 0
lazpaint/uimagepreview.pas

@@ -353,6 +353,7 @@ procedure TImagePreview.DrawMenu(Bitmap: TBGRABitmap);
   begin
     ptsF := PointsF([PointF(x+sw*0.20,y+sh*0.1),PointF(x+sw*0.55,y+sh*0.1),PointF(x+sw*0.75,y+sh*0.3),
                      PointF(x+sw*0.75,y+sh*0.9),PointF(x+sw*0.20,y+sh*0.9)]);
+    ptsF2 := nil;
     setlength(ptsF2,length(ptsF));
     for j := 0 to high(ptsF) do
         ptsF2[j] := ptsF[j] + PointF(3,3);

+ 1 - 1
lazpaint/uimageview.pas

@@ -21,7 +21,7 @@ type
 
   TOpaquePaintBox = class(TCustomControl)
   protected
-    procedure WMEraseBkgnd(var Message: TLMEraseBkgnd); message LM_ERASEBKGND;
+    procedure WMEraseBkgnd(var {%H-}Message: TLMEraseBkgnd); message LM_ERASEBKGND;
     procedure WMPaint(var Message: TLMPaint); message LM_PAINT;
   public
     PaintRect: TRect;

+ 4 - 1
lazpaint/uloadimage.pas

@@ -19,7 +19,7 @@ implementation
 uses FileUtil, BGRAAnimatedGif, Graphics, UMultiImage,
   BGRAReadLzp, LCLProc, BGRABitmapTypes, BGRAReadPng,
   UFileSystem, BGRAIconCursor, BGRAReadTiff,
-  Dialogs, math, URaw, UResourceStrings;
+  Dialogs, URaw;
 
 function LoadIcoEntryFromStream(AStream: TStream; AIndex: integer): TImageEntry;
 var ico: TBGRAIconCursor;
@@ -46,6 +46,7 @@ begin
   ico := TBGRAIconCursor.Create;
   try
     ico.LoadFromStream(AStream);
+    result := nil;
     setlength(result,ico.Count);
     for i := 0 to ico.Count-1 do
     begin
@@ -84,6 +85,7 @@ var gif: TBGRAAnimatedGif; i: integer;
 begin
   gif := TBGRAAnimatedGif.Create(AStream);
   try
+    result := nil;
     setlength(result,gif.Count);
     for i := 0 to gif.Count-1 do
     begin
@@ -123,6 +125,7 @@ begin
   tiff := TBGRAReaderTiff.Create;
   try
     tiff.LoadFromStream(AStream);
+    result := nil;
     setlength(result,tiff.ImageCount);
     for i := 0 to tiff.ImageCount-1 do
     begin

+ 1 - 1
lazpaint/umainformlayout.pas

@@ -55,7 +55,7 @@ type
     function GetToolBoxVisible: boolean;
     function GetUpdatingPopup: boolean;
     procedure ImageToolbarUpdate(Sender: TObject);
-    procedure ImageViewMouseBefore(ASender: TObject; AShift: TShiftState);
+    procedure ImageViewMouseBefore({%H-}ASender: TObject; AShift: TShiftState);
     procedure ImageViewMouseMove(Sender: TObject; APosition: TPointF);
     procedure ImageViewOnPaint(Sender: TObject);
     procedure SetFillSelectionHighlight(AValue: boolean);

+ 0 - 1
lazpaint/umenu.pas

@@ -289,7 +289,6 @@ procedure TMainFormMenu.AddInstalledScripts(AMenu: TMenuItem; AIndex: integer);
 var
   path, fullname, title: String;
   searchRec: TSearchRec;
-  t: textFile;
   item: TMenuItem;
   items: TStringList;
   i: Integer;

+ 3 - 0
lazpaint/umyslv.pas

@@ -544,6 +544,7 @@ var
     clientArea := rect(0,textHeight,w,h);
     FItemsPerPage:= Size(clientArea).cy div FActualRowHeight;
 
+    colPos := nil;
     setlength(colPos,ColumnCount+1);
     colPos[0] := 0;
     for col := 0 to ColumnCount-1 do
@@ -1082,6 +1083,7 @@ var i,j,curSize,totalSize: integer;
   s: string;
 begin
   if (ItemCount = 0) or (ColumnCount = 0) then exit;
+  colSizes := nil;
   setlength(colSizes,ColumnCount);
   sizeA := ABitmap.TextSize('a').cx;
   for j := 0 to ColumnCount-1 do
@@ -1315,6 +1317,7 @@ begin
     lst.Add(@FData[i]);
   SortTarget := self;
   lst.Sort(@LCListViewCompare);
+  sortedData := nil;
   setlength(sortedData,ItemCount);
   for i := 0 to lst.Count-1 do
     sortedData[i] := PLCShellListViewItemData(lst[i])^;

+ 1 - 0
lazpaint/uprocessauto.pas

@@ -60,6 +60,7 @@ type
 
   procedure InitBuffer(out Buffer: TReceiveBuffer; ASize: integer; AOnReceive: TReceiveLineEvent);
   begin
+    Buffer.Data := '';
     setlength(Buffer.Data, ASize);
     Buffer.Length:= 0;
     Buffer.OnReceive:= AOnReceive;

+ 1 - 0
lazpaint/upython.pas

@@ -202,6 +202,7 @@ begin
     if Assigned(FOnOutputLine) then
     begin
       finalLine := FLinePrefix+ALine;
+      displayedLine := '';
       setlength(displayedLine, 80);
       curDisplayPos := 1;
       maxDisplayLen := 0;

+ 1 - 0
lazpaint/uselectionhighlight.pas

@@ -262,6 +262,7 @@ procedure TSelectionHighlight.DrawAffine(ADestination: TBGRACustomBitmap;
   begin
     m := AffineMatrixTranslation(CoordPrecision div 2, CoordPrecision div 2)*
          AffineMatrixScale(CoordPrecision,CoordPrecision)*AMatrix;
+    pts := nil;
     setlength(pts, length(APoly));
     for i := 0 to high(APoly) do
     begin

+ 7 - 0
lazpaint/utiff.pas

@@ -763,6 +763,7 @@ var
 begin
   case ValueType of
   tvtAscii: begin
+      result := '';
       setlength(result, ValueCount-1);
       if result <> '' then
         move(Data^, result[1], length(result));
@@ -975,6 +976,7 @@ begin
     end;
   if wordSized then
   begin
+    words := nil;
     setlength(words, length(AValues));
     for i := 0 to high(AValues) do
       words[i] := AValues[i];
@@ -1162,7 +1164,9 @@ begin
     exit;
   end;
 
+  offsets := nil;
   setlength(offsets, AList.Count);
+  byteCounts := nil;
   setlength(byteCounts, AList.Count);
 
   for i := 0 to AList.Count-1 do
@@ -1205,6 +1209,7 @@ begin
   subError := AInput.ReadWord(dirCount);
   if subError <> teNone then Exit(subError);
 
+  rawEntries := nil;
   setlength(rawEntries, dirCount);
   subError := AInput.ReadBuffer(rawEntries[0], dirCount*sizeof(TTiffRawDirEntry));
   if subError <> teNone then Exit(subError);
@@ -1240,6 +1245,7 @@ begin
   SaveChunks(AOutput);
 
   SortEntries;
+  rawEntries := nil;
   setlength(rawEntries, EntryCount);
   for i := 0 to EntryCount-1 do
     Entry[i]^.SaveToOutput(AOutput, rawEntries[i]);
@@ -1441,6 +1447,7 @@ procedure TTiff.SaveToStream(AStream: TStream);
 var indices: array of integer;
   i: Integer;
 begin
+  indices := nil;
   setlength(indices, Count);
   for i := 0 to high(indices) do
     indices[i] := i;