From f2d18f718d416fb2bbef9032398d79d0664df6b4 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 17 Jun 2022 16:01:51 +0200 Subject: [PATCH] remove support for Laz versions < 2.2 --- lazproj/dexed.lpr | 12 ++++++++---- src/u_dockoptions.pas | 2 -- src/u_main.pas | 25 ------------------------- src/u_synmemo.pas | 22 ---------------------- src/u_synmultiguttermarks.pas | 8 -------- src/u_widget.pas | 2 -- 6 files changed, 8 insertions(+), 63 deletions(-) diff --git a/lazproj/dexed.lpr b/lazproj/dexed.lpr index 50a32e8b..2432ccd8 100644 --- a/lazproj/dexed.lpr +++ b/lazproj/dexed.lpr @@ -3,18 +3,22 @@ program dexed; {$mode objfpc}{$H+} uses - {$IFDEF UNIX}//{$IFDEF UseCThreads} + {$IFDEF UNIX} cthreads, - {$ENDIF}//{$ENDIF} + {$ENDIF} Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, anchordockpkg, tachartlazaruspkg, u_sharedres, u_dexed_d, u_observer, u_libman, u_symstring, u_tools, u_dcd, u_main, u_writableComponent, u_inspectors, u_editoroptions, u_dockoptions, u_shortcutseditor, u_mru, u_processes, u_dialogs, u_dubprojeditor, u_controls, u_dfmt, u_lcldragdrop, u_stringrange, u_dlangmaps, u_projgroup, u_projutils, - u_d2synpresets, u_dbgitf, u_ddemangle, u_dubproject, + u_d2synpresets, u_dbgitf, u_ddemangle, u_dubproject, LCLVersion, u_halstead, u_diff, u_profileviewer, u_semver, u_term, u_simpleget, -u_makeproject; + u_makeproject; + +{$if lcl_fullversion < 2020000} +{$ERROR Lazarus version >= 2.2 required} +{$endif} {$R *.res} diff --git a/src/u_dockoptions.pas b/src/u_dockoptions.pas index 14afbd74..0a1f0d7c 100644 --- a/src/u_dockoptions.pas +++ b/src/u_dockoptions.pas @@ -50,9 +50,7 @@ begin HideHeaderCaptionForFloatingCheckBox.OnChange := @doChanged; FlattenHeadersCheckBox.OnChange := @doChanged; FilledHeadersCheckBox.OnChange := @doChanged; - {$if lcl_fullversion >= 2020000} FloatingWindowsOnTop.Visible := false; - {$endif} // HeaderStyleComboBox.OnChange := @doChanged; // diff --git a/src/u_main.pas b/src/u_main.pas index a705e9b1..95112e47 100644 --- a/src/u_main.pas +++ b/src/u_main.pas @@ -1747,23 +1747,13 @@ var s: TAnchorDockSplitter; h: TAnchorDockHostSite; begin - - {$if lcl_fullversion >= 2020000} DockMaster.MainDockForm := self; - {$endif} fDockingIsInitialized := true; - if not reset then begin DockMaster.MakeDockSite(Self, [akBottom], admrpChild); DockMaster.OnShowOptions := @ShowAnchorDockOptions; - {$if lcl_fullversion < 2020000} - {$WARNING It is deprecated to use Lazarus 2.0.z to build dexed} - {$WARNING Support will be removed after Lazarus 2.2.2 release} - DockMaster.HeaderStyle := adhsPoints; - {$else} DockMaster.HeaderStyle := 'Points'; - {$endif} DockMaster.HideHeaderCaptionFloatingControl := true; // makes widget dockable for i := 0 to fWidgList.Count-1 do @@ -3765,25 +3755,10 @@ begin layoutUpdateMenu; end; -{$if lcl_fullversion < 2020000} -{$WARNING It is deprecated to use Lazarus 2.0.z to build dexed} -{$WARNING Support will be removed after Lazarus 2.2.2 release} -procedure TMainForm.updateFloatingWidgetOnTop(onTop: boolean); -var - widg: TDexedWidget; -const - fstyle: array[boolean] of TFormStyle = (fsNormal, fsStayOnTop); -begin - for widg in fWidgList do if widg.Parent.isAssigned and - widg.Parent.Parent.isNotAssigned and widg.isDockable then - TForm(widg.Parent).FormStyle := fstyle[onTop]; -end; -{$else} procedure TMainForm.updateFloatingWidgetOnTop(onTop: boolean); begin DockMaster.FloatingWindowsOnTop := onTop; end; -{$endif} procedure TMainForm.snapTopSplitterToMenu; var diff --git a/src/u_synmemo.pas b/src/u_synmemo.pas index 484ad01e..95bb4d6c 100644 --- a/src/u_synmemo.pas +++ b/src/u_synmemo.pas @@ -391,7 +391,6 @@ type property syncroEdit: TSynPluginSyncroEdit read fSyncEdit; property isDSource: boolean read fIsDSource; property isTemporary: boolean read getIfTemp; - property TextView; // property transparentGutter: boolean read fTransparentGutter write setGutterTransparent; property isProjectDescription: boolean read fIsProjectDescription write fIsProjectDescription; @@ -846,15 +845,7 @@ begin begin // - CollapsedLineForFoldAtLine() does not handle the sub-folding. // - TextView visibility is increased so this is not the standard way of getting the infos. - - {$if lcl_fullversion < 2020000} - {$WARNING It is deprecated to use Lazarus 2.0.z to build dexed} - {$WARNING Support will be removed after Lazarus 2.2.2 release} - start := fMemo.TextView.CollapsedLineForFoldAtLine(i); - {$else} start := TSynEditFoldedView(fMemo.TextViewsManager.SynTextViewByClass[TSynEditFoldedView]).CollapsedLineForFoldAtLine(i); - {$endif} - if start.equals(-1) then continue; if start = prev then @@ -886,13 +877,7 @@ begin itm := TFoldCache(fFolds.Items[i]); if not itm.isCollapsed then continue; - {$if lcl_fullversion < 2020000} - {$WARNING It is deprecated to use Lazarus 2.0.z to build dexed} - {$WARNING Support will be removed after Lazarus 2.2.2 release} - fMemo.TextView.FoldAtLine(itm.lineIndex-1); - {$else} TSynEditFoldedView(fMemo.TextViewsManager.SynTextViewByClass[TSynEditFoldedView]).FoldAtLine(itm.lineIndex-1); - {$endif} end; fMemo.SelStart := fCaretPosition; @@ -1174,14 +1159,7 @@ begin fTempFileName := GetTempDir(false) + 'temp_' + uniqueObjStr(self) + '.d'; fFilename := newdocPageCaption; fModified := false; - - {$if lcl_fullversion < 2020000} - {$WARNING It is deprecated to use Lazarus 2.0.z to build dexed} - {$WARNING Support will be removed after Lazarus 2.2.2 release} - TextBuffer.AddNotifyHandler(senrUndoRedoAdded, @changeNotify); - {$else} TextViewsManager.SynTextView[0].AddNotifyHandler(senrUndoRedoAdded, @changeNotify); - {$endif} Gutter.MarksPart.Visible:=false; diff --git a/src/u_synmultiguttermarks.pas b/src/u_synmultiguttermarks.pas index ab35dd14..10e957fd 100644 --- a/src/u_synmultiguttermarks.pas +++ b/src/u_synmultiguttermarks.pas @@ -87,22 +87,14 @@ var markRect: TRect; mark : TSynEditMark; i, h, w : integer; - {$if lcl_fullversion >= 2020000} iRange: TLineRange; - {$endif} begin Result := False; aFirstCustomColumnIdx := 0; - {$if lcl_fullversion < 2020000} - i := FoldView.TextIndex[aScreenLine]; - {$WARNING It is deprecated to use Lazarus 2.0.z to build dexed} - {$WARNING Support will be removed after Lazarus 2.2.2 release} - {$else} aScreenLine := aScreenLine + ToIdx(GutterArea.TextArea.TopLine); i := ViewedTextBuffer.DisplayView.ViewToTextIndexEx(aScreenLine, iRange); if aScreenLine <> iRange.Top then exit; - {$endif} if (i < 0) or (i >= TCustomSynEdit(SynEdit).Lines.Count) then exit; markLine := TCustomSynEdit(SynEdit).Marks.Line[i + 1]; diff --git a/src/u_widget.pas b/src/u_widget.pas index 69487c42..ac2895f7 100644 --- a/src/u_widget.pas +++ b/src/u_widget.pas @@ -210,9 +210,7 @@ begin win := DockMaster.GetAnchorSite(self); if win.isAssigned then begin - {$if lcl_fullversion >= 2020000} Show; - {$endif} win.Show; win.BringToFront; end;